/**
  * Returns a new consistent hash of the same type with the given address removed.
  *
  * @param ch consistent hash to start with
  * @param toRemove address to remove
  * @param c configuration
  * @return a new consistent hash instance of the same type
  */
 public static ConsistentHash removeAddress(ConsistentHash ch, Address toRemove, Configuration c) {
   if (ch instanceof UnionConsistentHash)
     return removeAddressFromUnionConsistentHash((UnionConsistentHash) ch, toRemove, c);
   else {
     ConsistentHash newCH = constructConsistentHashInstance(c);
     Set<Address> caches = new HashSet<Address>(ch.getCaches());
     caches.remove(toRemove);
     newCH.setCaches(caches);
     return newCH;
   }
 }