private static <T> List<T> extend(List<T> list, T extraValue) { return F.flow(list).append(extraValue).toList(); } }
@Override public Flow<Integer> map(Integer value) { Flow<Integer> flow = F.flow(); for (int i = 0; i < value; i++) flow = flow.append(value); return flow; } };
@Test public void append_values_onto_flow() { Flow<Integer> first = F.flow(1, 2, 3); Flow<Integer> updated = first.append(4, 5, 6); assertFlowValues(updated, 1, 2, 3, 4, 5, 6); }
@Test public void reverse_non_array_flow() { assertFlowValues(filteredEmpty.append(1, 2, 3).reverse(), 3, 2, 1); }
@Test public void sort_non_array_flow() { assertFlowValues(filteredEmpty.append(7, 3, 9).sort(), 3, 7, 9); }