public CompletionStage<E> add(CompletionStage<E> future) throws InterruptedException {
        checkNotNull(future, "future can't be null");
        this.thread = Thread.currentThread();

        down();
        futures.add(future);
        future.whenCompleteAsync((response, t) -> up(), CALLER_RUNS);
        return future;
    }
@Test
    public void testInterrupt() throws Exception {
        final Pipelining<String> pipelining = new Pipelining<>(1);
        pipelining.add(mock(CompletionStage.class));

        TestThread t = new TestThread() {
            @Override
            public void doRun() throws Throwable {
                pipelining.add(mock(CompletionStage.class));
            }
        };
        t.start();
        t.interrupt();
        t.assertFailsEventually(InterruptedException.class);
    }