class CompletableFutureFlow {

    static CompletableFuture<Integer> flowWithId(int id, ExecutorService pool) {
        return firstOperation(id, pool)
                .thenCompose(__ -> secondOperation(id, pool))
                .thenCompose(__ -> thirdOperation(id, pool));
    }

}