contains java- problem
<p>i have this script, and it is suppose  identifier if a player can assist to the suit of a specific card. So, if he assist, show the message, you assist, no problem, but if he does bluff the verification never is done and show the else System.out.println(hand);</p>

<p>the result of this else is [SEVEN of DIAMONDS, FOUR of SPADES, SEVEN of SPADES, KING of DIAMONDS,  more cards]</p>

<p>pn50.getText() (the result of this is CLUBS for example)</p>

<p>my doubt is, what reason the line hand.subList(0, 10).contains(pn50.getText()) never finds nothing in the list (that is the hand of the player)</p>

<p>for example, if the player one plays the king of hearts, and the player two plays the seven of clubs and have the three of hearts in the hand, it is suppose show the message "play another"</p>

<pre><code>@Override
    public boolean validCard(List&lt;Card&gt; hand, JTextField pn70, JTextField pn50, int i) {
        if(pn70.getText().equals (pn50.getText())) {
            System.out.println("you assist");
            return true;
        } else {
            if (hand.subList(0, 10).contains(pn50.getText())) {
                System.out.println("play another");
                }
            else 
                System.out.println(hand);
        }
        return false;
    }
</code></pre>

<p>any help?</p>

<p>thanks</p>
