### Question:
TimeFormatter extends BaseDateTimeFormatter { @Override public void saveNewFormat(String format) { if (!format.contains("y") && !format.contains("M") && !format.contains("d")) { super.saveNewFormat(format); } } TimeFormatter(PreferencesRegistry preferencesRegistry); @Override String getSystemFormat(); @Override void saveNewFormat(String format);  }### Answer:
@Test public void testSaveFormat() { EasyMockSupport support = new EasyMockSupport(); String newFormat = "HHmmss"; String dateFormat = "yyyyMMdd"; String dateTimeFormat = "yyyyMMdd HHmmss"; PreferencesRegistry prefsRegistry = TestDateTimeUtils.createSaveRegistry(support, newFormat, Type.TIME); support.replayAll(); TimeFormatter formatter = new TimeFormatter(prefsRegistry); formatter.saveNewFormat(newFormat); formatter.saveNewFormat(newFormat); formatter.saveNewFormat(dateFormat); formatter.saveNewFormat(dateTimeFormat); support.verifyAll(); }