title: @SuppressWarnings ArrayList<X> may not contain objects of type Y
body: <p>I have a class called <code>CompressedCardInfo</code> that has an <code>MtgCard</code> as a member of it, and <code>CompressedCardInfo</code>'s (or classes extending it) have overloaded the equals method to take into account checking if a <code>CompressedCardInfo</code> equals an <code>MtgCard</code>.</p>
  
  <p>Now this isn't extremely important, as they are only warnings (they bother me however), but when I have <code>CompressedCardInfo</code> in an ArrayList and call <code>ArrayList.contains</code> or <code>.indexOf</code> I get the warning telling me that the list might not have objects of type <code>MtgCard</code> in it.</p>
  
  <p>How do I suppress this specific warning about this List? Or is there a better way of handling that kind of comparison?</p>
  
  <p>Thanks.</p>
  
  <pre><code>for (Pair&lt;MtgCard, Boolean&gt; card : decklist) {
              /* Translate the set code to TCG name of course it's not saved */
              card.first.setName = CardDbAdapter.getSetNameFromCode(card.first.setCode, database);
              if (changedCardName == null || changedCardName.equals(card.first.mName)) {
                  if (mCompressedDecklist.contains(card.first)) {
                      CompressedDecklistInfo existingCard = mCompressedDecklist.get(mCompressedDecklist.indexOf(card.first));
                      if (existingCard.mIsSideboard == card.second) {
                          mCompressedDecklist.get(mCompressedDecklist.indexOf(card.first)).add(card.first);
                      } else {
                          mCompressedDecklist.add(new CompressedDecklistInfo(card.first, card.second));
                      }
                  } else {
                      mCompressedDecklist.add(new CompressedDecklistInfo(card.first, card.second));
                  }
                  if (mShowTotalDecklistPrice) {
                      loadPrice(card.first.mName, card.first.setCode, card.first.mNumber);
                  }
              }
          }
  </code></pre>
  
  <p>The calls on lines 5 (contains), 6 (indexOf), and 8 (indexOf). I get warnings there because the ArrayList is of type <code>CompressedDecklistInfo</code> (which is extended from <code>CompressedCardInfo</code>. This also happens in other places.</p>