I have a Foo interface that has a generic type -
public interface Foo<T> {
boolean apply(T t);
}
Having another Bar class that implements this interface, but what I want is a generic Bar type, which should be an assembly of type Interface A and B, with the definition below giving a compiler error -
public class Bar implements Foo<Collection<? extends A & B>>{
@Override
public boolean apply(Collection<? extends A & B> collect){
...
}
}
Can you suggest the right way to achieve this?
Can I use only a few borders only at the method level?
source
share