code: public <R> Set<R> flattenEntries(TriFunction<K1, K2, V, R> fn) {
      return entrySet().stream()
          .flatMap(outer -> outer.getValue().entrySet().stream()
              .map(inner -> fn.apply(outer.getKey(), inner.getKey(), inner.getValue())))
          .collect(toSet());
    }
docs: Flattens the (key1, key2, value) triples according to the given function.
  
  @param fn a function to create an entry from the keys and value
  @param <R> the result type of the function
  @return the set of entries