@@ -0,0 +1,1785 @@
+package eu.toolchain.async;%0A%0Aimport static org.junit.Assert.assertEquals;%0Aimport static org.mockito.Mockito.doReturn;%0Aimport static org.mockito.Mockito.doThrow;%0Aimport static org.mockito.Mockito.mock;%0Aimport static org.mockito.Mockito.verify;%0A%0Aimport java.util.ArrayList;%0Aimport java.util.List;%0Aimport java.util.concurrent.Callable;%0Aimport java.util.concurrent.ExecutorService;%0A%0Aimport org.junit.Before;%0Aimport org.junit.Test;%0A%0Apublic class TinyAsyncTest %7B%0A    private ExecutorService executor;%0A%0A    @Before%0A    public void setup() %7B%0A        executor = mock(ExecutorService.class);%0A    %7D%0A%0A    @SuppressWarnings(%22unchecked%22)%0A    @Test%0A    public void testEventuallyCollectEmpty() throws Exception %7B%0A        final TinyAsync async = TinyAsync.builder().executor(executor).build();%0A%0A        final Object value = new Object();%0A%0A        final List%3CCallable%3CAsyncFuture%3CObject%3E%3E%3E callables = new ArrayList%3C%3E();%0A        final StreamCollector%3CObject, Object%3E collector = mock(StreamCollector.class);%0A%0A        doReturn(value).when(collector).end(0, 0, 0);%0A        final Object result = async.eventuallyCollect(callables, collector, 10).getNow();%0A%0A        assertEquals(value, result);%0A        verify(collector).end(0, 0, 0);%0A    %7D%0A%0A    @SuppressWarnings(%22unchecked%22)%0A    @Test(expected = Throwable.class)%0A    public void testEventuallyCollectEmptyThrows() throws Exception %7B%0A        final TinyAsync async = TinyAsync.builder().executor(executor).build();%0A%0A        final Throwable e = new Throwable();%0A%0A        final List%3CCallable%3CAsyncFuture%3CObject%3E%3E%3E callables = new ArrayList%3C%3E();%0A        final StreamCollector%3CObject, Object%3E collector = mock(StreamCollector.class);%0A%0A        doThrow(e).when(collector).end(0, 0, 0);%0A%0A        async.eventuallyCollect(callables, collector, 10).getNow();%0A    %7D%0A%7D

introduce TinyAsyncTest