@Test
public void testComposeTry0Result() {

    final AtomicInteger latch = new AtomicInteger(0);
    final Fun.ThrowingSupplier<Integer> supplier = () -> {
        int newValue = latch.incrementAndGet();
        if (newValue % 3 == 0) {
            throw new Exception("multiples of three are disallowed");
        }
        return newValue;
    };
    List<Result<Integer>> results = Stream.generate(composeTry0(Result::success, Result::<Integer>failure, supplier))
            .limit(10).collect(Collectors.toList());
    assertEquals("collected three errors", 3, results.stream().filter(Result::isFailure).count());
}