code: public static Predicate<Class<?>> classImplements(Class<?> anInterface) {
          if (!anInterface.isInterface()) {
              throw new IllegalArgumentException("Class " + anInterface.getName() + " is not an interface");
          }
          return candidate -> candidate != null && !candidate.isInterface() && anInterface
                  .isAssignableFrom(candidate);
      }
docs: Checks if a candidate class is an interface.
  
  @return the predicate.