### Question:
HttpQuery implements Iterable<Map.Entry<String, String>> { public HttpQuery set(final String key, final String value) { validateQueryParam(key, value); final ArrayList<String> list = new ArrayList<>(DEFAULT_LIST_SIZE); final boolean changed = list.add(value); params.put(key, list); if (changed) { updateQueryParams(); } return this; } HttpQuery(final Map<String, List<String>> params, final Consumer<Map<String, List<String>>> queryParamsUpdater); @Nullable String get(final String key); Iterator<String> valuesIterator(final String key); Iterable<String> values(final String key); Set<String> keys(); HttpQuery add(final String key, final String value); HttpQuery add(final String key, final Iterable<String> values); HttpQuery add(final String key, final String... values); HttpQuery set(final String key, final String value); HttpQuery set(final String key, final Iterable<String> values); HttpQuery set(final String key, final String... values); boolean contains(final String key, final String value); boolean remove(final String key); boolean remove(final String key, final String value); int size(); @Override Iterator<Entry<String, String>> iterator();  }### Answer:
@Test public void testSet() { params.put("foo", newList("bar", "baz")); params.put("abc", newList("def")); final HttpQuery query = new HttpQuery(params, queryParamsUpdater); query.set("abc", "new"); assertEquals(singletonList("new"), iteratorAsList(query.valuesIterator("abc"))); assertEquals(asList("bar", "baz"), iteratorAsList(query.valuesIterator("foo"))); }