BeanBuilder { public static <Y> BeanBuilder<Y> builder(Y x) { return new BeanBuilder<>(x, DEFAULT_VALIDATOR_FACTORY); } private  BeanBuilder(X x, ValidatorFactory validatorFactory); static Function<X,BeanBuilder<X>> builderWithValidation(ValidatorFactory validatorFactory); static BeanBuilder<Y> builder(Y x); BeanBuilder<X> set(BiConsumer<X, V> caller, V v); X build();  }
@Test void builder() { assertThatThrownBy(() -> BeanBuilder.builder(new Person()) .set(Person::setName, "kawasima") .set(Person::setAge, 3) .build()) .isInstanceOf(MisconfigurationException.class); }