@Override public ZippedFlow<A, B> drop(int length) { return create(tupleFlow.drop(length)); }
@Override public ZippedFlow<A, B> drop(int length) { return create(tupleFlow.drop(length)); }
@Test public void drop_zero_from_array_flow_is_same() { Flow<Integer> flow = F.flow(1, 2, 3); assertSame(flow.drop(0), flow); }
@Test public void drop_from_empty_is_empty() { assertSame(F.flow().drop(99), F.EMPTY_FLOW); }
@Test public void drop_all_from_array_flow_is_empty_flow() { assertSame(F.flow(1, 2, 3).drop(3), F.EMPTY_FLOW); }
@Test public void drop_from_array_flow() { assertFlowValues(F.range(1, 10).reverse().drop(2), 7, 6, 5, 4, 3, 2, 1); } }
@Test public void to_array() { Flow<Integer> flow = F.range(1, 10).drop(2).take(3); assertTrue(Arrays.equals(flow.toArray(Integer.class), new Integer[] { 3, 4, 5 })); }
@Test public void drop_exact_size_of_flow_is_empty() { assertTrue(F.range(1, 10).filter(evenp).drop(4).isEmpty()); }
@Test public void take_and_drop() { // This can go much, much larger but starts taking a while. Don't hold a reference to the // start // of the series or it can run out of memory. int length = 100000; assertFlowValues(F.series(1, 1).filter(evenp).drop(length).take(3), 2 * length + 2, 2 * length + 4, 2 * length + 6); }
@Test public void lazy_drop_more_than_available() { assertTrue(F.range(1, 10).filter(evenp).drop(5).isEmpty()); }