AbstractTreeForTreeLayout implements
		TreeForTreeLayout<TreeNode> { @Override public boolean isChildOfParent(TreeNode node, TreeNode parentNode) { return getParent(node) == parentNode; } 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 testIsChildOfParent() throws Exception { assertEquals(false, tree.isChildOfParent(root, n1)); assertEquals(true, tree.isChildOfParent(n1, root)); assertEquals(true, tree.isChildOfParent(n2, root)); assertEquals(false, tree.isChildOfParent(n1, n2)); }