### Question:
FakegenUtils { public static void inject(@NonNull Object target, @NonNull String fieldName, Object value) { Field field; try { field = target.getClass().getDeclaredField(fieldName); field.setAccessible(true); field.set(target, value); } catch (NoSuchFieldException e) { throw new FakegenException(createExceptionMessage(target.getClass(), fieldName), e); } catch (IllegalAccessException e) { throw new FakegenException("Could not set field " + fieldName, e); } }  static void inject(@NonNull Object target, @NonNull String fieldName, Object value); @SafeVarargs static void modifyCollection(@NonNull Iterable<T> targets, @NonNull Consumer<T>... suppliers);  }### Answer:
@Test void inject() { SimpleType simpleType = new SimpleType(); FakegenUtils.inject(simpleType, "name", "Hello World"); assertThat(simpleType.getName()).isEqualTo("Hello World"); }
@Test void inject_failed() { SimpleType simpleType = new SimpleType(); Throwable fakegenException = catchThrowable(() -> FakegenUtils.inject(simpleType, "namo", "Hello World")); assertThat(fakegenException) .isInstanceOf(FakegenException.class) .hasMessage("Could not find field `namo`, but a similar named one called `name` was found."); }