### Question:
ResultTree { public boolean insert(Result result) { ResultTree parent = getInsertPosition(result); if (parent != null) { parent.getChildren().add(new ResultTree(result)); return true; } return false; } ResultTree(Result root); Result getNode(); void setNode(Result node); List<ResultTree> getChildren(); void setChildren(List<ResultTree> children); boolean insert(Result result); ResultTree getInsertPosition(Result result); boolean contains(BitSet lhs, int rhs); List<Result> getLeaves();  }### Answer:
@Test public void testInsertNotPossibleForDifferentRhs() { Result node = mockResult(mockFD(new int[]{0, 4, 7, 9}, 3)); Result child = mockResult(mockFD(new int[]{4, 7, 9}, 3)); Result offendingResult = mockResult(mockFD(new int[] {4, 7}, 1)); ResultTree tree = new ResultTree(node); tree.insert(child); boolean inserted = tree.insert(offendingResult); Assert.assertFalse(inserted); }
@Test public void testInsertNotPossibleForNonDescendants() { Result node = mockResult(mockFD(new int[]{0, 4, 7, 9}, 3)); Result child = mockResult(mockFD(new int[]{4, 7, 9}, 3)); Result offendingResult = mockResult(mockFD(new int[] {5, 7}, 3)); ResultTree tree = new ResultTree(node); tree.insert(child); boolean inserted = tree.insert(offendingResult); Assert.assertFalse(inserted); }