If you do:
Object r = new Object();
GraphLayout gl1 = GraphLayout.parseInstance(r);
GraphLayout gl2 = GraphLayout.parseInstance(r, r);
...then this would unexpectedly fail:
Assert.assertEquals(gl1.totalCount(), gl2.totalCount());
Assert.assertEquals(gl1.totalSize(), gl2.totalSize());
This is because GraphWalker counts these separate roots as separate objects, which should not happen.
Object r = new Object();
GraphLayout gl1 = GraphLayout.parseInstance(r);
GraphLayout gl2 = GraphLayout.parseInstance(r, r);
...then this would unexpectedly fail:
Assert.assertEquals(gl1.totalCount(), gl2.totalCount());
Assert.assertEquals(gl1.totalSize(), gl2.totalSize());
This is because GraphWalker counts these separate roots as separate objects, which should not happen.