title: Double nested for loop iteration (ArrayList)
body: <p>I have a system that involves loading 'PlayerValue' Objects. The objects are formatted as such: [Header] value. I have these saved in a text file and whenever I save or read from the file, I want to remove duplicate headers. So I did this:</p>
  
  <p>first, I load all of the PlayerValues from the file into an ArrayList called 'array', then:</p>
  
  <pre><code>for (PlayerValue v : array) {
              for (PlayerValue v1 : array) {
                  if (v1.header.equals(v.header)) {
                      array.remove(v1);
                  }
              }
          }
  </code></pre>
  
  <p>Here you can see, it goes through each item of the array, then for each item, it searches the array again for the same header.</p>
  
  <p>This would effectively remove duplicate headers, except for the fact that it throws a ConcurrentModificationException.</p>
  
  <p>Any help for a work around?</p>