// Collection of code snippets by Arne Vajhøj 
// (from articles on eksperten.dk / vajhoej.dk written sometime between 2004 and now) 
import java.util.List;
import java.util.stream.Gatherers;

public class GX22 {
    public static void main(String[] args) {
        List<Integer> lst = List.of(1, 1, 2, 2, 3, 3, 4, 5, 6, 4, 7, 8, 9, 10);
        System.out.println(lst);
        lst.stream().gather(new WindowCounted()).forEach(win -> System.out.println(win));
     }
}
