AbstractTreeForTreeLayout implements
		TreeForTreeLayout<TreeNode> { @Override public TreeNode getFirstChild(TreeNode parentNode) { return getChildrenList(parentNode).get(0); } AbstractTreeForTreeLayout(TreeNode root); abstract TreeNode getParent(TreeNode node); abstract List<TreeNode> getChildrenList(TreeNode node); @Override TreeNode getRoot(); @Override boolean isLeaf(TreeNode node); @Override boolean isChildOfParent(TreeNode node, TreeNode parentNode); @Override Iterable<TreeNode> getChildren(TreeNode node); @Override Iterable<TreeNode> getChildrenReverse(TreeNode node); @Override TreeNode getFirstChild(TreeNode parentNode); @Override TreeNode getLastChild(TreeNode parentNode);  }
@Test public void testGetFirstChild() throws Exception { assertEquals(n1, tree.getFirstChild(root)); }
@Test public void testGetFirstChild_leaf() throws Exception { try { tree.getFirstChild(n1); fail("exception expected"); } catch (Exception ex) { } }