AttrBoolean extends Attr<Boolean> { public static Builder builder() { return new Builder(); } private  AttrBoolean(
      Boolean value, List<? extends Constraint<? super Boolean>> constraints, String label); static Builder builder();  }
@Test public void testToFromMap() { class Clazz extends AttrComposite { public AttrBoolean defValue = attributes.register("defValue", AttrBoolean.builder().defaultValue(true)); public AttrBoolean nullValue = attributes.register("nullValue", AttrBoolean.builder().defaultValue(null)); public AttrBoolean otherValue = attributes.register("otherValue", AttrBoolean.builder().defaultValue(null)); } AliasMapper mapper = new AliasMapper(); mapper.alias("clazz", Clazz.class, () -> new Clazz()); Clazz ob = new Clazz(); ob.otherValue.set(false); Assertions.assertThat(Attrs.toMap(ob, mapper::toName)) .containsEntry("defValue", true) .containsEntry("nullValue", null) .containsEntry("otherValue", false); Clazz clazz = Attrs.fromMap(Clazz.class, Attrs.toMap(ob, mapper::toName), mapper::fromName); Assertions.assertThat(clazz.defValue.get()).isEqualTo(true); Assertions.assertThat(clazz.nullValue.get()).isNull(); Assertions.assertThat(clazz.otherValue.get()).isEqualTo(false); }