Estou fazendo um método dentro da ArrayList que retorna 4 numeros iguais, porém ele retorna true, mesmo se tem somente 3 números iguais... não estou conseguindo achar o erro, alguém pode me ajudar?
Eis o código:
public boolean verificaQuatro(){
int t=s.size();
int q=0;
ValorFace valor;
Numero c=null;
boolean quatro=false;
int nn = 0;
for(int i=0; i<t; i++){
for(int y=i+1; y<t; y++){
if(s.get(i).getValor()==s.get(y).getValor()){
c=s.get(y);
q++;
}
}
if(q==3){
quatro=true;
}
else quatro=false;
}
return quatro;
}