code: public static List<Method> getAccessors(Class<?> clazz) {
      if (clazz == null) {
        throw new IllegalArgumentException("The 'clazz' parameter cannot be null.");
      }
  
      List<Method> methods = new ArrayList<>();
      for (Method method : clazz.getMethods()) {
        String methodName = method.getName();
        if (!"getClass".equals(methodName) && !"hashCode".equals(methodName) && method.getReturnType() != null
            && !Void.class.equals(method.getReturnType()) && method.getParameterTypes().length == 0
            && ((methodName.startsWith("get") && methodName.length() > 3)
                || (methodName.startsWith("is") && methodName.length() > 2)
                || (methodName.startsWith("has") && methodName.length() > 3))) {
          methods.add(method);
        }
      }
  
      // Order the methods alphabetically by name
      sort(methods, new Comparator<Method>() {
        /**
         * @see java.util.Comparator#compare(java.lang.Object, java.lang.Object)
         */
        @Override
        public int compare(Method method1, Method method2) {
          return method1.getName().compareTo(method2.getName());
        }
      });
  
      return unmodifiableList(methods);
    }
docs: Gets all accessor methods for the given {@code clazz}.
  
  @param clazz
  The class for which accessors are extracted.
  @return All accessor methods for the given {@code clazz}.