public void propertyBox2() { // tag::propertybox2[] final PathProperty<Long> ID = PathProperty.create("id", Long.class).withValidator(Validator.notNull()); // <1> final StringProperty NAME = StringProperty.create("name").withValidator(Validator.notBlank()); // <2> final PropertySet<?> PROPERTIES = PropertySet.of(ID, NAME); PropertyBox propertyBox = PropertyBox.create(PROPERTIES); propertyBox.setValue(ID, null); // <3> propertyBox = PropertyBox.builder(PROPERTIES).invalidAllowed(true).build(); // <4> propertyBox.validate(); // <5> // end::propertybox2[] }