### Question:
DateFormatter extends BaseDateTimeFormatter { @Override public void saveNewFormat(String format) { if (!format.contains("H") && !format.contains("m") && !format.contains("s") && !format.contains("S") && !format.contains("h")) { super.saveNewFormat(format); } } DateFormatter(PreferencesRegistry preferencesRegistry); @Override String getSystemFormat(); @Override void saveNewFormat(String format);  }### Answer:
@Test public void testSaveFormat() { EasyMockSupport support = new EasyMockSupport(); String newFormat = "yyyyMMdd"; String timeStampFormat = "yyyyHH"; String timeFormat = "HH"; PreferencesRegistry prefsRegistry = TestDateTimeUtils.createSaveRegistry(support, newFormat, Type.DATE); support.replayAll(); DateFormatter formatter = new DateFormatter(prefsRegistry); formatter.saveNewFormat(newFormat); formatter.saveNewFormat(newFormat); formatter.saveNewFormat(timeStampFormat); formatter.saveNewFormat(timeFormat); support.verifyAll(); }