code: public ExceptionalStream<T, E> collapse(final Try.BiPredicate<? super T, ? super T, ? extends E> collapsible,
              final Try.BiFunction<? super T, ? super T, T, ? extends E> mergeFunction) {
          checkArgNotNull(collapsible, "collapsible");
          checkArgNotNull(mergeFunction, "mergeFunction");
  
          final ExceptionalIterator<T, E> iter = elements;
  
          return newStream(new ExceptionalIterator<T, E>() {
              private boolean hasNext = false;
              private T next = null;
  
              @Override
              public boolean hasNext() throws E {
                  return hasNext || iter.hasNext();
              }
  
              @Override
              public T next() throws E {
                  T res = hasNext ? next : (next = iter.next());
  
                  while ((hasNext = iter.hasNext())) {
                      if (collapsible.test(next, (next = iter.next()))) {
                          res = mergeFunction.apply(res, next);
                      } else {
                          break;
                      }
                  }
  
                  return res;
              }
          }, closeHandlers);
      }
docs: Merge series of adjacent elements which satisfy the given predicate using
  the merger function and return a new stream.
  
  <p>Example:
  <pre>
  <code>
  Stream.of(new Integer[0]).collapse((a, b) -> a < b, (a, b) -> a + b) => []
  Stream.of(1).collapse((a, b) -> a < b, (a, b) -> a + b) => [1]
  Stream.of(1, 2).collapse((a, b) -> a < b, (a, b) -> a + b) => [3]
  Stream.of(1, 2, 3).collapse((a, b) -> a < b, (a, b) -> a + b) => [6]
  Stream.of(1, 2, 3, 3, 2, 1).collapse((a, b) -> a < b, (a, b) -> a + b) => [6, 3, 2, 1]
  </code>
  </pre>
  
  <br />
  This method only run sequentially, even in parallel stream.
  
  @param collapsible
  @param mergeFunction
  @return