// Path: src/main/java/com/codepoetics/protonpack/comparators/Comparators.java
// public final class Comparators {
// 
//     private Comparators() {
//     }
// 
//     public static <T> Comparator<? super List<T>> toListComparator(Comparator<? super T> itemComparator) {
//         return (o1, o2) -> StreamUtils.zip(o1.stream(), o2.stream(), itemComparator::compare)
//                 .filter(c -> c != 0)
//                 .findFirst()
//                 .orElseGet(() -> Integer.compare(o1.size(), o2.size()));
//     }
// }


import com.codepoetics.protonpack.comparators.Comparators;
import java.util.ArrayList;
import java.util.Comparator;
import java.util.List;
import java.util.Spliterator;
import java.util.function.BiPredicate;
import java.util.function.Consumer;
package com.codepoetics.protonpack;




class AggregatingSpliterator<I> implements Spliterator<List<I>> {

    private final Spliterator<I> source;
    private final BiPredicate<List<I>, I> condition;
    private boolean wasSameSlide = false;

// Path: src/main/java/com/codepoetics/protonpack/comparators/Comparators.java
// public final class Comparators {
// 
//     private Comparators() {
//     }
// 
//     public static <T> Comparator<? super List<T>> toListComparator(Comparator<? super T> itemComparator) {
//         return (o1, o2) -> StreamUtils.zip(o1.stream(), o2.stream(), itemComparator::compare)
//                 .filter(c -> c != 0)
//                 .findFirst()
//                 .orElseGet(() -> Integer.compare(o1.size(), o2.size()));
//     }
// }


// Path: src/main/java/com/codepoetics/protonpack/AggregatingSpliterator.java
import com.codepoetics.protonpack.comparators.Comparators;
import java.util.ArrayList;
import java.util.Comparator;
import java.util.List;
import java.util.Spliterator;
import java.util.function.BiPredicate;
import java.util.function.Consumer;

package com.codepoetics.protonpack;




class AggregatingSpliterator<I> implements Spliterator<List<I>> {

    private final Spliterator<I> source;
    private final BiPredicate<List<I>, I> condition;
    private boolean wasSameSlide = false;

    private List<I> currentSlide = new ArrayList<>();