final OTrackedMap<String> beforeSerialization = new OTrackedMap<String>(new NotSerializableDocument());
beforeSerialization.put(0, "firstVal");
beforeSerialization.put(1, "secondVal");
final OMemoryStream memoryStream = new OMemoryStream();
final ObjectOutputStream out = new ObjectOutputStream(memoryStream);
out.writeObject(beforeSerialization);
out.close();
final ObjectInputStream input = new ObjectInputStream(new OMemoryInputStream(memoryStream.copy()));
@SuppressWarnings("unchecked")
final Map<Object, String> afterSerialization = (Map<Object, String>) input.readObject();
Assert.assertEquals(afterSerialization.size(), beforeSerialization.size(), "Map size");
for (int i = 0; i < afterSerialization.size(); i++) {