class MapStream implements Stream<Map.Entry<K, V>> {

  @SuppressWarnings("unchecked")
  public MapStream<K, V> sortedValues() {
    Comparator<V> comparator = (Comparator<V>) Comparator.naturalOrder();
    return wrap(underlying.sorted((e1, e2) -> comparator.compare(e1.getValue(), e2.getValue())));
  }

  private  MapStream(Stream<Map.Entry<K, V>> underlying);

}