code: public EntryStream<K, List<V>> collapseKeys() {
          return new StreamEx<>(new CollapseSpliterator<Entry<K, V>, PairBox<K, List<V>>>(equalKeys(),
                  e -> new PairBox<>(e.getKey(), Collections.singletonList(e.getValue())), (pb, e) -> {
                      if (!(pb.b instanceof ArrayList)) {
                          V old = pb.b.get(0);
                          pb.b = new ArrayList<>();
                          pb.b.add(old);
                      }
                      pb.b.add(e.getValue());
                      return pb;
                  }, (pb1, pb2) -> {
                      if (!(pb1.b instanceof ArrayList)) {
                          V old = pb1.b.get(0);
                          pb1.b = new ArrayList<>();
                          pb1.b.add(old);
                      }
                      pb1.b.addAll(pb2.b);
                      return pb1;
                  }, spliterator()), context).mapToEntry(pb -> pb.a, pb -> pb.b);
      }
docs: Merge series of adjacent stream entries with equal keys grouping the
  corresponding values into {@code List}.
  
  <p>
  This is a <a href="package-summary.html#StreamOps">quasi-intermediate</a>
  partial reduction operation.
  
  <p>
  There are no guarantees on the type, mutability, serializability, or
  thread-safety of the {@code List} objects of the resulting stream.
  
  <p>
  The key of the resulting entry is the key of the first merged entry.
  
  @return a new {@code EntryStream} which keys are the keys of the original
  stream and the values of adjacent entries with the same keys are
  grouped into {@code List}
  @see StreamEx#groupRuns(BiPredicate)
  @since 0.5.5