### Question:
UrlQuery { Optional<String> parameterValue(String name) { return stream(parameterValues(name).spliterator(), false).findFirst(); } private  UrlQuery(List<Parameter> parameters); @Override boolean equals(Object o); @Override int hashCode(); @Override String toString();  }### Answer:
@Test public void providesValueByKey() { assertThat(query.parameterValue("foo"), isValue("alpha")); assertThat(query.parameterValue("bar"), isValue("beta")); assertThat(query.parameterValue("no_such_key"), isAbsent()); }