@Test public void booleanPropertyUpdateXmlSaveLoad() throws PropertyValidationException, JAXBException { boolean value = new Random().nextBoolean(); BooleanProperty booleanProperty = new BooleanProperty("name", "description", "logical-name", Boolean.valueOf(!value), false, false); AbstractPropertyUpdate<Boolean> booleanPropertyUpdate = booleanProperty.createAndValidatePropertyUpdate(Boolean.valueOf(value)); JAXBContext context = JAXBContext.newInstance(BooleanPropertyUpdate.class); Marshaller marshaller = context.createMarshaller(); Unmarshaller unmarshaller = context.createUnmarshaller(); marshaller.marshal(booleanPropertyUpdate, f); Object object = unmarshaller.unmarshal(f); assertThat(object, is(instanceOf(BooleanPropertyUpdate.class))); BooleanPropertyUpdate unmarsalled = (BooleanPropertyUpdate) object; assertThat(booleanProperty.canUpdate(unmarsalled), is(true)); booleanProperty.setValue(unmarsalled.getUpdateValue()); assertThat(booleanProperty.getValue().booleanValue(), is(value)); }