code: public static boolean setField(Object target, String name, Object value) {
          try {
              Field field = target.getClass().getDeclaredField(name);
              field.setAccessible(true);
              field.set(target, value);
              return true;
          } catch (NoSuchFieldException e) {
              return false;
          }
          catch (Exception e) {
              throw new RuntimeException(e);
          }
      }
docs: Set the field identified by name to the given value.
  @param target
  @param name
  @param value
  @return true on success, false if field wasn't found.