### Question:
DateTimeFormatter extends BaseDateTimeFormatter { @Override public void saveNewFormat(String format) { boolean containsTime = format.contains("H") || format.contains("m") || format.contains("s") || format.contains("S") || format.contains("h"); boolean containsDate = format.contains("y") || format.contains("M") || format.contains("d"); if (containsTime && containsDate) { super.saveNewFormat(format); } } DateTimeFormatter(PreferencesRegistry preferencesRegistry); @Override void saveNewFormat(String format);  }### Answer:
@Test public void testSaveFormat() { EasyMockSupport support = new EasyMockSupport(); String newFormat = "yyyyMMdd HHmmss"; String dateFormat = "yyyyMMdd"; String timeFormat = "HHmmss"; PreferencesRegistry prefsRegistry = TestDateTimeUtils.createSaveRegistry(support, newFormat, Type.TIMESTAMP); support.replayAll(); DateTimeFormatter formatter = new DateTimeFormatter(prefsRegistry); formatter.saveNewFormat(newFormat); formatter.saveNewFormat(newFormat); formatter.saveNewFormat(dateFormat); formatter.saveNewFormat(timeFormat); support.verifyAll(); }