void handleCollisionsUsingQt(Bubble b) {
    // finding points within area of a square drawn with centre same as
    // centre of bubble and length = radius of bubble
    var rect = new Rect(b.coordinateX, b.coordinateY, 2D * b.radius, 2D * b.radius);
    var quadTreeQueryResult = new ArrayList<Point>();
    this.bubblesQuadTree.query(rect, quadTreeQueryResult);
    //handling these collisions
    b.handleCollision(quadTreeQueryResult, this.bubbles);
  }
@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 HashMap<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);
    //b1 touches b3 and b4 but not b2 - so b1,b3,b4 get popped
    assertNull(bubbles.get(1));
    assertNotNull(bubbles.get(2));
    assertNull(bubbles.get(3));
    assertNull(bubbles.get(4));
  }