void handleCollision(Collection<? extends Point> toCheck, Map<Integer, Bubble> allBubbles) {
    var toBePopped = false; //if any other bubble collides with it, made true
    for (var point : toCheck) {
      var otherId = point.id;
      if (allBubbles.get(otherId) != null //the bubble hasn't been popped yet
          && this.id != otherId  //the two bubbles are not the same
          && this.touches(allBubbles.get(otherId))) { //the bubbles touch
        allBubbles.get(otherId).pop(allBubbles);
        toBePopped = true;
      }
    }
    if (toBePopped) {
      this.pop(allBubbles);
    }
  }
@Test
  void handleCollisionTest() {
    var b1 = new Bubble(0, 0, 1, 2);
    var b2 = new Bubble(1, 1, 2, 1);
    var b3 = new Bubble(10, 10, 3, 1);
    var bubbles = new HashMap<Integer, Bubble>();
    bubbles.put(1, b1);
    bubbles.put(2, b2);
    bubbles.put(3, b3);
    var bubblesToCheck = new ArrayList<Point>();
    bubblesToCheck.add(b2);
    bubblesToCheck.add(b3);
    b1.handleCollision(bubblesToCheck, bubbles);
    //b1 touches b2 and not b3, so b1, b2 will be popped
    assertNull(bubbles.get(1));
    assertNull(bubbles.get(2));
    assertNotNull(bubbles.get(3));
  }