Implementing Consistent Hashing in Java