### Question:
QuerySettingsParser { protected Integer readIntegerParam(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 new Integer(s); } catch (NumberFormatException e) { throw new IllegalArgumentException(paramKey); } } return null; }  QuerySettings parseUriParams(final MultivaluedMap<String, String> params);  }### Answer:
@Test public void readIntegerParam() { QuerySettingsParser tested = getTested(); Assert.assertNull(tested.readIntegerParam(null, "key")); MultivaluedMap<String, String> params = new MultivaluedMapImpl<String, String>(); Assert.assertNull(tested.readIntegerParam(params, "key")); params.add("key", ""); Assert.assertNull(tested.readIntegerParam(params, "key")); params.clear(); params.add("key", " \t"); Assert.assertNull(tested.readIntegerParam(params, "key")); params.clear(); params.add("key", "10"); Assert.assertEquals(new Integer(10), tested.readIntegerParam(params, "key")); params.clear(); params.add("key", "10err"); try { tested.readIntegerParam(params, "key"); Assert.fail("IllegalArgumentException expected"); } catch (IllegalArgumentException e) { } }