@Test void testGetGetterWithException() { @Data class PersonWithExceptionGetter { private String id; public String getId() { throw new UnsupportedOperationException("Foo"); } } final PersonWithExceptionGetter person = new PersonWithExceptionGetter(); person.setId("foo"); final FunctionalProperty<PersonWithExceptionGetter, Object> id = of(PersonWithExceptionGetter.class) .field("id"); final Function<PersonWithExceptionGetter, Object> getter = id.getGetter(); assertThatExceptionOfType(UnsupportedOperationException.class) .isThrownBy(() -> getter.apply(person)) .withMessage("Foo"); }
public <F> @NonNull FunctionalProperty<T, F> field(final @NonNull String name) { final PropertyDescriptor descriptor = this.getPropertyDescriptor(name); return new FunctionalProperty<>(descriptor); }
FunctionalClass { public <F> @NonNull FunctionalProperty<T, F> field(final @NonNull String name) { final PropertyDescriptor descriptor = this.getPropertyDescriptor(name); return new FunctionalProperty<>(descriptor); } }
FunctionalClass { public <F> @NonNull FunctionalProperty<T, F> field(final @NonNull String name) { final PropertyDescriptor descriptor = this.getPropertyDescriptor(name); return new FunctionalProperty<>(descriptor); }  }
FunctionalClass { public <F> @NonNull FunctionalProperty<T, F> field(final @NonNull String name) { final PropertyDescriptor descriptor = this.getPropertyDescriptor(name); return new FunctionalProperty<>(descriptor); }  FunctionalProperty<T, F> field(final @NonNull String name); Supplier<T> getConstructor(); }
FunctionalClass { public <F> @NonNull FunctionalProperty<T, F> field(final @NonNull String name) { final PropertyDescriptor descriptor = this.getPropertyDescriptor(name); return new FunctionalProperty<>(descriptor); }  FunctionalProperty<T, F> field(final @NonNull String name); Supplier<T> getConstructor();  }