### Question:
DateFormatter implements ParamConverter<Date> { @Override public Date fromString(String s) { Date d; synchronized (DateFormatter.dateFormat) { String str = s; if (str.equals("+24Hours")) { d = new Date(new Date().getTime() + 86400000); log.debug("Param passed in was '+24Hours', setting value to now + 86400000ms"); } else { if (StringUtils.isNotBlank(this.defaultTime) && !str.contains(" ")) { str = str + " " + this.defaultTime; } if (StringUtils.isNotBlank(this.defaultMillisec) && !str.contains(".")) { str = str + "." + this.defaultMillisec; } try { d = DateFormatter.dateFormat.parse(str); if (DateUtils.getFragmentInMilliseconds(d, Calendar.HOUR_OF_DAY) > 0) { DateUtils.setMilliseconds(d, 999); } } catch (ParseException pe) { throw new RuntimeException("Unable to parse date " + str + " with format " + formatPattern, pe); } } } return d; } DateFormatter(DateFormat format); @Override Date fromString(String s); @Override String toString(Date value); static String getFormatPattern();  }### Answer:
@Test(expected = RuntimeException.class) public void testDateFormatterFail1() { formatter.fromString("20120101120000"); }
@Test(expected = RuntimeException.class) public void testDateFormatterFail2() { formatter.fromString("20120101 250000"); }