code: public static Object getValue(Object obj, String field) {
          Method getter = getGetterMethod(obj.getClass(), field);
  
          try {
              return getter.invoke(obj);
          } catch (IllegalAccessException | InvocationTargetException e) {
              return null;
          }
      }
docs: Gets value.
  
  @param obj   the obj
  @param field the field
  @return the value