### Question:
TileDownload { static CoordinateInt[][] getCoordinates(Area ar) { int minLat = floor(ar.getMinLat()); int maxLat = (int) Math.ceil(ar.getMaxLat()); int minLon = floor(ar.getMinLon()); int maxLon = (int) Math.ceil(ar.getMaxLon()); int sizeLat = maxLat - minLat; int sizeLon = minLon > maxLon ? ((180-minLon) + (180+maxLon)) : maxLon - minLon; CoordinateInt[][] coords = new CoordinateInt[sizeLat][sizeLon]; for (int i = 0; i < sizeLat; i++) { int gap = 180-minLon; for (int j = 0; j < sizeLon; j++) { int lon = minLon+j < 180 ? minLon+j : (-180+j-gap); coords[i][j] = new CoordinateInt(minLat + i, lon); } } return coords; }  boolean exists(double lat, double lon); abstract boolean exists(int lat, int lon); File[][] getTiles(Area ar); File getTile(CoordinateInt c); File getTile(double lat, double lon); abstract File getTile(int lat, int lon); static String getNonationNSEW(int lat, int lon);  }### Answer:
@Test public void testGetCoordinates() throws Exception { Area ar = new Area(48,11,50,13); CoordinateInt[][] coords = TileDownload.getCoordinates(ar); assertEquals(2, coords.length); assertEquals(2, coords[0].length); assertEquals(new CoordinateInt(48,11), coords[0][0]); assertEquals(new CoordinateInt(48,12), coords[0][1]); assertEquals(new CoordinateInt(49,11), coords[1][0]); assertEquals(new CoordinateInt(49,12), coords[1][1]); }
@Test public void testGetCoordinates2() throws Exception { Area ar = new Area(48,175,50,-178); CoordinateInt[][] coords = TileDownload.getCoordinates(ar); assertEquals(2, coords.length); assertEquals(7, coords[0].length); assertEquals(new CoordinateInt(48,175), coords[0][0]); assertEquals(new CoordinateInt(48,179), coords[0][4]); assertEquals(new CoordinateInt(48,-180), coords[0][5]); assertEquals(new CoordinateInt(48,-179), coords[0][6]); assertEquals(new CoordinateInt(49,175), coords[1][0]); assertEquals(new CoordinateInt(49,-179), coords[1][6]); }