### Question:
XYGridTree implements Serializable { public Iterable<CellId> bbox2CellIds(final OSHDBBoundingBox BBOX) { return bbox2CellIds(BBOX, false); } XYGridTree(int maxzoom);  XYGridTree(); @SuppressWarnings("Convert2Lambda") Iterable<CellId> getIds(long longitude, long latitude); Iterable<CellId> getIds(double longitude, double latitude); CellId getInsertId(OSHDBBoundingBox bbox); Iterable<CellId> bbox2CellIds(final OSHDBBoundingBox BBOX); @SuppressWarnings("Convert2Lambda") Iterable<CellId> bbox2CellIds(final OSHDBBoundingBox BBOX, final boolean enlarge); @SuppressWarnings("Convert2Lambda") Iterable<CellIdRange> bbox2CellIdRanges(final OSHDBBoundingBox bbox, final boolean enlarge);  }### Answer:
@Test public void testBbox2CellIds_BoundingBox_boolean() { OSHDBBoundingBox BBOX = new OSHDBBoundingBox(0.0, 0.0, 44.9, 44.9); boolean enlarge = false; XYGridTree instance = new XYGridTree(3); HashSet<CellId> expectedCellIds = new HashSet<>(4); expectedCellIds.add(new CellId(3, 20L)); expectedCellIds.add(new CellId(2, 6L)); expectedCellIds.add(new CellId(1, 1L)); expectedCellIds.add(new CellId(0, 0L)); for (CellId now : instance.bbox2CellIds(BBOX, enlarge)) { assertEquals(true, expectedCellIds.remove(now)); } assertEquals(0, expectedCellIds.size()); }
@Test public void testBbox2CellIds_BoundingBox2_boolean() { OSHDBBoundingBox bbox = new OSHDBBoundingBox(0.0, 0.0, 89, 89); boolean enlarge = true; XYGridTree instance = new XYGridTree(3); HashSet<CellId> expectedCellIds = new HashSet<>(16); expectedCellIds.add(new CellId(3, 12L)); expectedCellIds.add(new CellId(3, 11L)); expectedCellIds.add(new CellId(3, 13L)); expectedCellIds.add(new CellId(3, 19L)); expectedCellIds.add(new CellId(3, 20L)); expectedCellIds.add(new CellId(3, 21L)); expectedCellIds.add(new CellId(3, 27L)); expectedCellIds.add(new CellId(3, 28L)); expectedCellIds.add(new CellId(3, 29L)); expectedCellIds.add(new CellId(2, 1L)); expectedCellIds.add(new CellId(2, 2L)); expectedCellIds.add(new CellId(2, 5L)); expectedCellIds.add(new CellId(2, 6L)); expectedCellIds.add(new CellId(1, 1L)); expectedCellIds.add(new CellId(1, 0L)); expectedCellIds.add(new CellId(0, 0L)); for (CellId now : instance.bbox2CellIds(bbox, enlarge)) { assertEquals(true, expectedCellIds.remove(now)); } assertEquals(0, expectedCellIds.size()); }