### Question:
Serializer { public byte[] computeHash( String value ) { try { return SecureHash.getHash(SecureHash.Algorithm.SHA_1, value.getBytes()); } catch (NoSuchAlgorithmException e) { throw new SystemFailureException(e); } } Serializer( ExecutionContext context,
                       boolean excludeUuidProperty ); void serializeProperties( ObjectOutputStream stream,
                                     int number,
                                     Iterable<Property> properties,
                                     LargeValues largeValues,
                                     ReferenceValues references ); boolean serializeProperty( ObjectOutputStream stream,
                                      Property property,
                                      LargeValues largeValues,
                                      ReferenceValues references ); int reserializeProperties( ObjectInputStream input,
                                      ObjectOutputStream output,
                                      Map<Name, Property> updatedProperties,
                                      LargeValues largeValues,
                                      LargeValues removedLargeValues,
                                      Set<Name> createdProperties,
                                      ReferenceValues references ); void adjustReferenceProperties( ObjectInputStream input,
                                           ObjectOutputStream output,
                                           Map<String, String> oldUuidToNewUuid ); void deserializeAllProperties( ObjectInputStream stream,
                                          Collection<Property> properties,
                                          LargeValues largeValues ); void deserializeSomeProperties( ObjectInputStream stream,
                                           Collection<Property> properties,
                                           LargeValues largeValues,
                                           LargeValues skippedLargeValues,
                                           Name... names ); Property deserializeProperty( ObjectInputStream stream,
                                         LargeValues largeValues ); Object[] deserializePropertyValues( ObjectInputStream stream,
                                               Name propertyName,
                                               boolean skip,
                                               LargeValues largeValues,
                                               LargeValues skippedLargeValues,
                                               ReferenceValues references ); byte[] computeHash( String value ); static final LargeValues NO_LARGE_VALUES; static final ReferenceValues NO_REFERENCES_VALUES; }### Answer:
@Test public void shouldReserializePropertiesWithUpdates() throws Exception { Property prop1 = createProperty("p1", "v1"); String value = "v234567890123456789012345678901234567890"; Property prop2 = createProperty("p2", value); Property prop3 = createProperty("p3", "v2"); Property prop4 = createProperty("p4", new String(value)); Property prop5 = createProperty("p5", valueFactories.getBinaryFactory().create("something")); String binaryValueStr = "really really long string that will be converted to a binary value and tested like that"; Binary binaryValue = valueFactories.getBinaryFactory().create(binaryValueStr); Property prop6 = createProperty("p6", binaryValue); UUID uuid7 = UUID.randomUUID(); Reference ref7 = valueFactories.getReferenceFactory().create(uuid7); Property prop7 = createProperty("p7", ref7); UUID uuid8 = UUID.randomUUID(); Reference ref8 = valueFactories.getReferenceFactory().create(uuid8); Property prop8 = createProperty("p8", ref8); Property prop2b = createProperty("p2"); Property prop3b = createProperty("p3", "v3"); String binaryValueStr2 = binaryValueStr + " but modified"; Binary binaryValue2 = valueFactories.getBinaryFactory().create(binaryValueStr2); Property prop6b = createProperty("p6", binaryValue2); Property[] initial = new Property[] {prop1, prop2, prop3, prop4, prop5, prop6, prop7, prop8}; Property[] updated = new Property[] {prop2b, prop3b, prop6b}; Name[] deleted = new Name[] {}; SkippedLargeValues removedLargeValues = new SkippedLargeValues(); assertReserializable(serializer, removedLargeValues, initial, updated, deleted); assertThat(largeValues.getCount(), is(3)); assertThat(removedLargeValues.getCount(), is(2)); assertThat(largeValues.get(serializer.computeHash(value)), is(notNullValue())); assertThat(largeValues.get(binaryValue2), is(notNullValue())); assertThat(largeValues.get(binaryValue2), is(notNullValue())); assertThat(removedLargeValues.isSkipped(binaryValue), is(true)); }