code: public static <T> List<T> grep(List<T> self, Object filter) {
          return (List<T>) grep((Collection<T>) self, filter);
      }
docs: Iterates over the collection of items and returns each item that matches
  the given filter - calling the <code>{@link #isCase(java.lang.Object, java.lang.Object)}</code>
  method used by switch statements.  This method can be used with different
  kinds of filters like regular expressions, classes, ranges etc.
  Example:
  <pre class="groovyTestCase">
  def list = ['a', 'b', 'aa', 'bc', 3, 4.5]
  assert list.grep( ~/a+/ )  == ['a', 'aa']
  assert list.grep( ~/../ )  == ['aa', 'bc']
  assert list.grep( Number ) == [ 3, 4.5 ]
  assert list.grep{ it.toString().size() == 1 } == [ 'a', 'b', 3 ]
  </pre>
  
  @param self   a List
  @param filter the filter to perform on each element of the collection (using the {@link #isCase(java.lang.Object, java.lang.Object)} method)
  @return a List of objects which match the filter
  @since 2.4.0