@Test public void basicTest3() { RectHV rect1 = new RectHV(0, 1, 7, 2); RectHV rect2 = new RectHV(1, 0, 2, 3); RectHV rect3 = new RectHV(3, 0, 4, 3); RectHV rect4 = new RectHV(-2, -2, -1, -1); Set<RectHV> input = new HashSet<>(Arrays.asList(rect1, rect2, rect3, rect4)); Map<RectHV, Set<RectHV>> res = RectangleIntersection.findAllIntersection(input); Set<RectHV> have1 = new HashSet<>(Arrays.asList(rect2, rect3)); Set<RectHV> have23 = new HashSet<>(Arrays.asList(rect1)); Set<RectHV> empty = new HashSet<>(); Assert.assertTrue(equals(res.get(rect1), have1)); Assert.assertTrue(equals(res.get(rect2), have23)); Assert.assertTrue(equals(res.get(rect3), have23)); Assert.assertTrue(equals(res.get(rect4), empty)); }
public static Map<RectHV, Set<RectHV>> findAllIntersection(Set<RectHV> input) { return findAllIntersection(input, new IntervalST<>()); }
RectangleIntersection { public static Map<RectHV, Set<RectHV>> findAllIntersection(Set<RectHV> input) { return findAllIntersection(input, new IntervalST<>()); } }
RectangleIntersection { public static Map<RectHV, Set<RectHV>> findAllIntersection(Set<RectHV> input) { return findAllIntersection(input, new IntervalST<>()); }  }
RectangleIntersection { public static Map<RectHV, Set<RectHV>> findAllIntersection(Set<RectHV> input) { return findAllIntersection(input, new IntervalST<>()); }  static Map<RectHV, Set<RectHV>> findAllIntersection(Set<RectHV> input); static Map<RectHV, Set<RectHV>> findAllIntersection(Set<RectHV> input,
                                                               IntervalSearchTree<Double, RectHV> intervalST); }
RectangleIntersection { public static Map<RectHV, Set<RectHV>> findAllIntersection(Set<RectHV> input) { return findAllIntersection(input, new IntervalST<>()); }  static Map<RectHV, Set<RectHV>> findAllIntersection(Set<RectHV> input); static Map<RectHV, Set<RectHV>> findAllIntersection(Set<RectHV> input,
                                                               IntervalSearchTree<Double, RectHV> intervalST);  }