@Test void testGetMissingConstructor() { assertThatExceptionOfType(RuntimeException.class) .isThrownBy(() -> of(PersonWithoutDefaultConstructor.class).getConstructor()) .withCauseInstanceOf(NoSuchMethodException.class) .withMessageContaining(PersonWithoutDefaultConstructor.class.getName() + ".<init>()"); }
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();  }