protected <K> Map<Address, List<K>> mapKeysToNodes(K... input) {
DistributionManager dm = cache.getAdvancedCache().getDistributionManager();
Map<Address, List<K>> addressToKey = new HashMap<Address, List<K>>();
for (K key : input) {
List<Address> nodesForKey = dm.locate(key);
Address ownerOfKey = nodesForKey.get(0);
List<K> keysAtNode = addressToKey.get(ownerOfKey);
if (keysAtNode == null) {
keysAtNode = new ArrayList<K>();
addressToKey.put(ownerOfKey, keysAtNode);