@Test
public void joinTest() throws InterruptedException {

    ExecutorPipeline<Integer, Integer> exec1 = new ExecutorPipeline<>(8, 100, true,
            integer -> {
        try {
            Thread.sleep(2);
        } catch (InterruptedException e) {
            throw new RuntimeException(e);
        }
        return integer;
    }, Throwable::printStackTrace);
    final List<Integer> consumed = new ArrayList<>();
    ExecutorPipeline<Integer, Void> exec2 = exec1.add(1, 100, consumed::add);
    int cnt = 1000;
    for (int i = 0; i < cnt; i++) {
        exec1.push(i);
    }
    exec1.join();
    Assert.assertEquals(cnt, consumed.size());
}