code: public static Optional<Method> getDeclaredMethod(Class type, String methodName, Class... argTypes) {
          try {
              return Optional.of(type.getDeclaredMethod(methodName, argTypes));
          } catch (NoSuchMethodException e) {
              return Optional.empty();
          }
      }
docs: Obtains a declared method.
  
  @param type       The type
  @param methodName The method name
  @param argTypes   The argument types
  @return The method