### Question:
QuadTree { Collection<Point> query(Rect r, Collection<Point> relevantPoints) { if (this.boundary.intersects(r)) { this.points .values() .stream() .filter(r::contains) .forEach(relevantPoints::add); if (this.divided) { this.northwest.query(r, relevantPoints); this.northeast.query(r, relevantPoints); this.southwest.query(r, relevantPoints); this.southeast.query(r, relevantPoints); } } return relevantPoints; } QuadTree(Rect boundary, int capacity);   }### Answer:
@Test void queryTest() { var points = new ArrayList<Point>(); var rand = new Random(); for (int i = 0; i < 20; i++) { var p = new Bubble(rand.nextInt(300), rand.nextInt(300), i, rand.nextInt(2) + 1); points.add(p); } var field = new Rect(150, 150, 300, 300); var queryRange = new Rect(70, 130, 100, 100); var points1 = QuadTreeTest.quadTreeTest(points, field, queryRange); var points2 = QuadTreeTest.verify(points, queryRange); assertEquals(points1, points2); }