ReflectionFieldWriterFactory implements FieldWriterFactory { @Override public FieldWriter apply(Field field) { return (bean, value) -> reflections.setValue(bean, field, value); } @Inject  ReflectionFieldWriterFactory(Reflections reflections);   ReflectionFieldWriterFactory(); @Override FieldWriter apply(Field field);  }
@Test public void shouldREturnFieldReader() { Person person = Person.builder().withId(10L).withAge(10).withName("Ada").withPhones(singletonList("234234324")).build(); Field[] fields = Person.class.getDeclaredFields(); Field id = Stream.of(fields).filter(f -> f.getName().equals("id")).findFirst().get(); FieldWriter writer = writerFactory.apply(id); Assertions.assertNotNull(writer); }