### Question:
LatitudeFormatter extends BaseLocationFormatter { @Override public Object formatCell(String val, String fmtString) throws ParseException { if (val == null || val.isEmpty()) { return null; } CoordFormat fmt = CoordFormat.fromString(fmtString); double latitude = LatLonAltParser.parseLat(val, fmt); if (Double.isNaN(latitude)) { return Constants.ERROR_LABEL; } if (fmt == CoordFormat.DECIMAL) { return String.valueOf(latitude); } if (fmt == CoordFormat.DDM) { return LatLonAlt.latToDdmString(latitude, 3); } return DegreesMinutesSeconds.getShortLabelString(latitude, 16, 3, 'N', 'S'); } LatitudeFormatter(PreferencesRegistry registry); @Override Object formatCell(String val, String fmtString); @Override String getFormat(List<String> values);  }### Answer:
@Test public void testFormatCell() throws ParseException { LatitudeFormatter formatter = new LatitudeFormatter(null); String decimalLatitude = "39.93588583333333"; String latitude = (String)formatter.formatCell(decimalLatitude, "Decimal"); assertEquals(decimalLatitude, latitude); latitude = (String)formatter.formatCell("N395609.189", CoordFormat.DMS.toString()); assertEquals(" 39°56'09.189\"N", latitude); assertNull(formatter.formatCell(null, CoordFormat.DMS.toString())); }