### Question:
SearchUtils { public static Date dateFromISOString(String string, boolean silent) throws IllegalArgumentException { if (string == null) return null; try { return ISODateTimeFormat.dateTimeParser().parseDateTime(string).toDate(); } catch (IllegalArgumentException e) { if (!silent) throw e; else return null; } }  static Properties loadProperties(String path); static String trimToNull(String value); static List<String> safeList(List<String> values); static boolean isBlank(String value); static boolean isBlank(Object value); static String convertJsonMapToString(Map<String, Object> jsonMapValue); static DateFormat getISODateFormat(); static Date dateFromISOString(String string, boolean silent); static boolean isDateAfter(Object date, int thresholdInMinutes); static Map<String, Object> convertToJsonMap(String jsonData); static Integer getIntegerFromJsonMap(Map<String, Object> map, String key); @SuppressWarnings("unchecked") static List<String> getListOfStringsFromJsonMap(Map<String, Object> map, String key); static void mergeJsonMaps(Map<String, Object> source, Map<String, Object> target); static Map<String, Object> collapseURLParams(MultivaluedMap<String, String> params); static boolean isMysqlDialect(String databaseProductName);  }### Answer:
@Test public void dateFromISOString() throws ParseException { Assert.assertNull(SearchUtils.dateFromISOString(null, false)); Assert.assertNull(SearchUtils.dateFromISOString(null, true)); try { Assert.assertNull(SearchUtils.dateFromISOString("", false)); Assert.fail("IllegalArgumentException expected"); } catch (IllegalArgumentException e) { } Assert.assertNull(SearchUtils.dateFromISOString("", true)); try { Assert.assertNull(SearchUtils.dateFromISOString("badvalue", false)); Assert.fail("IllegalArgumentException expected"); } catch (IllegalArgumentException e) { } Assert.assertNull(SearchUtils.dateFromISOString("badvalue", true)); Assert.assertEquals(1361386810123l, SearchUtils.dateFromISOString("2013-02-20T20:00:10.123+0100", false).getTime()); Assert.assertEquals(1361386810123l, SearchUtils.dateFromISOString("2013-02-20T20:00:10.123+01", false).getTime()); Assert .assertEquals(1361386810123l, SearchUtils.dateFromISOString("2013-02-20T20:00:10.123+01:00", false).getTime()); Assert.assertEquals(1361390410123l, SearchUtils.dateFromISOString("2013-02-20T20:00:10.123Z", false).getTime()); }