PolyTree extends PolyNode { public PolyNode getFirst() { if (!childs.isEmpty()) { return childs.get( 0 ); } else { return null; } }  void Clear(); List<PolyNode> getAllPolys(); PolyNode getFirst(); int getTotalSize();  }
@Test public void getFistChildInPolyTreeTest() { PolyTree tree = new PolyTree(); PolyNode firstChild = new PolyNode(); PolyNode secondChild = new PolyNode(); tree.addChild(firstChild); tree.addChild(secondChild); Assert.assertSame(firstChild, tree.getFirst()); }
@Test public void getFistChildInEmptyPolyTreeTest() { PolyTree tree = new PolyTree(); Assert.assertNull(tree.getFirst()); }