code: public static int getInt(Object obj, String fieldName) {
          try {
              return getField(obj.getClass(), fieldName).getInt(obj);
          } catch (IllegalArgumentException e) {
              throw new RuntimeException(e);
          } catch (IllegalAccessException e) {
              throw new RuntimeException(e);
          }
      }
docs: Read the value of the field <tt>fieldName</tt> of object <tt>obj</tt>.
  @param obj The object
  @param fieldName The field name
  @return the value of the field.