Store endereço IP distinto no HashSet [duplicado]

Possible Duplicate:
Tamanho máximo do HashSet

Como posso adicionar um endereço IP distinto no HashSet

Set<String> ips = new HashSet<String>();

String ip = generateIPAddress();


   if (!ips.add(ip)) { 

// What should I do here?

    }


private String generateIPAddress() {

        Random r = new Random();

        //Now the IP is b1.b2.b3.b4
        String s = r.nextInt(256) + "." + r.nextInt(256) + "." + r.nextInt(256) + "." + r.nextInt(256);

        return s;

    }

questionAnswers(2)

yourAnswerToTheQuestion