private static <T> void setField(
      Class<T> clazz, T instance, String fieldName, Object injectedField)
      throws NoSuchFieldException, IllegalAccessException {
    Field field = clazz.getDeclaredField(fieldName);
    field.setAccessible(true);
    field.set(instance, injectedField);
  }
Inject fields into object that would have otherwise been injected by the build system.
jib-maven-plugin/src/test/java/com/google/cloud/tools/jib/maven/SettingsFixture.java