Code example for UnknownHostException

0
        return ip[1] == ip2[1];
    } 
 
    public String getLocation(InetAddress endpoint) throws UnknownHostException
    { 
        throw new UnknownHostException("Not Supported");
    } 
 
    public List<InetAddress> sortByProximity(final InetAddress address, Collection<InetAddress> unsortedAddress)
    { 
        List<InetAddress> preferred = new ArrayList<InetAddress>(unsortedAddress);
        Collections.sort(preferred, new Comparator<InetAddress>()
        { 
            public int compare(InetAddress a1, InetAddress a2)
            { 
                try 
                { 
                    if (isOnSameRack(address, a1) && !isOnSameRack(address, a2))
                        return -1; 
                    if (isOnSameRack(address, a2) && !isOnSameRack(address, a1))
                        return 1;