@Test
public void shouldCreateGetterClass() {

    Stream.of(Foo.class.getDeclaredConstructors()).forEach(c -> c.setAccessible(true));
    Foo foo = new Foo();
    foo.setBar("bar");
    JavaCompilerBeanPropertyReaderFactory factory = new JavaCompilerBeanPropertyReaderFactory();
    ReadFromGetterMethod propertyReader = factory.generate(Foo.class, "bar");
    Object bar = propertyReader.apply(foo);
    Assertions.assertEquals("bar", bar);
}