// Path: src/main/java/com/nurkiewicz/lazyseq/LazySeq.java
// @SuppressWarnings("unchecked")
// public static <E> LazySeq<E> empty() {
// 	return Nil.instance();
// }
// 
// Path: src/main/java/com/nurkiewicz/lazyseq/LazySeq.java
// public static <E> LazySeq<E> of(E element) {
// 	return cons(element, empty());
// }
// 
// Path: src/test/java/com/nurkiewicz/lazyseq/samples/Seqs.java
// public static LazySeq<Integer> primes() {
// 	return iterate(2, Seqs::nextPrimeAfter);
// }


import org.testng.annotations.Test;
import java.util.List;
import static com.nurkiewicz.lazyseq.LazySeq.empty;
import static com.nurkiewicz.lazyseq.LazySeq.of;
import static com.nurkiewicz.lazyseq.samples.Seqs.primes;
import static org.assertj.core.api.Assertions.assertThat;
import static org.assertj.core.api.Assertions.failBecauseExceptionWasNotThrown;
		//given
		final LazySeq<Integer> fixed = of(5, 7, 9, 11);

		//when
		final LazySeq<List<Integer>> grouped = fixed.grouped(2);

		//then
		assertThat(grouped.get(0)).containsExactly(5, 7);
		assertThat(grouped.get(1)).containsExactly(9, 11);
		assertThat(grouped).hasSize(2);
	}

	@Test
	public void shouldReturnWindowOfSizeOne() throws Exception {
		//given
		final LazySeq<Integer> fixed = of(5, 7, 9);

		//when
		final LazySeq<List<Integer>> grouped = fixed.grouped(1);

		//then
		assertThat(grouped.get(0)).containsExactly(5);
		assertThat(grouped.get(1)).containsExactly(7);
		assertThat(grouped.get(2)).containsExactly(9);
		assertThat(grouped).hasSize(3);
	}

	@Test
	public void shouldReturnWindowOfSizeOneForSingleElementSeq() throws Exception {
		//given
// Path: src/main/java/com/nurkiewicz/lazyseq/LazySeq.java
// @SuppressWarnings("unchecked")
// public static <E> LazySeq<E> empty() {
// 	return Nil.instance();
// }
// 
// Path: src/main/java/com/nurkiewicz/lazyseq/LazySeq.java
// public static <E> LazySeq<E> of(E element) {
// 	return cons(element, empty());
// }
// 
// Path: src/test/java/com/nurkiewicz/lazyseq/samples/Seqs.java
// public static LazySeq<Integer> primes() {
// 	return iterate(2, Seqs::nextPrimeAfter);
// }


// Path: src/test/java/com/nurkiewicz/lazyseq/LazySeqGroupedTest.java
import org.testng.annotations.Test;
import java.util.List;
import static com.nurkiewicz.lazyseq.LazySeq.empty;
import static com.nurkiewicz.lazyseq.LazySeq.of;
import static com.nurkiewicz.lazyseq.samples.Seqs.primes;
import static org.assertj.core.api.Assertions.assertThat;
import static org.assertj.core.api.Assertions.failBecauseExceptionWasNotThrown;

		//given
		final LazySeq<Integer> fixed = of(5, 7, 9, 11);

		//when
		final LazySeq<List<Integer>> grouped = fixed.grouped(2);

		//then
		assertThat(grouped.get(0)).containsExactly(5, 7);
		assertThat(grouped.get(1)).containsExactly(9, 11);
		assertThat(grouped).hasSize(2);
	}

	@Test
	public void shouldReturnWindowOfSizeOne() throws Exception {
		//given
		final LazySeq<Integer> fixed = of(5, 7, 9);

		//when
		final LazySeq<List<Integer>> grouped = fixed.grouped(1);

		//then
		assertThat(grouped.get(0)).containsExactly(5);
		assertThat(grouped.get(1)).containsExactly(7);
		assertThat(grouped.get(2)).containsExactly(9);
		assertThat(grouped).hasSize(3);
	}

	@Test
	public void shouldReturnWindowOfSizeOneForSingleElementSeq() throws Exception {
		//given
		final LazySeq<Integer> fixed = of(3);