    @Test
    public void testReduce() throws Exception {


        assertFalse(Stream.of().reduce(null).isPresent());

        assertEquals((Integer) 9, Stream.of(9).reduce(null).get());
        assertFalse(null, Stream.of(null, null, null).reduce(new Func2<Object, Object, Object>() {
            @Override
            public Object call(Object value1, Object value2) {return null;}
        }).isPresent());
        assertEquals((Integer) 9, Stream.of(2, 3, 4).reduce(new Func2<Integer, Integer, Integer>() {
            @Override
            public Integer call(Integer value1, Integer value2) {return value1 + value2;}
        }).get());
    }