code: public static void setField(Field field, Object target, Object value) {
          try {
              field.set(target, value);
          } catch (IllegalAccessException e) {
              throw new IllegalStateException("Could not access field: " + field, e);
          }
      }
docs: Set the field represented by the supplied {@link Field field object} on the
  specified {@link Object target object} to the specified {@code value}.
  In accordance with {@link Field#set(Object, Object)} semantics, the new value
  is automatically unwrapped if the underlying field has a primitive type.
  
  @param field the field to set
  @param target the target object on which to set the field
  @param value the value to set (may be {@code null})