@Test
public void testVersioning() {
Versioning v = new Versioning();
FSTConfiguration conf = FSTConfiguration.createDefaultConfiguration();
conf.registerClass(Versioning.class);
byte[] bytes = conf.asByteArray(v);
Versioning res = (Versioning) conf.asObject(bytes);
assertTrue(DeepEquals.deepEquals(v,res));
FSTConfiguration old = FSTConfiguration.createDefaultConfiguration();
old.registerClass(VersioningOld.class);
VersioningOld vold = new VersioningOld();
vold.originalMap.put("uz","aspdokasd");
bytes = old.asByteArray(vold);
Versioning newReadFromOld = (Versioning) conf.asObject(bytes);
assertTrue(newReadFromOld.originalOne.equals("OOPASDKAPSODKPASODKBla"));
FSTConfiguration oldv4 = FSTConfiguration.createDefaultConfiguration();
oldv4.registerClass(VersioningV4.class);
VersioningV4 oldv4Inst = new VersioningV4();
oldv4Inst.veryNew.put("uz","aspdokasd");
bytes = oldv4.asByteArray(oldv4Inst);
Versioning newReadFromV4 = (Versioning) conf.asObject(bytes);
assertTrue(newReadFromV4.veryNew.get("uz").equals("aspdokasd"));
}