### Question:
CGIARProvider extends AbstractTiffElevationProvider { protected String getFileName(double lat, double lon) { lon = 1 + (180 + lon) / LAT_DEGREE; int lonInt = (int) lon; lat = 1 + (60 - lat) / LAT_DEGREE; int latInt = (int) lat; if (Math.abs(latInt - lat) < invPrecision / LAT_DEGREE) latInt--; String str = "srtm_"; str += lonInt < 10 ? "0" : ""; str += lonInt; str += latInt < 10 ? "_0" : "_"; str += latInt; return str; } CGIARProvider();  CGIARProvider(String cacheDir); static void main(String[] args); @Override String toString();  }### Answer:
@Test public void testFileName() { assertEquals("srtm_36_02", instance.getFileName(52, -0.1)); assertEquals("srtm_35_02", instance.getFileName(50, -10)); assertEquals("srtm_36_23", instance.getFileName(-52, -0.1)); assertEquals("srtm_35_22", instance.getFileName(-50, -10)); assertEquals("srtm_39_03", instance.getFileName(49.9, 11.5)); assertEquals("srtm_34_08", instance.getFileName(20, -11)); assertEquals("srtm_34_08", instance.getFileName(20, -14)); assertEquals("srtm_34_08", instance.getFileName(20, -15)); assertEquals("srtm_37_02", instance.getFileName(52.1943832, 0.1363176)); }
@Test public void testFileNotFound() { File file = new File(instance.getCacheDir(), instance.getFileName(46, -20) + ".gh"); File zipFile = new File(instance.getCacheDir(), instance.getFileName(46, -20) + ".zip"); file.delete(); zipFile.delete(); instance.setDownloader(new Downloader("test GH") { @Override public void downloadFile(String url, String toFile) throws IOException { throw new FileNotFoundException("xyz"); } }); assertEquals(0, instance.getEle(46, -20), 1); assertTrue(file.exists()); assertEquals(228, file.length()); instance.setDownloader(new Downloader("test GH") { @Override public void downloadFile(String url, String toFile) throws IOException { throw new SocketTimeoutException("xyz"); } }); try { instance.setSleep(30); instance.getEle(16, -20); assertTrue(false); } catch (Exception ex) { } file.delete(); zipFile.delete(); }