code: public <R, A, E extends Exception> List<R> collapse(final Try.BiPredicate<? super T, ? super T, E> collapsible, final Collector<? super T, A, R> collector)
              throws E {
          N.checkArgNotNull(collapsible);
          N.checkArgNotNull(collector);
  
          final List<R> result = new ArrayList<>();
          final Supplier<A> supplier = collector.supplier();
          final BiConsumer<A, ? super T> accumulator = collector.accumulator();
          final Function<A, R> finisher = collector.finisher();
          final Iterator<T> iter = iterator();
          boolean hasNext = false;
          T next = null;
  
          while (hasNext || iter.hasNext()) {
              final A c = supplier.get();
              accumulator.accept(c, hasNext ? next : (next = iter.next()));
  
              while ((hasNext = iter.hasNext())) {
                  if (collapsible.test(next, (next = iter.next()))) {
                      accumulator.accept(c, next);
                  } else {
                      break;
                  }
              }
  
              result.add(finisher.apply(c));
          }
  
          return result;
      }
docs: Merge series of adjacent elements which satisfy the given predicate using the merger function.
  
  <p>Example:
  <pre>
  <code>
  Seq.of(new Integer[0]).collapse((a, b) -> a < b, Collectors.summingInt(Fn.unboxI())) => []
  Seq.of(1).collapse((a, b) -> a < b, Collectors.summingInt(Fn.unboxI())) => [1]
  Seq.of(1, 2).collapse((a, b) -> a < b, Collectors.summingInt(Fn.unboxI())) => [3]
  Seq.of(1, 2, 3).collapse((a, b) -> a < b, Collectors.summingInt(Fn.unboxI())) => [6]
  Seq.of(1, 2, 3, 3, 2, 1).collapse((a, b) -> a < b, Collectors.summingInt(Fn.unboxI())) => [6, 3, 2, 1]
  </code>
  </pre>
  
  @param collapsible
  @param collector
  @return