objOut.reset();
objOut.writeObject(circular.getReferences());
ObjectInputStream objInput = new JBossObjectInputStreamSharedTree(new ByteArrayInputStream(byteOut.toByteArray()));
Object first = objInput.readObject();
TestCircularReferences second = (TestCircularReferences)objInput.readObject();
Object third = objInput.readObject();
assertSame((Object)second.getReferences(),first);
assertEquals(circular.getReferences().size(),((Collection)third).size());
assertNotSame(third,second);