### Question:
QuerySettingsParser { protected Long readDateParam(MultivaluedMap<String, String> params, String paramKey) throws IllegalArgumentException { if (params != null && params.containsKey(paramKey)) { try { String s = SearchUtils.trimToNull(params.getFirst(paramKey)); if (s == null) return null; return ISODateTimeFormat.dateTimeParser().parseMillis(s); } catch (Exception e) { throw new IllegalArgumentException(paramKey); } } return null; }  QuerySettings parseUriParams(final MultivaluedMap<String, String> params);  }### Answer:
@Test public void readDateParam() { QuerySettingsParser tested = getTested(); Assert.assertNull(tested.readDateParam(null, "key")); MultivaluedMap<String, String> params = new MultivaluedMapImpl<String, String>(); Assert.assertNull(tested.readDateParam(params, "key")); params.add("key", ""); Assert.assertNull(tested.readDateParam(params, "key")); params.clear(); params.add("key", " \t"); Assert.assertNull(tested.readDateParam(params, "key")); params.clear(); params.add("key", "2013-01-16T12:23:45.454Z"); Assert.assertEquals(new Long(1358339025454L), tested.readDateParam(params, "key")); params.clear(); params.add("key", "2013-01-16T12:23:45Z"); Assert.assertEquals(new Long(1358339025000L), tested.readDateParam(params, "key")); params.clear(); params.add("key", "2013-01-16T12:23:45.454+0100"); Assert.assertEquals(new Long(1358335425454L), tested.readDateParam(params, "key")); params.clear(); params.add("key", "2013-01-16T12:23:45-0500"); Assert.assertEquals(new Long(1358357025000L), tested.readDateParam(params, "key")); params.clear(); params.add("key", "2/2/2013"); try { tested.readDateParam(params, "key"); Assert.fail("IllegalArgumentException expected"); } catch (IllegalArgumentException e) { } }