code: public static void setField(Object instance, Class<?> type, String fieldName, Object fieldValue) {
  		try {
  			final Field field = type.getDeclaredField(fieldName);
  			field.setAccessible(true);
  			field.set(instance, fieldValue);
  		} catch (Exception exception) {
  			throw new Error(exception);
  		}
  	}
docs: Change the field.
  
  @param instance the instance to change.
  @param type the type in which the field is declared.
  @param fieldName the name of the field.
  @param fieldValue the value of the field.