@Test public void basicTest4() { RectHV rect1 = new RectHV(0.3575171210237521, 0.7146836650768305, 0.654698890179744, 0.7389769277103051); RectHV rect2 = new RectHV(0.5242190274474139, 0.604704260298527, 0.5984919519775737, 0.7351331826091808); RectHV rect3 = new RectHV(0.26932805480982835, 0.6878393553752091, 0.6415024527196731, 0.7007551209727795); RectHV rect4 = new RectHV(0.6194634824768956, 0.6978808556408181, 0.6985437759233379, 0.7976011872680293); Set<RectHV> input = new HashSet<>(Arrays.asList(rect1, rect2, rect3, rect4)); Map<RectHV, Set<RectHV>> res = RectangleIntersection.findAllIntersection(input); Set<RectHV> have13 = new HashSet<>(Arrays.asList(rect2, rect4)); Set<RectHV> have2 = new HashSet<>(Arrays.asList(rect1, rect3)); Set<RectHV> have4 = new HashSet<>(Arrays.asList(rect1, rect3)); Assert.assertTrue(equals(res.get(rect1), have13)); Assert.assertTrue(equals(res.get(rect2), have2)); Assert.assertTrue(equals(res.get(rect3), have13)); Assert.assertTrue(equals(res.get(rect4), have4)); }
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);  }