code: @NullSafe
    public static boolean hasMainMethod(Class type) {
      return Optional.ofNullable(type).map(theType -> type.getDeclaredMethods())
        .map(methods -> stream(methods).anyMatch(ClassUtils::isMainMethod)).orElse(false);
    }
docs: Determines whether the given {@link Class} has a {@literal main} {@link Method}.
  
  @param type {@link Class} to evaluate.
  @return a boolean value indicating whether the given {@link Class} has a {@literal main} {@link Method}.
  @see java.lang.Class#getDeclaredMethods()
  @see #isMainMethod(Method)
  @see java.lang.Class