root = new DLN(new int[] { 1, 6, 6, 66 }); descendant = new DLN(new int[] { 1, 6, 6, 65, 1 }); System.out.println("Testing isChildOf: " + descendant + " -> " + root); assertFalse(descendant.isChildOf(root));
    public void testRelations() {    	System.out.println("------ testLevelRelations ------");    	int[] id0 = { 1, 3 };    	int[] id1 = { 1, 3, 1 };    	int[] id2 = { 1, 3, 2, 5, 6 };    	int[] id3 = { 1, 4 };    	int[] id4 = { 1, 3, 2, 5, 6, 7777 };    	int[] id5 = { 1, 3, 2, 5, 6, 7777, 1 };    	int[] id6 = { 1, 3, 2 };    	    	DLN root = new DLN(id0);    	DLN descendant = new DLN(id1);    	    	System.out.println("Testing isDescendant: " + descendant + " -> " + root);    	assertTrue(descendant.isDescendantOf(root));    	    	descendant = new DLN(id1);    	System.out.println("Testing isDescendantOf: " + descendant + " -> " + root);    	assertTrue(descendant.isDescendantOf(root));    	    	descendant = new DLN(id1);    	System.out.println("Testing isChildOf: " + descendant + " -> " + root);    	assertTrue(descendant.isChildOf(root));    	    	descendant = new DLN(id2);    	System.out.println("Testing isDescendantOf: " + descendant + " -> " + root);    	assertTrue(descendant.isDescendantOf(root));    	    	descendant = new DLN(id2);    	System.out.println("Testing isChildOf: " + descendant + " -> " + root);    	assertFalse(descendant.isChildOf(root));    	    	System.out.println("Testing isDescendantOrSelf: " + descendant + " -> " + root);    	assertTrue(descendant.isDescendantOrSelfOf(root));    	    	descendant = new DLN(id3);    	System.out.println("Testing isDescendant: " + descendant + " -> " + root);    	assertFalse(descendant.isDescendantOf(root));    	    	descendant = new DLN(id0);    	System.out.println("Testing isDescendant: " + descendant + " -> " + root);    	assertFalse(descendant.isDescendantOf(root));    	    	System.out.println("Testing isDescendantOrSelf: " + descendant + " -> " + root);    	assertTrue(descendant.isDescendantOrSelfOf(root));    	    	root = new DLN(id2);    	descendant = new DLN(id4);    	System.out.println("Testing isDescendantOf: " + descendant + " -> " + root);    	assertTrue(descendant.isDescendantOf(root));    	    	System.out.println("Testing isChildOf: " + descendant + " -> " + root);    	assertTrue(descendant.isChildOf(root));    	    	descendant = new DLN(id5);    	System.out.println("Testing isDescendantOf: " + descendant + " -> " + root);    	assertTrue(descendant.isDescendantOf(root));    	    	System.out.println("Testing isChildOf: " + descendant + " -> " + root);    	assertFalse(descendant.isChildOf(root));    	    	root = new DLN(id1);    	descendant = new DLN(id6);    	System.out.println("Testing isDescendantOf: " + descendant + " -> " + root);    	assertFalse(descendant.isDescendantOf(root));    	    	System.out.println("------ testLevelRelations: PASSED ------");    }