code: private Method findFromStringMethod(Class<?> cls, String methodName) {
          Method m;
          try {
              m = cls.getMethod(methodName, String.class);
          } catch (NoSuchMethodException ex) {
              try {
                  m = cls.getMethod(methodName, CharSequence.class);
              } catch (NoSuchMethodException ex2) {
                  throw new IllegalArgumentException("Method not found", ex2);
              }
          }
          if (Modifier.isStatic(m.getModifiers()) == false) {
              throw new IllegalArgumentException("Method must be static: " + methodName);
          }
          return m;
      }
docs: Finds the conversion method.
  
  @param cls  the class to find a method for, not null
  @param methodName  the name of the method to find, not null
  @return the method to call, null means use {@code toString}