code: public <E extends Exception, E2 extends Exception> List<T> collapse(final Try.BiPredicate<? super T, ? super T, E> collapsible,
              final Try.BiFunction<? super T, ? super T, T, E2> mergeFunction) throws E, E2 {
          N.checkArgNotNull(collapsible);
          N.checkArgNotNull(mergeFunction);
  
          final List<T> result = new ArrayList<>();
          final Iterator<T> iter = iterator();
          boolean hasNext = false;
          T next = null;
  
          while (hasNext || iter.hasNext()) {
              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;
                  }
              }
  
              result.add(res);
          }
  
          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, (a, b) -> a + b) => []
  Seq.of(1).collapse((a, b) -> a < b, (a, b) -> a + b) => [1]
  Seq.of(1, 2).collapse((a, b) -> a < b, (a, b) -> a + b) => [3]
  Seq.of(1, 2, 3).collapse((a, b) -> a < b, (a, b) -> a + b) => [6]
  Seq.of(1, 2, 3, 3, 2, 1).collapse((a, b) -> a < b, (a, b) -> a + b) => [6, 3, 2, 1]
  </code>
  </pre>
  
  @param collapsible
  @param mergeFunction
  @return