private static BiFunction<Object, Field, Object> setValue(Object value) {
    return (owner, field) -> {
      try {
        field.set(owner, value);
      } catch (IllegalAccessException | IllegalArgumentException e) {
        String message = String.format("Setting %s (%s) value for %s",
            field.getName(), field.isAccessible(), owner);
        throw new RuntimeException(message, e);
      }
      return null;
    };
  }
Creates a function that sets a field of an owner to the given value.
build-tools/geode-testing-isolation/src/main/java/org/apache/geode/gradle/testing/process/Reflection.java