content: package io.activej.datastream.processor.transformer.impl;
  
  import io.activej.datastream.consumer.ToListStreamConsumer;
  import io.activej.datastream.supplier.StreamSupplier;
  import io.activej.datastream.supplier.StreamSuppliers;
  import io.activej.test.rules.EventloopRule;
  import org.junit.ClassRule;
  import org.junit.Test;
  
  import java.util.List;
  
  import static io.activej.promise.TestUtils.await;
  import static org.junit.Assert.assertEquals;
  import static org.junit.Assert.assertTrue;
  
  public class SkipTest {
  
  	@ClassRule
  	public static final EventloopRule eventloopRule = new EventloopRule();
  
  	@Test
  	public void testSkip() {
  		List<Integer> original = List.of(1, 2, 3, 4, 5, 6, 7, 8, 9, 10);
  		StreamSupplier<Integer> supplier = StreamSuppliers.ofIterable(original);
  		ToListStreamConsumer<Integer> consumer = ToListStreamConsumer.create();
  
  		await(supplier.transformWith(new Skip<>(3)).streamTo(consumer));
  
  		assertEquals(original.subList(3, original.size()), consumer.getList());
  	}
  
  	@Test
  	public void testNoSkip() {
  		List<Integer> original = List.of(1, 2, 3, 4, 5, 6, 7, 8, 9, 10);
  		StreamSupplier<Integer> supplier = StreamSuppliers.ofIterable(original);
  		ToListStreamConsumer<Integer> consumer = ToListStreamConsumer.create();
  
  		await(supplier.transformWith(new Skip<>(Skip.NO_SKIP)).streamTo(consumer));
  
  		assertEquals(original, consumer.getList());
  	}
  
  	@Test
  	public void testSkipAll() {
  		List<Integer> original = List.of(1, 2, 3, 4, 5, 6, 7, 8, 9, 10);
  		StreamSupplier<Integer> supplier = StreamSuppliers.ofIterable(original);
  		ToListStreamConsumer<Integer> consumer = ToListStreamConsumer.create();
  
  		await(supplier.transformWith(new Skip<>(100)).streamTo(consumer));
  
  		assertTrue(consumer.getList().isEmpty());
  	}
  }
  