@Test
public void parallelize() {

    List<Long> delays = Lists.newArrayList(1001L, 1002L);
    assertEquals((long) Streams.parallelize(delays, delay -> () -> {
        try {
            Thread.sleep(delay);
        } catch (InterruptedException ignored) {
        }
        return delay + delay;
    })
            .filter(r -> !r.hasError())
            .map(ResultWrapper::getResult)
            .reduce(0L, (a, b) -> a + b), 4006L);
}