code: public static void setFieldValue(Object object, String fieldName, Object value) {
          try {
              getDeclaredFieldInHierarchy(object.getClass(), fieldName).set(object, value);
          } catch (IllegalArgumentException e) {
              throw new RuntimeException(e);
          } catch (IllegalAccessException e) {
              throw new RuntimeException(e);
          }
      }
docs: Convenience method for setting the value of a private object field,
  without the stress of checked exceptions in the reflection API.
  
  @param object
  Object containing the field.
  @param fieldName
  Name of the field to set.
  @param value
  Value to which to set the field.