* @param addresses with which to populate the consistent hash
* @param topologyInfo
* @return a new consistent hash instance
*/
public static ConsistentHash createConsistentHash(ConsistentHash template, Collection<Address> addresses, TopologyInfo topologyInfo) {
Hash hf = null;
if (template instanceof AbstractWheelConsistentHash) {
hf = ((AbstractWheelConsistentHash) template).hashFunction;
}
ConsistentHash ch = constructConsistentHashInstance(template.getClass(), hf);
if (addresses != null && !addresses.isEmpty()) ch.setCaches(toSet(addresses));