### Question:
CellFormatterFactory { public CellFormatter getFormatter(ColumnType columnType, PreferencesRegistry preferencesRegistry) { CellFormatter formatter = myFormatterMap.get(columnType); if (formatter == null) { if (columnType == ColumnType.DOWN_TIMESTAMP || columnType == ColumnType.TIMESTAMP) { formatter = new DateTimeFormatter(preferencesRegistry); } else if (columnType == ColumnType.DATE || columnType == ColumnType.DOWN_DATE) { formatter = new DateFormatter(preferencesRegistry); } else if (columnType == ColumnType.TIME || columnType == ColumnType.DOWN_TIME) { formatter = new TimeFormatter(preferencesRegistry); } else if (columnType == ColumnType.LAT) { formatter = new LatitudeFormatter(preferencesRegistry); } else if (columnType == ColumnType.LON) { formatter = new LongitudeFormatter(preferencesRegistry); } else if (columnType == ColumnType.POSITION) { formatter = new PositionFormatter(preferencesRegistry); } else if (columnType == ColumnType.COLOR) { formatter = new ColorFormatter(); } if (formatter != null) { myFormatterMap.put(columnType, formatter); } } return formatter; }  CellFormatter getFormatter(ColumnType columnType, PreferencesRegistry preferencesRegistry); String getSystemFormat(ColumnType columnType, PreferencesRegistry preferencesRegistry);  }### Answer:
@Test public void testCreateFormatterDateTime() { EasyMockSupport support = new EasyMockSupport(); PreferencesRegistry registry = TestDateTimeUtils.createPreferencesRegistry(support); support.replayAll(); CellFormatterFactory factory = new CellFormatterFactory(); CellFormatter formatter = factory.getFormatter(ColumnType.DATE, registry); assertTrue(formatter instanceof DateFormatter); formatter = factory.getFormatter(ColumnType.TIME, registry); assertTrue(formatter instanceof TimeFormatter); formatter = factory.getFormatter(ColumnType.TIMESTAMP, registry); assertTrue(formatter instanceof DateTimeFormatter); formatter = factory.getFormatter(ColumnType.LAT, registry); assertTrue(formatter instanceof LatitudeFormatter); formatter = factory.getFormatter(ColumnType.LON, registry); assertTrue(formatter instanceof LongitudeFormatter); formatter = factory.getFormatter(ColumnType.POSITION, registry); assertTrue(formatter instanceof PositionFormatter); support.verifyAll(); }
@Test public void testCreateFormatterUnknown() { CellFormatterFactory factory = new CellFormatterFactory(); CellFormatter nullFormatter = factory.getFormatter(ColumnType.OTHER, null); assertNull(nullFormatter); }