### Question:
FunctionalClass { public Supplier<T> getConstructor() { try { final Constructor<T> ctor = this.clazz.getDeclaredConstructor(); return new FunctionalConstructor<>(ctor)::newInstance; } catch (final @NonNull NoSuchMethodException e) { throw new IllegalStateException(e); } }  FunctionalProperty<T, F> field(final @NonNull String name); Supplier<T> getConstructor();  }### Answer:
@Test void testGetConstructor() { final Supplier<Person> ctor = of(Person.class).getConstructor(); assertThat(ctor.get()) .isNotNull(); }
@Test void testGetConstructorWithException() { final Supplier<PersonWithExceptionConstructor> ctor = of(PersonWithExceptionConstructor.class) .getConstructor(); assertThatExceptionOfType(IllegalStateException.class) .isThrownBy(ctor::get) .withMessage("Foo"); }
@Test void testGetMissingConstructor() { assertThatExceptionOfType(RuntimeException.class) .isThrownBy(() -> of(PersonWithoutDefaultConstructor.class).getConstructor()) .withCauseInstanceOf(NoSuchMethodException.class) .withMessageContaining(PersonWithoutDefaultConstructor.class.getName() + ".<init>()"); }