@Override
public <T, K> List<Future<T>> submitEverywhere(Callable<T> task, K... input) {
if (task == null) throw new NullPointerException();
if(inputKeysSpecified(input)) {
List<Future<T>> futures = new ArrayList<Future<T>>();
Address me = rpc.getAddress();
Map<Address, List<K>> nodesKeysMap = mapKeysToNodes(input);
for (Entry<Address, List<K>> e : nodesKeysMap.entrySet()) {
Address target = e.getKey();
DistributedExecuteCommand<T> c = null;
if (target.equals(me)) {
c = factory.buildDistributedExecuteCommand(clone(task), me, e.getValue());
} else {
c = factory.buildDistributedExecuteCommand(task, me, e.getValue());
}
DistributedRunnableFuture<T> f = new DistributedRunnableFuture<T>(c);