### Question:
ArrayListMultimap implements Multimap<K, V> { @Override public Multiset<K> keys() { return new ArrayListMultiset<>(map.entrySet() .stream() .flatMap(this::toKeys) .collect(Collectors.toList())); } private  ArrayListMultimap(); static ArrayListMultimap<K, V> create(); @Override boolean put(final K key, final V value); @Override Collection<V> get(final K key); @Override Collection<V> values(); @Override Multiset<K> keys(); @Override boolean equals(Object o); @Override int hashCode();  }### Answer:
@Test public void keys() { final var given = ArrayListMultimap.create(); given.put("key1", "item1"); given.put("key1", "item1"); given.put("key2", "item2"); final var values = List.of("key1", "key1", "key2"); final var expected = new ArrayListMultiset<>(values); final var actual = given.keys(); assertEquals(expected, actual); }