}
private Address getAddressForKey(Object key) {
DistributionManager distributionManager = getDistributionManager();
ConsistentHash hash = distributionManager.getConsistentHash();
List<Address> addressList = hash.locate(key, 1);
if (addressList.size() == 0) {
throw new IllegalStateException("Empty address list returned by consistent hash " + hash + " for key " + key);
}
return addressList.get(0);
}