title: UnsupportedOperationException when using iterator.remove()
body: <p>I'm trying to remove some elements from a <code>List</code>, but even the simplest examples, as the ones in <a href="https://stackoverflow.com/a/17279584/4408343">this answer</a> or <a href="https://stackoverflow.com/a/17279578/4408343">this</a>, won't work.</p>
  
  <pre><code>public static void main(String[] args)
  {
      List&lt;String&gt; list = Arrays.asList("1", "2", "3", "4");
      for (Iterator&lt;String&gt; iter = list.listIterator(); iter.hasNext();)
      {
          String a = iter.next();
          if (true)
          {
              iter.remove();
          }
      }
  }
  
  Exception in thread "main" java.lang.UnsupportedOperationException
      at java.util.AbstractList.remove(Unknown Source)
      at java.util.AbstractList$Itr.remove(Unknown Source)
  </code></pre>
  
  <p>Using a normal <code>Iterator</code> instead of a <code>ListIterator</code> doesn't help.
  What am I missing? I'm using java 7.</p>