First of all, here is the complete error (which does not match the correct MathSubset parameter): Bound mismatch: The type S is not a valid substitute for the bounded parameter <T extends Comparable<T>> of the type QifFixer.MathSubset<T>
The problem is that MathSubset expects <T extends Comparable<T> , but you give it S extends Solution<?> - those types that have nothing to do with each other because the solution does not inherit or does not implement Comparable<T> .
If anything, you can try the following:
public class SolutionsSubset<S extends Comparable<S>> extends MathSubset<S> implements Solutions<Solution<S>>;
Unfortunately, this will not work STILL, because MathSubset implements Iterable, but also a solution.
A simple solution would be for Solutions, so as not to extend Iterable, but it really sounds to me as if you are trying to use a more complex approach than you need. Maybe "has-a" instead of the "is-a" design might be more useful here?
EboMike
source share