### Question:
DateRemoverUtil { public static String removeDateFormErrorMessage(String errorMessage, String errorDateFormat, String replaceWith) { return errorMessage.replaceAll(errorDateFormat, replaceWith); } private  DateRemoverUtil(); static String removeDateFormErrorMessage(String errorMessage, String errorDateFormat, String replaceWith); static String removeDateFormErrorMessage(String errorMessage);  }### Answer:
@Test public void removeDateFormErrorMessageWithErrorDateFormat() { String errorMessage = "All dates with format '[Error-2018-04-12 15:30:35]:' are erroneous"; String expected = "All dates with format 'yyyy-MM-dd' are erroneous"; String actual = DateRemoverUtil.removeDateFormErrorMessage(errorMessage, "\\[Error-\\d{4}-\\d{2}-" + "\\d{2} \\d{2}:\\d{2}:\\d{2}\\]:", "yyyy-MM-dd"); assertEquals(expected, actual); }
@Test public void removeDateFormErrorMessage1() { String errorMessage = "All dates with format '[Error-2018-04-12 15:30:35]:' are erroneous"; String expected = "All dates with format '[Error]:' are erroneous"; String actual = DateRemoverUtil.removeDateFormErrorMessage(errorMessage); assertEquals(expected, actual); }