title: Removing first case insensitive duplicate of an ArrayList
body: <p>I have an arraylist containing some strings: </p>
  
  <pre><code>ArrayList&lt;String&gt; strList = new ArrayList&lt;String&gt;();
  strList.addAll(Arrays.asList("interface", "list", "Primitive", "class", "primitive", "List", "Interface", "lIst", "Primitive"));
  </code></pre>
  
  <p>I have wrote a method to remove the case insensitive strings of the arraylist:</p>
  
  <pre><code>public static ArrayList&lt;String&gt; removeDuplicates(ArrayList&lt;String&gt; strList) {
  
      for(int i = 0; i &lt; strList.size(); i++) {
          for(int j = i + 1; j &lt; strList.size(); j++) {
              if(strList.get(i).equalsIgnoreCase(strList.get(j))){
                  strList.remove(j);
                  j--;
              }
          }
      }
      return strList;   
  }
  </code></pre>
  
  <p>Ouput:</p>
  
  <pre><code>[interface, list, Primitive, class]
  </code></pre>
  
  <p>However, I am trying to remove just the first occurance of the strings. I am trying to make it so my output would equal:</p>
  
  <pre><code>[Interface, lIst, Primitive, class]
  </code></pre>
  
  <p>Which would be the last occurrences of the duplicates in the arraylist</p>
  
  <p>What I'm trying to do specifically:</p>
  
  <blockquote>
    <p>The version of the string that remains is the same as the last occurrence. In other words, the
    version of the last occurrence stays at the location of the first occurrence</p>
  </blockquote>