public final @NotNull JBIterable<@NotNull JBIterable<E>> split(int size) {
    if (size <= 0) throw new IllegalArgumentException(size + " <= 0");
    return intercept(orig -> {
      return new JBIterator<JBIterable<E>>() {
        JBIterator<E> it;

        @Override
        protected JBIterable<E> nextImpl() {
          // iterate through the previous result fully before proceeding
          while (it != null && it.advance()) /* no-op */ ;
          it = null;
          return orig.hasNext() ? once((it = JBIterator.wrap(orig)).take(size)) : stop();
        }
      };
    });
  }
public final @NotNull JBIterable<@NotNull JBIterable<E>> split(int size)