@SuppressWarnings("unchecked")
    public static List<Class<?>> getSupertypes(Class<?> type) {
        List<Class<?>> supertypes = new LinkedList<>();
        supertypes.add(type.getSuperclass());
        Collections.addAll(supertypes, type.getInterfaces());
        return supertypes;
    }
@ SuppressWarnings ( "unchecked" ) public static List < Class < ? > > getSupertypes ( Class < ? > type ) { List < Class < ? > > supertypes = new LinkedList < > ( ) ; supertypes . add ( type . getSuperclass ( ) ) ; Collections . addAll ( supertypes , type . getInterfaces ( ) ) ; return supertypes ; }
----------------------------------------------------------------------------------------------------------------------