title: How would I check if all elements in an array are present in another array with no duplicates?
body: <p>Run into abit of trouple with my code, want to check if sharedMemory is present in entire deck(it is) and have no duplicates of an object. I am getting false with this code and I don't really know why, any help would be appreciated. rank and suit together form a card object. rank and card are enumerators with values. Note: when i use 'return Arrays.asList(entireDeck).containsAll(sharedMemory)' on its own it does show true, but the messy if part is trying to check for duplicates</p>
  <pre><code> public static boolean isFull(){
          Card[] entireDeck = Deck.fillDeck();
          sharedMemory =Arrays.asList(Deck.fillDeck());
          int i=0,duplicates=0, position =0, original;
          for(Card c:entireDeck){
              Card f = new Card(c.rank, c.suit);
              original=i;
              if (f.rank.equals(sharedMemory.get(i).rank)&amp;&amp;f.suit.equals(sharedMemory.get(i).suit)){
                  duplicates+=1;
                  position=i;
                  for(i=0; i&lt;position;i++) {
                      if (f.rank.equals(sharedMemory.get(i).rank)&amp;&amp;f.suit.equals(sharedMemory.get(i).suit)) 
                 {
                          duplicates += 1;
                          return false;
                      }
                  }
                  for (i=position+1; i&lt;52; i++){
                      if (f.rank.equals(sharedMemory.get(i).rank)&amp;&amp;f.suit.equals(sharedMemory.get(i).suit)) 
                {
                          duplicates += 1;
                          return false;
                      }
                  }
                  if(duplicates&gt;1){
                      return false;
                  }
                  else{
                      i=original;
                  }
  
              }
              i=original;
              i++;
          }
          return Arrays.asList(entireDeck).containsAll(sharedMemory);
      }
  </code></pre>
  <p>Thanks :)</p>