static void checkReference(Foo foo)
    {
        Bar bar1 = foo.getSomeBar().get(0);
        assertNotNull(bar1);
        assert (bar1.getSomeInt() == 1);

        Bar bar2 = foo.getSomeBar().get(1);
        assertNotNull(bar2);
        assert (bar2.getSomeInt() == 2);

        // check if its same instance
        assertTrue(bar1.getSomeBaz() == bar2.getSomeBaz());
    }
Test ser/deser of graph objects (references and cyclic dependencies).

@author David Yu
@created Dec 10, 2010
protostuff-core/src/test/java/io/protostuff/GraphTest.java