### Question:
LocationIndexTree implements LocationIndex { public void query(BBox queryShape, final Visitor function) { BBox bbox = graph.getBounds(); final IntHashSet set = new IntHashSet(); query(START_POINTER, queryShape, bbox.minLat, bbox.minLon, bbox.maxLat - bbox.minLat, bbox.maxLon - bbox.minLon, new Visitor() { @Override public boolean isTileInfo() { return function.isTileInfo(); } @Override public void onTile(BBox bbox, int width) { function.onTile(bbox, width); } @Override public void onNode(int nodeId) { if (set.add(nodeId)) function.onNode(nodeId); } }, 0); } LocationIndexTree(Graph g, Directory dir); int getMinResolutionInMeter(); LocationIndexTree setMinResolutionInMeter(int minResolutionInMeter); LocationIndexTree setMaxRegionSearch(int numTiles); @Override LocationIndex setResolution(int minResolutionInMeter); @Override LocationIndex setApproximation(boolean approx); @Override LocationIndexTree create(long size); @Override boolean loadExisting(); @Override void flush(); @Override LocationIndex prepareIndex(); @Override void close(); @Override boolean isClosed(); @Override long getCapacity(); @Override void setSegmentSize(int bytes); double getDeltaLat(); double getDeltaLon(); void query(BBox queryShape, final Visitor function); @Override QueryResult findClosest(final double queryLat, final double queryLon, final EdgeFilter edgeFilter); List<QueryResult> findNClosest(final double queryLat, final double queryLon,
                                          final EdgeFilter edgeFilter, double radius);  }### Answer:
@Test public void testQuery() { Graph graph = createTestGraph2(); LocationIndexTree index = createIndex(graph, 500); final ArrayList set = new ArrayList(); index.query(new BBox(11.57314, 11.57614, 49.94553, 49.94853), new LocationIndex.Visitor() { @Override public void onNode(int nodeId) { set.add(nodeId); } }); assertEquals(17, set.size()); assertTrue(set.containsAll(Arrays.asList(2, 3, 4, 5, 6))); assertFalse(set.containsAll(Arrays.asList(17, 18, 25, 30))); }