`UnmodifiableMultimap.forEach` uses the `Multimap.forEach` default implementation which involves listing entries, and creating a new lambda instead of simply passing the BiConsumer through to the protected instance. This is safe to pass directly though because `forEach(BiConsumer)` is a read-only operation.
multimap.entries().forEach(entry -> consumer.accept(entry.getKey()));
    }
    @Override
    int distinctElements() {
      return multimap.asMap().size();
    }
    @Override
    public int size() {
      return multimap.size();
    }
    @Override
    public boolean contains(@Nullable Object element) {
      return multimap.containsKey(element);
    }
    @Override
    public Iterator<K> iterator() {
      return Maps.keyIterator(multimap.entries().iterator());
    }
    @Override
    public int count(@Nullable Object element) {
      Collection<V> values = Maps.safeGet(multimap.asMap(), element);
      return (values == null) ? 0 : values.size();
    }
    @Override
    public int remove(@Nullable Object element, int occurrences) {
      checkNonnegative(occurrences, "occurrences");
      if (occurrences == 0) {
        return count(element);
      }
      Collection<V> values = Maps.safeGet(multimap.asMap(), element);