void (@NotNull Class<?> classKey, @NotNull Set<? super String> allSupers) { allSupers.add(classKey.getName()); for (Class<?> anInterface : classKey.getInterfaces()) { collectSupers(anInterface, allSupers); } Class<?> superClass = classKey.getSuperclass(); if (superClass != null) { collectSupers(superClass, allSupers); } }