How to insert the maximum of five elements in a list having to use Socket?
<p>The cod below is generating the error:</p>

<blockquote>
  <p>Thread Type mismastch;cannot convert form String to Set</p>
</blockquote>

<p>Why is this and I how can I fix my code?</p>

<pre><code>private Set&lt;String&gt; LISTA_DE_NOMES = new HashSet&lt;String&gt;();
private Set&lt;String&gt;nomeCliente;

public boolean armazena(Set&lt;String&gt; newName){
     if (nomeCliente.contains(newName)){
             return false;
     } 
     return nomeCliente.add(newName);
}

Usando conjunto !!!
 public synchronized boolean armazena(Set&lt;String&gt;newName){
        if (LISTA_DE_NOMES.contains(nomeCliente)){
                return false;
        } 
        return LISTA_DE_NOMES.addAll(nomeCliente);
   }
    public synchronized boolean canAddNewUser(Set&lt;String&gt;newName){
        return  (LISTA_DE_NOMES.size()&lt;5);
    } 
</code></pre>
