title: Cannot convert ArrayList<String> to ArrayList<java.lang.String>
body: <p>I have an odd (in my mind) problem. I am currently making a Custom JComboBoxModel for some custom functionality I need from a Custom Renderer I am not yet certain how to deal with, I will post regarding that later.</p>
  
  <p>Regardless, as the Title suggested I am getting some Type errors.</p>
  
  <p>Here is the classes (current) code:</p>
  
  <pre><code>package miscclasses;
  import java.util.ArrayList;
  import javax.swing.AbstractListModel;
  
  public class CustomComboBoxModel&lt;String&gt; extends AbstractListModel&lt;String&gt; {
      /**
       * Contains a list of row indexes that shouldn't be displayed.
       */
      private ArrayList&lt;String&gt; alreadySelectedIndexes;
      /**
       * The comboBoxes selected index.
       */
      private int selectedIndex=-1;
      /**
       * Contains a list of values in this model.
       */
      private ArrayList&lt;String&gt; vals;
      /**
       * Creates an empty CustomComboBoxModel.
       */
      public CustomComboBoxModel() {
          this.alreadySelectedIndexes=new ArrayList&lt;&gt;();
          this.vals = new ArrayList&lt;&gt;();
      }
      /**Creates a CustomComboBoxModel with the values passed in.
       * 
       * @param values the row values.
       */
      public CustomComboBoxModel(ArrayList&lt;String&gt; values) {
          this();
          this.vals.addAll(values);
      }
  
      public CustomComboBoxModel(ArrayList&lt;String&gt; values, ArrayList&lt;String&gt; alreadySelected) {
          this(values);
          this.alreadySelectedIndexes.addAll(alreadySelected);
      }
  
      public CustomComboBoxModel(ArrayList&lt;String&gt; values, ArrayList&lt;String&gt; alreadySelected, int selectedIndex) {
          this(values, alreadySelected);
          this.selectedIndex=selectedIndex;
      }
  
      public CustomComboBoxModel(ArrayList&lt;String&gt; values, ArrayList&lt;String&gt; alreadySelected, String selectedValue) {
          this(values, alreadySelected);
          if(!this.vals.isEmpty()) {
              //this.selectedIndex = Misc.containsI(this.vals, selectedValue);
          }
      }
  
      @Override
      public int getSize() {
          return this.vals.size();
      }
  
      @Override
      public String getElementAt(int i) {
          return this.vals.get(i);
      }
  
      public boolean isRowSelected(int i) {
          return ((!this.alreadySelectedIndexes.contains(Integer.toString(i)))?false:true);
      }
  }
  </code></pre>
  
  <p>The error I am receiving is on line 55 where I attempt to get the selected values index. This is the commented line in the constructor that accepts two ArrayList lists and a String value. The error states that there is "no suitable method for containsI(java.util.ArrayList,String) method miscclasses.Misc.containsI(java.util.ArrayList, java.lang.String) is not applicable".</p>
  
  <p>So far as I know String and java.lang.String are the exact same thing. As such I cannot seem to figure out what could cause this issue, and thought I would come to ask those more knowledgeable in the ways of Code-fu than I.</p>
  
  <p>For reference, the Misc.containsI(ArrayList,String) code is here:</p>
  
  <pre><code> /**
   * Finds the index of value Target. Returns -1 if this ArrayList doesn't contain Target.
   * @param a         ArrayList of Strings a.
   * @param target    Value to find.
   * @return          Index of target if found; Else returns -1.
   */
  public static int containsI(ArrayList&lt;String&gt; a, String target) {
      for (int i = 0; i &lt; a.size(); i++)
      {
          if(a.get(i).equalsIgnoreCase(target))
              return i;
      }
      return -1;
  }
  </code></pre>
  
  <p>I am also strangely receiving the following warning in my isRowSelected(int i) function:
  "Suspcious call to java.util.Collection.contains: Expected type String, actual type String". </p>
  
  <p>Again, I don't understand why I am getting warning. It seems to be entirely valid code, and I have done similar before. Any help with this odd warning and error, would be much appreciated.</p>
  
  <p>EDIT: Changing the Declaration so it reads:</p>
  
  <pre><code>public class CustomComboBoxModel extends AbstractListModel&lt;String&gt;
  </code></pre>
  
  <p>instead of:</p>
  
  <pre><code>public class CustomComboBoxModel&lt;String&gt; extends AbstractListModel&lt;String&gt;
  </code></pre>
  
  <p>Appears to have gotten rid of the warning and error. I do not understand why however, as I have a Custom JList mode declared as such:</p>
  
  <pre><code>public class CustomListModel&lt;String&gt; extends javax.swing.DefaultListModel&lt;String&gt;
  </code></pre>
  
  <p>In the same package with no errors.</p>