RouteParameters implements Serializable { public Optional<Integer> getInteger(String parameterName) { final String value = getValue(parameterName); if (value == null) { return Optional.empty(); } return Optional.of(Integer.valueOf(value)); } private  RouteParameters();  RouteParameters(Map<String, String> params);  RouteParameters(RouteParam... params);  RouteParameters(String name, String value); static RouteParameters empty(); Set<String> getParameterNames(); Optional<String> get(String parameterName); Optional<Integer> getInteger(String parameterName); Optional<Long> getLong(String parameterName); List<String> getWildcard(String parameterName); @Override String toString(); @Override boolean equals(Object obj); @Override int hashCode();  }
@Test public void integer_getter_throws_exception() { RouteParameters parameters = getParameters(); try { parameters.getInteger("string"); Assert.fail("getInteger should not be able to format a string."); } catch (NumberFormatException e) { } try { parameters.getInteger("long"); Assert.fail("getInteger should not be able to format a long."); } catch (NumberFormatException e) { } try { parameters.getInteger("varargs"); Assert.fail("getInteger should not be able to format a varargs."); } catch (NumberFormatException e) { } }