Here you can find the source of now(Collection
public static Collection<Integer> now(Collection<Future<Integer>> s) throws InterruptedException, ExecutionException
//package com.java2s; /*//from w w w. j av a 2s . c o m * Copyright (C) ${year} Omry Yadan <${email}> * All rights reserved. * * See https://github.com/omry/banana/blob/master/BSD-LICENSE for licensing information */ import java.util.*; import java.util.concurrent.ExecutionException; import java.util.concurrent.Future; public class Main { public static Collection<Integer> now(Collection<Future<Integer>> s) throws InterruptedException, ExecutionException { Set<Integer> res = new HashSet<Integer>(); for (Future<Integer> r : s) res.add(r.get()); return res; } }