code: public static <T> boolean retainAll(Collection<T> self, @ClosureParams(FirstParam.FirstGenericType.class) Closure condition) {
          Iterator iter = InvokerHelper.asIterator(self);
          BooleanClosureWrapper bcw = new BooleanClosureWrapper(condition);
          boolean result = false;
          while (iter.hasNext()) {
              Object value = iter.next();
              if (!bcw.call(value)) {
                  iter.remove();
                  result = true;
              }
          }
          return result;
      }
docs: Modifies this collection so that it retains only its elements
  that are matched according to the specified closure condition.  In other words,
  removes from this collection all of its elements that don't match.
  
  <pre class="groovyTestCase">def list = ['a', 'b']
  list.retainAll { it == 'b' }
  assert list == ['b']</pre>
  
  See also <code>findAll</code> and <code>grep</code> when wanting to produce a new list
  containing items which match some criteria but leaving the original collection unchanged.
  
  @param  self      a Collection to be modified
  @param  condition a closure condition
  @return <tt>true</tt> if this collection changed as a result of the call
  @see    Iterator#remove()
  @since 1.7.2