code: private static void checkInterfaces(Class<?> base, Deque<Class<?>> currents, Deque<Class<?>> nexts)
      {
          currents.stream()
                  .map(Class::getInterfaces)
                  .forEach(types -> Arrays.asList(types)
                                          .stream()
                                          .filter(type -> base.isAssignableFrom(type) && !type.equals(base))
                                          .forEach(nexts::add));
      }
docs: Store all declared valid interfaces into next.
  
  @param base The minimum base interface.
  @param currents The current interfaces found.
  @param nexts The next interface to check.