anotherMethod just needs to return a Class , it could be the exact class that you have in mind that extends your enum and interface, or just a wildcard Class<?> (although you will have compile-time warnings). If you want to avoid warnings, the return type must be Class<T> with the definition of generics T , as in the method you call.
source share