// Variant of the second test but using serialVersionUID and adding methods to the class on reload
@Test
public void serialization3() throws Exception {
TypeRegistry tr = getTypeRegistry("remote..*");
ReloadableType person = tr.addType("remote.PersonB", loadBytesForClass("remote.PersonB"));
ReloadableType runner = tr.addType("remote.SerializeB", loadBytesForClass("remote.SerializeB"));
Class<?> clazz = runner.getClazz();
Object instance = clazz.newInstance();
Result r = null;
// Basic: write and read the same Person
r = runOnInstance(runner.getClazz(),instance,"writePerson");
assertStdoutContains("Person stored ok", r);
r = runOnInstance(runner.getClazz(),instance,"readPerson");
assertContains("Person read ok", r.stdout);
// Advanced: write it, reload, then read back from the written form
r = runOnInstance(runner.getClazz(),instance,"writePerson");
assertStdoutContains("Person stored ok", r);
person.loadNewVersion("2",retrieveRename("remote.PersonB", "remote.PersonB2"));
r = runOnInstance(runner.getClazz(),instance,"readPerson");
assertContains("Person read ok", r.stdout);
r = runOnInstance(clazz,instance,"printInitials");
assertContains("Person read ok\nWS", r.stdout);
}