title: Checking Poker Hands
body: <p>I been having some issues checking poker hands. So in this code we choose how many decks we want to play with and then the rest is like video poker. My issue is that some of the hands checked are "seen". For the straight, I assume because I have it set as though my arraylist is sorted by assumption, how would I fix that?</p>
  
  <p>Also, for two pair, my friend said that a few times it would not properly check if I actually had the two pair, saying it wasn't checking correctly. Here are my check algorithms, can anyone tell me how to fix them? Also, if there are any problems you see besides the straight and two pair having issues. I haven't hit full house or greater yet to test. The .get(#) gets the card suit or rank (getsuit or getrank) from my hand (arraylist). I also think my royal flush may be incorrect.               </p>
  
  <pre><code>private boolean flush(){
          if (currentHand.get(0).getSuit() == currentHand.get(1).getSuit()
                  &amp;&amp; currentHand.get(1).getSuit() == currentHand.get(2).getSuit()
                  &amp;&amp; currentHand.get(2).getSuit() == currentHand.get(3).getSuit()
                  &amp;&amp; currentHand.get(3).getSuit() == currentHand.get(4).getSuit()){
          return true;
          }
          return false;
      }
  
      private boolean royal(){
  
              if ((currentHand.get(0).getRank() == 1)
                      &amp;&amp; (currentHand.get(1).getRank() == 10)
                      &amp;&amp; (currentHand.get(2).getRank() == 11)
                      &amp;&amp; (currentHand.get(3).getRank() == 12)
                      &amp;&amp; (currentHand.get(4).getRank() == 13)) {
  
                  return true;
  
              }
          return false;
      }
      private boolean straight(){//look up
          if (currentHand.get(0).getRank() + 1 == currentHand.get(1).getRank()
                      &amp;&amp; currentHand.get(1).getRank() + 1 == currentHand.get(2).getRank()
                      &amp;&amp; currentHand.get(2).getRank() + 1 == currentHand.get(3).getRank()
                      &amp;&amp; currentHand.get(3).getRank() + 1 == currentHand.get(4).getRank()) {
  
          return true;
          }
          return false;
  
      }
      private boolean four(){
          if (currentHand.get(0).getRank() == currentHand.get(1).getRank()
                  &amp;&amp; currentHand.get(1).getRank() == currentHand.get(2).getRank()
                  &amp;&amp; currentHand.get(2).getRank() == currentHand.get(3).getRank()) {
              return true;
          } else if (currentHand.get(1).getRank() == currentHand.get(2).getRank()
                  &amp;&amp; currentHand.get(2).getRank() == currentHand.get(3).getRank()
                  &amp;&amp; currentHand.get(3).getRank() == currentHand.get(4).getRank()) {
              return true;
          }
          return false;
  
      }
      private boolean fullHouse() {
          if (currentHand.get(0).getRank() == currentHand.get(1).getRank()
                  &amp;&amp; currentHand.get(1).getRank() == currentHand.get(2).getRank()) {
              if (currentHand.get(3).getRank() == currentHand.get(4).getRank()) {
  
                  return true;
              }
  
  
          }else if(currentHand.get(0).getRank() == currentHand.get(1).getRank()){
              if(currentHand.get(2).getRank() == currentHand.get(3).getRank()
                  &amp;&amp; currentHand.get(3).getRank() == currentHand.get(4).getRank()){
                  return true;
              }
  
          }
          return false;
      }
      private boolean threeOfKind(){
          if ((currentHand.get(0).getRank() == currentHand.get(1).getRank()
                  &amp;&amp; currentHand.get(1).getRank() == currentHand.get(2).getRank())
                  || (currentHand.get(1).getRank() == currentHand.get(2).getRank()
                  &amp;&amp; currentHand.get(2).getRank() == currentHand.get(3).getRank())
                  || (currentHand.get(2).getRank() == currentHand.get(3).getRank()
                  &amp;&amp; currentHand.get(3).getRank() == currentHand.get(4).getRank())){
          return true;
          }
          return false;
      }
      private boolean twoPair() {
          if (currentHand.get(0).getRank() == currentHand.get(1).getRank()
                  &amp;&amp; currentHand.get(2).getRank() == currentHand.get(3).getRank()){
              return true;
          }
  
  
              else if((currentHand.get(1).getRank() == currentHand.get(2).getRank())&amp;&amp;
              (currentHand.get(3).getRank() == currentHand.get(4).getRank())){
                  return true;
              }
  
             else if((currentHand.get(0).getRank() == currentHand.get(1).getRank())&amp;&amp;
              (currentHand.get(3).getRank() == currentHand.get(4).getRank())){
                  return true;
              }else
  
          return false;
      }
      private boolean jackOrBetter() {
          for (int i = 11; i &lt;= 14; i++) {
              int comp;
              if (i == 14)
                  comp =1;
              else comp = i;
              for (int j = 0; j &lt; 4; j++) {
                  if (currentHand.get(j).getRank() ==comp ) {
                      if (currentHand.get(j).getRank() == currentHand.get(j + 1).getRank()) {
                          return true;
                      }
                  }
              }
          }
          return false;
  </code></pre>