### Question:
SpatialPartitionBubbles extends SpatialPartitionGeneric<Bubble> { void handleCollisionsUsingQt(Bubble b) { var rect = new Rect(b.coordinateX, b.coordinateY, 2 * b.radius, 2 * b.radius); var quadTreeQueryResult = new ArrayList<Point>(); this.quadTree.query(rect, quadTreeQueryResult); b.handleCollision(quadTreeQueryResult, this.bubbles); } SpatialPartitionBubbles(Hashtable<Integer, Bubble> bubbles, QuadTree quadTree);   }### Answer:
@Test void handleCollisionsUsingQtTest() { var b1 = new Bubble(10, 10, 1, 3); var b2 = new Bubble(5, 5, 2, 1); var b3 = new Bubble(9, 9, 3, 1); var b4 = new Bubble(8, 8, 4, 2); var bubbles = new Hashtable<Integer, Bubble>(); bubbles.put(1, b1); bubbles.put(2, b2); bubbles.put(3, b3); bubbles.put(4, b4); var r = new Rect(10, 10, 20, 20); var qt = new QuadTree(r, 4); qt.insert(b1); qt.insert(b2); qt.insert(b3); qt.insert(b4); var sp = new SpatialPartitionBubbles(bubbles, qt); sp.handleCollisionsUsingQt(b1); assertNull(bubbles.get(1)); assertNotNull(bubbles.get(2)); assertNull(bubbles.get(3)); assertNull(bubbles.get(4)); }