title: Java Commons Collections removeAll
body: <p><a href="http://commons.apache.org/collections/apidocs/org/apache/commons/collections/CollectionUtils.html#removeAll%28java.util.Collection,%20java.util.Collection%29" rel="noreferrer">CollectionUtils::removeAll() Commons Collections 3.2.1</a></p>
  
  <p>I must be going crazy, becuase it seems like this method is doing the inverse of what the docs state:</p>
  
  <blockquote>
    <p>Removes the elements in remove from collection. That is, this method returns a collection containing all the elements in c that are not in remove. </p>
  </blockquote>
  
  <p>This little JUnit test</p>
  
  <pre><code>@Test
  public void testCommonsRemoveAll() throws Exception {
      String str1 = "foo";
      String str2 = "bar";
      String str3 = "qux";
  
      List&lt;String&gt; collection = Arrays.asList(str1, str2, str3);
      System.out.println("collection: " + collection);
  
      List&lt;String&gt; remove = Arrays.asList(str1);
      System.out.println("remove: " + remove);
  
      Collection result = CollectionUtils.removeAll(collection, remove);
      System.out.println("result: " + result);
      assertEquals(2, result.size());
  }
  </code></pre>
  
  <p>Is failing with </p>
  
  <blockquote>
    <p>java.lang.AssertionError: expected:&lt;2> but was:&lt;1></p>
  </blockquote>
  
  <p>and prints</p>
  
  <pre><code>collection: [foo, bar, qux] 
  remove: [foo] 
  result: [foo]
  </code></pre>
  
  <p>From my reading of the docs I should expect <code>[bar, qux]</code>. What have I missed?</p>