AbstractTreeForTreeLayout implements
		TreeForTreeLayout<TreeNode> { @Override public boolean isLeaf(TreeNode node) { return getChildrenList(node).isEmpty(); } 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 testIsLeaf() throws Exception { assertEquals(false, tree.isLeaf(root)); assertEquals(true, tree.isLeaf(n1)); assertEquals(true, tree.isLeaf(n2)); }