public ServiceInformation get(String key) {
        ServiceInformation info = null;
        long hash = algorithm.hash(key);
        //Find the first server with a hash key after this one
        final SortedMap<Long, ServiceInformation> tailMap = ring.tailMap(hash);
        //Wrap around to the beginning of the ring, if we went past the last one
        hash = tailMap.isEmpty() ? ring.firstKey() : tailMap.firstKey();
        info = ring.get(hash);
        return info;
    }
public ServiceInformation get ( String key ) { ServiceInformation info = null ; long hash = algorithm . hash ( key ) ; final SortedMap < Long , ServiceInformation > tailMap = ring . tailMap ( hash ) ; hash = tailMap . isEmpty ( ) ? ring . firstKey ( ) : tailMap . firstKey ( ) ; info = ring . get ( hash ) ; return info ; }
Returns the appropriate server for the given key.

Running time: O(1)

@param key
@throws java.util.NoSuchElementException if the ring is empty
@return