@Test
public void testTryOrDefault1() {

    final Fun.ThrowingFunction<Integer, Integer> function = newValue -> {
        if (newValue % 3 == 0) {
            throw new Exception("multiples of three are disallowed");
        }
        return newValue;
    };
    final Integer[] ints = Stream.generate(new AtomicInteger(0)::incrementAndGet).limit(10)
            .map(tryOrDefault1(function, 0))
            .toArray(Integer[]::new);
    assertArrayEquals("ints contains three zeros, 1 for each multiple of 3",
            new Integer[]{1, 2, 0, 4, 5, 0, 7, 8, 0, 10}, ints);
}