Check if a generic T implements an interface
Generics, oddly enough, use extends for interfaces as well.1 You’ll want to use: public class Foo<T extends SomeInterface>{ //use T as you wish } This is actually a requirement for the implementation, not a true/false check. For a true/false check, use unbounded generics(class Foo<T>{) and make sure you obtain a Class<T> so you have a … Read more