public void testAddElement3D() {
BasicUniverse3D universe3D = new BasicUniverse3D();
TreeLeaf3DStateFactory stateFactory = new TreeLeaf3DStateFactory();
Point3d leafAttachPoint = new Point3d(Math.random(), Math.random(), Math.random());
TreeLeaf3DState leaf3dState = stateFactory.createRandomTreeLeaf3DState(leafAttachPoint);
BasicTreeLeaf3D treeLeaf3D = new BasicTreeLeaf3D(universe3D, leaf3dState, new MockTreeLeaf());
universe3D.addElement3D(treeLeaf3D.getBranchGroup());
Set<Node> elements3d = universe3D.getElements3D();
assertNotNull(elements3d);
assertEquals(1, elements3d.size());
assertTrue(elements3d.contains(treeLeaf3D.getBranchGroup()));
BranchGroup root = universe3D.getUniverseRoot();
assertNotNull(root);
assertEquals(1, root.numChildren());
assertEquals(treeLeaf3D.getBranchGroup(), root.getChild(0));
}