code: public static <T extends Executable> Predicate<T> executableBelongsToClass(Class<?> reference) {
          return candidate -> candidate != null && reference.equals(candidate.getDeclaringClass());
      }
docs: Checks if a candidate executable does belong to the specified class.
  
  @param reference the class to check against.
  @return the predicate.