@@ -0,0 +1,1472 @@
+package eu.toolchain.async;%0A%0Aimport static org.mockito.Matchers.any;%0Aimport static org.mockito.Mockito.mock;%0Aimport static org.mockito.Mockito.times;%0Aimport static org.mockito.Mockito.verify;%0A%0Aimport org.junit.Before;%0Aimport org.junit.Test;%0A%0Apublic class CollectAndDiscardHelperTest %7B%0A    private static final int size = 2;%0A%0A    private static final Object result = new Object();%0A    private static final Throwable cause = new Exception();%0A%0A    private ResolvableFuture%3CVoid%3E target;%0A%0A    private CollectAndDiscardHelper%3CObject%3E helper;%0A%0A    @SuppressWarnings(%22unchecked%22)%0A    @Before%0A    public void setup() %7B%0A        target = mock(ResolvableFuture.class);%0A%0A        helper = new CollectAndDiscardHelper%3CObject%3E(size, target);%0A    %7D%0A%0A    private void verifyTarget(int resolved, int failed, int cancelled) %7B%0A        verify(target, times(resolved)).resolve(null);%0A        verify(target, times(failed)).fail(any(Exception.class));%0A        verify(target, times(cancelled)).cancel();%0A    %7D%0A%0A    @Test%0A    public void testResolved() throws Exception %7B%0A        helper.resolved(result);%0A        helper.resolved(result);%0A%0A        verifyTarget(1, 0, 0);%0A    %7D%0A%0A    @Test%0A    public void testFailed() throws Exception %7B%0A        helper.failed(cause);%0A        helper.resolved(result);%0A%0A        verifyTarget(0, 1, 0);%0A    %7D%0A%0A    @Test%0A    public void testCancelled() throws Exception %7B%0A        helper.resolved(result);%0A        helper.cancelled();%0A%0A        verifyTarget(0, 0, 1);%0A    %7D%0A%7D

introduce tests for CollectAndDiscardHelper