assertEquals(0, facet.size(adapter));
}
public void testRecreateCollection() {
final ReferenceData elements[] = new ObjectData[2];
final TestProxyOid element0Oid = new TestProxyOid(345, true);
elements[0] = new DummyObjectData(element0Oid, TestPojo.class.getName(), false, new TestProxyVersion(3));
final TestProxyOid element1Oid = new TestProxyOid(678, true);
elements[1] = new DummyObjectData(element1Oid, TestPojo.class.getName(), false, new TestProxyVersion(7));
final TestProxyOid collectionOid = new TestProxyOid(123);
final CollectionData data = new DummyCollectionData(collectionOid, Vector.class.getName(), TestPojo.class.getName(), elements, new TestProxyVersion());
final ObjectAdapter adapter = deserializer.deserialize(data);
final Vector restoredCollection = (Vector) adapter.getObject();
assertEquals(2, restoredCollection.size());
final CollectionFacet facet = adapter.getSpecification().getFacet(CollectionFacet.class);
final Enumeration elements2 = facet.elements(adapter);
final ObjectAdapter element0 = (ObjectAdapter) elements2.nextElement();
final ObjectAdapter element2 = (ObjectAdapter) elements2.nextElement();
assertNotNull(element0.getObject());
assertNotNull(element2.getObject());
assertEquals(TestPojo.class, element0.getObject().getClass());
assertEquals(TestPojo.class, element2.getObject().getClass());
assertEquals(new TestProxyOid(678, true), element2.getOid());
assertEquals(new TestProxyOid(345, true), element0.getOid());
// version not set as there is no field data for elements
// assertEquals(new DummyVersion(3), adapter.elementAt(0).getVersion());
// assertEquals(new DummyVersion(7), adapter.elementAt(1).getVersion());
}