BasicGravity gravity = new BasicGravity(gravityState, universe);
assertEquals(2, gravity.getFallingLeaves().size());
assertEquals(2, gravity.getGravity3D().getGroup().numChildren());
for (TreeLeaf treeLeaf : gravity.getFallingLeaves()) {
TreeLeaf3D treeLeaf3D = treeLeaf.getTreeLeaf3D();
// leaf3D and gravity are subscribers of the leaf
assertEquals(2, treeLeaf.countSubscribers());
// leaf is subscriber of the leaf3D
assertEquals(1, treeLeaf3D.countSubscribers());
// assert the gravity is really one of the subscribers of the leaf
treeLeaf.deleteSubscriber(gravity);
assertEquals(1, treeLeaf.countSubscribers());
// assert the leaf3D is really one of the subscribers of the leaf
treeLeaf.deleteSubscriber(treeLeaf3D);
assertEquals(0, treeLeaf.countSubscribers());
// assert the leaf is really one of the subscribers of the leaf3D
treeLeaf3D.deleteSubscriber(treeLeaf);
assertEquals(0, treeLeaf3D.countSubscribers());
}
MockTreeLeaf treeLeaf = new MockTreeLeaf();
gravity.addFallingLeaf(treeLeaf);