code: public static Object getFieldValue(Object obj, Field field) {
          Object value = null;
          boolean accessible = field.isAccessible();
          //hack accessibility
          if (!accessible) {
              field.setAccessible(true);
          }
          try {
              value = field.get(obj);
          } catch (IllegalAccessException e) {
              //ignore should not happen as accessibility has been updated to suit assignment
              e.printStackTrace(); // $COVERAGE-IGNORE$
          }
          //restore accessibility
          field.setAccessible(accessible);
          return value;
      }
docs: Gets value of the field of the given object.
  @param obj The object
  @param field The field