MosaicTileHandler { static Point[] createTileIndices(int macroTileSize) { Point[] indices = new Point[macroTileSize * macroTileSize]; int index = 0; for (int y = 0; y < macroTileSize; y++) { for (int x = 0; x < macroTileSize; x++) { indices[index++] = new Point(x, y); } } return indices; } MosaicTileHandler(MosaicGrid mosaicGrid); void handleTile(TileIndexWritable key, TileDataWritable data); void close();  }
@Test public void testCreateTileIndices() throws Exception { Point[] tileIndices = tileHandler.createTileIndices(mosaicGrid.getMacroTileSize()); assertNotNull(tileIndices); assertEquals(9, tileIndices.length); assertEquals(new Point(0, 0), tileIndices[0]); assertEquals(new Point(1, 0), tileIndices[1]); assertEquals(new Point(2, 0), tileIndices[2]); assertEquals(new Point(0, 1), tileIndices[3]); assertEquals(new Point(1, 1), tileIndices[4]); assertEquals(new Point(2, 1), tileIndices[5]); assertEquals(new Point(2, 2), tileIndices[8]); }