code: public Integer calculateNewEntry(PartitionEntry newEntry, Map<Integer, Integer> buckets) {
          if (newEntry == null) {
              throw new IllegalArgumentException("newEntry must be not null");
          }
          if (isEmpty(buckets)) {
              throw new IllegalArgumentException("buckets must be not null");
          }
          HashFunction md5 = Hashing.md5();
          int numBuckets = buckets.size();
          return buckets.get(Hashing.consistentHash(md5.hashInt(newEntry.hashCode()), numBuckets));
      }
docs: Distribute a new entry across buckets using a consistent hashing strategy.
  
  @param newEntry the new entry to distribute
  @param buckets a table of nodes
  @return a code of the node which the new entry is placed