private static void collectInterfaces(Set<Class<?>> interfaces, Class<?> anInterface) {
        interfaces.add(anInterface);
        for (Class<?> superInterface : anInterface.getInterfaces()) {
            collectInterfaces(interfaces, superInterface);
        }
    }
private static void collectInterfaces ( Set < Class < ? > > interfaces , Class < ? > anInterface ) { interfaces . add ( anInterface ) ; for ( Class < ? > superInterface : anInterface . getInterfaces ( ) ) { collectInterfaces ( interfaces , superInterface ) ; } }
internal helper function to recursively collect Interfaces.
This is needed since {@link Class#getInterfaces()} does only return directly implemented Interfaces,
But not the ones derived from those classes.