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

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

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

}