CatalogOutputAdapter { String formatToDMS(double lat, double lon) { long[] latDMS = doubleToDMS(lat); long[] lonDMS = doubleToDMS(lon); return String.format("%02d%02d%02d%s", latDMS[0], latDMS[1], latDMS[2], lat >= 0 ? "N" : "S") + String.format("%03d%02d%02d%s", lonDMS[0], lonDMS[1], lonDMS[2], lon >= 0 ? "E" : "W"); } CatalogOutputAdapter(Semaphore lock); @SuppressWarnings("WeakerAccess") BufferedImage getImage(ResourceResponse resourceResponse); @SuppressWarnings("WeakerAccess") BinaryContent getBinaryContent(BufferedImage image); @SuppressWarnings("unused") NitfSegmentsFlow getNitfSegmentsFlow(ResourceResponse resourceResponse); @SuppressWarnings("unused") BinaryContent getNitfBinaryContent(
      BufferedImage chip, NitfSegmentsFlow nitfSegmentsFlow, int sourceX, int sourceY); @SuppressWarnings("unused") void wrapException(Exception exception);  }
@Test public void testFormatToDMS() { assertThat(catalogOutputAdapter.formatToDMS(30, 30), is("300000N0300000E")); assertThat(catalogOutputAdapter.formatToDMS(-30, 30), is("300000S0300000E")); assertThat(catalogOutputAdapter.formatToDMS(30, -30), is("300000N0300000W")); assertThat(catalogOutputAdapter.formatToDMS(-30, -30), is("300000S0300000W")); }