@Nonnull
    public static List<Future<?>> getAllDone(Collection<Future<?>> futures) {
        List<Future<?>> doneFutures = new ArrayList<>();
        for (Future<?> f : futures) {
            if (f.isDone()) {
                doneFutures.add(f);
            }
        }
        return doneFutures;
    }
@Test
    public void testGetAllDone_whenSomeFuturesAreCompleted() {
        Future<?> completedFuture = InternalCompletableFuture.newCompletedFuture(null);
        Collection<Future<?>> futures =
                asList(new UncancellableFuture<>(), completedFuture, new UncancellableFuture<>());

        assertEquals(1, FutureUtil.getAllDone(futures).size());
        assertEquals(completedFuture, FutureUtil.getAllDone(futures).get(0));
    }