In my current project, I'm trying to do something like this:
Each ExtendedClass has its own ExtendedType class. Each ExtendedClass so far has its own method getTypes() which returns a Set<ExtendedType> which is then used further. Now what I want to do is refactor this so that getTypes() is in BaseClass. However I don't think there's a way to create a correctly typed set in the BaseClass and return it (or is there?), so I want to pass the set to the setTypes() method instead which should fill it then.
But when compiling, the above code produces the error "setTypes(Set<? super BaseType>) in BaseClass cannot be applied to (Set<ExtendedType>)". I'm not sure what I'm doing wrong here...any help appreciated.