code: public static Object getFieldValue(Field field, Object obj) {
      try {
        return field.get(obj);
      } catch (IllegalAccessException e) {
        throw new IllegalArgumentException(e);
      }
    }
docs: Returns the value of the given field in the given object using reflection.