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