コード例 #1
0
  @Test
  public void testAllOf() throws InterruptedException, ExecutionException {
    Future<List<Integer>> i = CompletableFutures.allOf(futures);
    complete(100);

    assertEquals(IntStream.range(0, 100).boxed().collect(toList()), i.get());
  }
コード例 #2
0
 @Test
 public void testNullAllOf() throws InterruptedException, ExecutionException {
   Future<List<Integer>> i = CompletableFutures.allOf();
   assertTrue(i.isDone());
   assertTrue(i.get().isEmpty());
 }