@Test void testGetConstructorWithException() { final Supplier<PersonWithExceptionConstructor> ctor = of(PersonWithExceptionConstructor.class) .getConstructor(); assertThatExceptionOfType(IllegalStateException.class) .isThrownBy(ctor::get) .withMessage("Foo"); }
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); } }
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); } } }
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); } }  }
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(); }
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();  }