Node { public int getVertexCount() { int count = 0; for (Node childNode : childNodes) { count += childNode.getVertexCount(); } if (mesh != null) { count += mesh.getVao().getIndicesCount(); } return count; } Node();  Node(String root);  Node(String name, Mesh mesh); void addChild(Node node); List<Node> getChildNodes(); Mesh getMesh(); boolean isVisible(); Vector3 getPosition(); void setPosition(Vector3 position); Quaternion getRotation(); void setRotation(Quaternion rotation); Vector3 getScale(); void setScale(Vector3 scale); String getName(); @Override String toString(); int getVertexCount();  }
@Test public void noVertexCount() throws Exception { Node node = new Node(); assertEquals(0, node.getVertexCount()); }
@Test public void simpleVertexCount() throws Exception { VertexArrayObject vbo = mock(VertexArrayObject.class); when(vbo.getIndicesCount()).thenReturn(4); Mesh mesh = new Mesh(vbo, new MeshType(mock(ShaderProgram.class), null)); Node node = new Node("foo", mesh); assertEquals(4, node.getVertexCount()); }