@Test public void test() { PropWithReference fep = (PropWithReference) new PropWithReference("root").init(); fep.strprop.setValue("val1"); fep.referencedComponent.getReference().strprop2.setValue("val2"); fep.referencedComponent.componentInstanceId.setValue("12345"); fep.referencedComponent.referenceType.setValue(ReferenceType.COMPONENT_INSTANCE); assertEquals("val1", fep.strprop.getValue()); assertEquals("val2", fep.referencedComponent.getReference().strprop2.getValue()); assertEquals("12345", fep.referencedComponent.componentInstanceId.getValue()); assertEquals(ReferenceType.COMPONENT_INSTANCE, fep.referencedComponent.referenceType.getValue()); String serialized = fep.toSerialized(); System.out.println(serialized); Deserialized<PropWithReference> fromSerializedPersistent = Properties.Helper.fromSerializedPersistent(serialized, PropWithReference.class); PropWithReference unserializedFep = fromSerializedPersistent.object; assertEquals("val1", unserializedFep.strprop.getValue()); assertEquals("val2", unserializedFep.referencedComponent.getReference().strprop2.getValue()); assertEquals("12345", unserializedFep.referencedComponent.componentInstanceId.getValue()); assertEquals(ReferenceType.COMPONENT_INSTANCE, fep.referencedComponent.referenceType.getValue()); }