DefaultGroovyMethods (Groovy 5.1.0)

Package: org.codehaus.groovy.runtime

## [Java] Class DefaultGroovyMethods

- org.codehaus.groovy.runtime.DefaultGroovyMethods

-     public class DefaultGroovyMethods
      extends DefaultGroovyMethodsSupport

  Defines new groovy methods which appear on classes inside the Groovy environment. Static methods are used with the first parameter being the destination class, i.e. `public static String reverse(String self)` provides a `reverse()` method for `String`.

  NOTE: While this class contains many 'public' static methods, it is primarily regarded as an internal class (its internal package name suggests this also). We value backwards compatibility of these methods when used within Groovy but value less backwards compatibility at the Java method call level. I.e. future versions of Groovy may remove or move a method call in this file but would normally aim to keep the method available from within Groovy.

- - ### Field Summary

    Fields
    Modifiers | Name | Description
    --- | --- | ---
    `static Class[]` | `ADDITIONAL_CLASSES` |
    `static Class[]` | `DGM_LIKE_CLASSES` |

  - ### Methods Summary

    Methods
    Type Params | Return Type | Name and description
    --- | --- | ---
    `` | `public static int` | `abs(Number number)` Gets the absolute value.
    `` | `public static long` | `abs(Long number)` Gets the absolute value.
    `` | `public static float` | `abs(Float number)` Gets the absolute value.
    `` | `public static double` | `abs(Double number)` Gets the absolute value.
    `<T>` | `public static boolean` | `addAll(Collection<T> self, Iterator<? extends T> items)` Adds all items from the iterator to the Collection.
    `<T>` | `public static boolean` | `addAll(Collection<T> self, Iterable<? extends T> items)` Adds all items from the iterable to the Collection.
    `<T>` | `public static boolean` | `addAll(Collection<T> self, T[] items)` Modifies the collection by adding all the elements in the specified array to the collection.
    `<T>` | `public static boolean` | `addAll(List<T> self, int index, T[] items)` Modifies this list by inserting all the elements in the specified array into the list at the specified position.
    `` | `public static void` | `addShutdownHook(Object self, Closure closure)` Allows the usage of addShutdownHook without getting the runtime first.
    `` | `public static Number` | `and(Number left, Number right)` Bitwise AND together two Numbers.
    `` | `public static BitSet` | `and(BitSet left, BitSet right)` Bitwise AND together two BitSets.
    `` | `public static Boolean` | `and(Boolean left, Boolean right)` Logical conjunction of two boolean operators.
    `<T>` | `public static Set<T>` | `and(Set<T> left, Iterable<T> right)` Creates a Set composed of the intersection of a Set and an Iterable.
    `<T>` | `public static Set<T>` | `and(Set<T> left, Iterable<T> right, Comparator<? super T> comparator)` Creates a Set composed of the intersection of a Set and an Iterable.
    `<T>` | `public static SortedSet<T>` | `and(SortedSet<T> left, Iterable<T> right)` Creates a SortedSet composed of the intersection of a SortedSet and an Iterable.
    `<T>` | `public static SortedSet<T>` | `and(SortedSet<T> left, Iterable<T> right, Comparator<? super T> comparator)` Creates a SortedSet composed of the intersection of a SortedSet and an Iterable.
    `` | `public static boolean` | `any(Object self)` Iterates over the elements of a collection, and checks whether at least one element is true according to the Groovy Truth.
    `` | `public static boolean` | `any(Object self, Closure predicate)` Iterates over the contents of an object or collection, and checks whether a predicate is valid for at least one element.
    `<T>` | `public static boolean` | `any(Iterator<T> self, Closure predicate)` Iterates over the contents of an iterator, and checks whether a predicate is valid for at least one element.
    `<T>` | `public static boolean` | `any(Iterable<T> self, Closure predicate)` Iterates over the contents of an iterable, and checks whether a predicate is valid for at least one element.
    `<K, V>` | `public static boolean` | `any(Map<K, V> self, Closure<?> predicate)` Iterates over the entries of a map, and checks whether a predicate is valid for at least one entry.
    `<T>` | `public static boolean` | `any(T[] self, Closure predicate)`
    `` | `public static boolean` | `asBoolean(Object object)` Coerce an object instance to a boolean value.
    `` | `public static boolean` | `asBoolean(Boolean bool)` Coerce a Boolean instance to a boolean value.
    `` | `public static boolean` | `asBoolean(AtomicBoolean bool)` Coerce an AtomicBoolean instance to a boolean value.
    `` | `public static boolean` | `asBoolean(Collection collection)` Coerce a collection instance to a boolean value.
    `` | `public static boolean` | `asBoolean(Map map)` Coerce a map instance to a boolean value.
    `` | `public static boolean` | `asBoolean(Iterator iterator)` Coerce an iterator instance to a boolean value.
    `` | `public static boolean` | `asBoolean(Enumeration enumeration)` Coerce an enumeration instance to a boolean value.
    `` | `public static boolean` | `asBoolean(Character character)` Coerce a character to a boolean value.
    `` | `public static boolean` | `asBoolean(Float object)` Coerce a Float instance to a boolean value.
    `` | `public static boolean` | `asBoolean(Double object)` Coerce a Double instance to a boolean value.
    `` | `public static boolean` | `asBoolean(Number number)` Coerce a number to a boolean value.
    `` | `public static boolean` | `asBoolean(boolean[] self)`
    `` | `public static boolean` | `asBoolean(byte[] self)`
    `` | `public static boolean` | `asBoolean(char[] self)`
    `` | `public static boolean` | `asBoolean(short[] self)`
    `` | `public static boolean` | `asBoolean(int[] self)`
    `` | `public static boolean` | `asBoolean(long[] self)`
    `` | `public static boolean` | `asBoolean(float[] self)`
    `` | `public static boolean` | `asBoolean(double[] self)`
    `` | `public static boolean` | `asBoolean(Object[] self)`
    `<T>` | `public static List<T>` | `asChecked(List<T> self, Class<T> type)` Creates a checked view of a List.
    `<T>` | `public static Queue<T>` | `asChecked(Queue<T> self, Class<T> type)` Creates a checked view of a Queue.
    `<T>` | `public static Collection<T>` | `asChecked(Collection<T> self, Class<T> type)` Creates a checked view of a Collection.
    `<T>` | `public static Set<T>` | `asChecked(Set<T> self, Class<T> type)` Creates a checked view of a Set.
    `<T>` | `public static SortedSet<T>` | `asChecked(SortedSet<T> self, Class<T> type)` Creates a checked view of a SortedSet.
    `<T>` | `public static NavigableSet<T>` | `asChecked(NavigableSet<T> self, Class<T> type)` Creates a checked view of a NavigableSet.
    `<K, V>` | `public static Map<K, V>` | `asChecked(Map<K, V> self, Class<K> keyType, Class<V> valueType)` Creates a checked view of a Map.
    `<K, V>` | `public static SortedMap<K, V>` | `asChecked(SortedMap<K, V> self, Class<K> keyType, Class<V> valueType)` Creates a checked view of a SortedMap.
    `<K, V>` | `public static NavigableMap<K, V>` | `asChecked(NavigableMap<K, V> self, Class<K> keyType, Class<V> valueType)` Creates a checked view of a NavigableMap.
    `<T>` | `public static Collection<T>` | `asCollection(Iterable<T> self)` Converts this Iterable to a Collection.
    `<K, V>` | `public static Map<K, V>` | `asImmutable(Map<K, V> self)` A convenience method for creating an immutable Map.
    `<K, V>` | `public static SortedMap<K, V>` | `asImmutable(SortedMap<K, V> self)` A convenience method for creating an immutable SortedMap.
    `<T>` | `public static List<T>` | `asImmutable(List<T> self)` A convenience method for creating an immutable List.
    `<T>` | `public static Set<T>` | `asImmutable(Set<T> self)` A convenience method for creating an immutable Set.
    `<T>` | `public static SortedSet<T>` | `asImmutable(SortedSet<T> self)` A convenience method for creating an immutable SortedSet.
    `<T>` | `public static Collection<T>` | `asImmutable(Collection<T> self)` A convenience method for creating an immutable Collection.
    `<T>` | `public static List<T>` | `asList(Iterable<T> self)` Converts this Iterable to a List.
    `<T>` | `public static List<T>` | `asReversed(List<T> self)` Creates a view list with reversed order, and the order of original list will not change.
    `<T>` | `public static NavigableSet<T>` | `asReversed(NavigableSet<T> self)` Creates a reverse order view of the set.
    `` | `public static String` | `asString(Throwable self)` Get the detail information of Throwable instance's stack trace
    `<K, V>` | `public static Map<K, V>` | `asSynchronized(Map<K, V> self)` Creates a synchronized view of a Map.
    `<K, V>` | `public static SortedMap<K, V>` | `asSynchronized(SortedMap<K, V> self)` Creates a synchronized view of a SortedMap.
    `<K, V>` | `public static NavigableMap<K, V>` | `asSynchronized(NavigableMap<K, V> self)` Creates a synchronized view of a NavigableMap.
    `<T>` | `public static Collection<T>` | `asSynchronized(Collection<T> self)` Creates a synchronized view of a Collection.
    `<T>` | `public static List<T>` | `asSynchronized(List<T> self)` Creates a synchronized view of a List.
    `<T>` | `public static Set<T>` | `asSynchronized(Set<T> self)` Creates a synchronized view of a Set.
    `<T>` | `public static SortedSet<T>` | `asSynchronized(SortedSet<T> self)` Creates a synchronized view of a SortedSet.
    `<T>` | `public static NavigableSet<T>` | `asSynchronized(NavigableSet<T> self)` Creates a synchronized view of a NavigableSet.
    `<T>` | `public static T` | `asType(Iterable iterable, Class<T> clazz)` Converts the given iterable to another type.
    `<T>` | `public static T` | `asType(Collection col, Class<T> clazz)` Converts the given collection to another type.
    `<T>` | `public static T` | `asType(Closure impl, Class<T> type)` Coerces the closure to an implementation of the given class.
    `<T>` | `public static T` | `asType(Map map, Class<T> clazz)` Coerces this map to the given type, using the map's keys as the public method names, and values as the implementation.
    `<T>` | `public static T` | `asType(Number self, Class<T> type)` Transform this number to the given type, using the 'as' operator.
    `<T>` | `public static T` | `asType(Object obj, Class<T> type)` Converts a given object to a type.
    `<T>` | `public static T` | `asType(Object[] self, Class<T> type)`
    `<K, V>` | `public static Map<K, V>` | `asUnmodifiable(Map<K, V> self)` Creates an unmodifiable view of a Map.
    `<K, V>` | `public static SortedMap<K, V>` | `asUnmodifiable(SortedMap<K, V> self)` Creates an unmodifiable view of a SortedMap.
    `<K, V>` | `public static SortedMap<K, V>` | `asUnmodifiable(NavigableMap<K, V> self)` Creates an unmodifiable view of a NavigableMap.
    `<T>` | `public static List<T>` | `asUnmodifiable(List<T> self)` Creates an unmodifiable view of a List.
    `<T>` | `public static Set<T>` | `asUnmodifiable(Set<T> self)` Creates an unmodifiable view of a Set.
    `<T>` | `public static SortedSet<T>` | `asUnmodifiable(SortedSet<T> self)` Creates an unmodifiable view of a SortedSet.
    `<T>` | `public static NavigableSet<T>` | `asUnmodifiable(NavigableSet<T> self)` Creates an unmodifiable view of a NavigableSet.
    `<T>` | `public static Collection<T>` | `asUnmodifiable(Collection<T> self)` Creates an unmodifiable view of a Collection.
    `` | `public static Object` | `average(Iterable<?> self)` Averages the items in an Iterable.
    `` | `public static Object` | `average(Iterator<?> self)` Averages the items from an Iterator.
    `<T>` | `public static Object` | `average(Iterable<T> self, Closure closure)` Averages the result of applying a closure to each item of an Iterable.
    `<T>` | `public static Object` | `average(Iterator<T> self, Closure closure)` Averages the result of applying a closure to each item returned from an iterator.
    `` | `public static BigDecimal` | `average(byte[] self)`
    `` | `public static BigDecimal` | `average(short[] self)`
    `` | `public static BigDecimal` | `average(int[] self)`
    `` | `public static BigDecimal` | `average(long[] self)`
    `` | `public static double` | `average(float[] self)`
    `` | `public static double` | `average(double[] self)`
    `` | `public static Object` | `average(Object[] self)`
    `<T>` | `public static Object` | `average(T[] self, Closure closure)`
    `` | `public static BitSet` | `bitwiseNegate(BitSet self)` Bitwise NEGATE a BitSet.
    `` | `public static Number` | `bitwiseNegate(Number left)` Bitwise NEGATE a Number.
    `<T>` | `public static BufferedIterator<T>` | `buffered(Iterator<T> self)` Returns a `BufferedIterator` that allows examining the next element without consuming it.
    `<T>` | `public static BufferedIterator<T>` | `bufferedIterator(Iterable<T> self)` Returns a `BufferedIterator` that allows examining the next element without consuming it.
    `<T>` | `public static BufferedIterator<T>` | `bufferedIterator(List<T> self)` Returns a `BufferedIterator` that allows examining the next element without consuming it.
    `<T>` | `protected static T` | `callClosureForLine(Closure<T> closure, String line, int counter)`
    `<T, K, V>` | `protected static T` | `callClosureForMapEntry(Closure<T> closure, Map.Entry<K, V> entry)`
    `<T, K, V>` | `protected static T` | `callClosureForMapEntryAndCounter(Closure<T> closure, Map.Entry<K, V> entry, int counter)`
    `<T>` | `public static List<List<T>>` | `chop(Iterable<T> self, int chopSizes)` Chops the Iterable into pieces, returning lists with sizes corresponding to the supplied chop sizes.
    `<T>` | `public static List<List<T>>` | `chop(Iterable<T> self, boolean returnEarly, int chopSizes)` Chops the Iterable into pieces, returning lists with sizes corresponding to the supplied chop sizes.
    `<T>` | `public static Iterator<List<T>>` | `chop(Iterator<T> self, int chopSizes)` Chops the iterator items into pieces, returning lists with sizes corresponding to the supplied chop sizes.
    `<T>` | `public static Iterator<List<T>>` | `chop(Iterator<T> self, boolean returnEarly, int chopSizes)` Chops the source iterator elements into pieces, returning lists with sizes corresponding to the supplied chop sizes.
    `<T>` | `public static Iterator<List<T>>` | `chop(Iterator<T> self, Iterator<Integer> chopSizes)` Chops the source iterator elements into pieces, returning lists with sizes corresponding to the supplied chop sizes.
    `<T>` | `public static Iterator<List<T>>` | `chop(Iterator<T> self, boolean returnEarly, Iterator<Integer> chopSizes)` Chops the source iterator elements into pieces, returning lists with sizes corresponding to the supplied chop sizes.
    `<T>` | `public static List<List<T>>` | `chop(T[] self, int chopSizes)`
    `<T>` | `public static List<List<T>>` | `chop$$bridge(Iterator<T> self, int chopSizes)` Chops the iterator items into pieces, returning lists with sizes corresponding to the supplied chop sizes.
    `<T>` | `public static List<List<T>>` | `collate(Iterable<T> self, int size)` Collates this iterable into sub-lists of length `size`.
    `<T>` | `public static List<List<T>>` | `collate(Iterable<T> self, int size, int step)` Collates this iterable into sub-lists of length `size` stepping through the code `step` elements for each subList.
    `<T>` | `public static List<List<T>>` | `collate(Iterable<T> self, int size, boolean keepRemainder)` Collates this iterable into sub-lists of length `size`.
    `<T>` | `public static List<List<T>>` | `collate(Iterable<T> self, int size, int step, boolean keepRemainder)` Collates this iterable into sub-lists of length `size` stepping through the code `step` elements for each sub-list.
    `<T>` | `public static Iterator<List<T>>` | `collate(Iterator<T> self, int size, int step, boolean keepRemainder)` Collates this iterator into sub-lists of length `size` stepping through the code `step` elements for each sub-list.
    `<T>` | `public static Iterator<List<T>>` | `collate(Iterator<T> self, int size, int step)` Collates this iterator into sub-lists of length `size` stepping through the code `step` elements for each sub-list including any remaining elements as the last sub-list.
    `<T>` | `public static Iterator<List<T>>` | `collate(Iterator<T> self, int size, boolean keepRemainder)` Collates this iterator into sub-lists of length `size`.
    `<T>` | `public static Iterator<List<T>>` | `collate(Iterator<T> self, int size)` Collates this iterator into sub-lists of length `size` including any remaining elements as the last sub-list.
    `<T>` | `public static List<List<T>>` | `collate(T[] self, int size)`
    `<T>` | `public static List<List<T>>` | `collate(T[] self, int size, int step)`
    `<T>` | `public static List<List<T>>` | `collate(T[] self, int size, boolean keepRemainder)`
    `<T>` | `public static List<List<T>>` | `collate(T[] self, int size, int step, boolean keepRemainder)`
    `` | `public static Collection` | `collect(Object self)` Iterates through this aggregate Object transforming each item into a new value using Closure.IDENTITY as a transformer, basically returning a list of items copied from the original object.
    `<T>` | `public static List<T>` | `collect(Object self, Closure<T> transform)` Iterates through this aggregate Object transforming each item into a new value using the `transform` closure, returning a list of transformed values.
    `<T, C extends Collection<T>>` | `public static C` | `collect(Object self, C collector, Closure<? extends T> transform)` Iterates through this aggregate Object transforming each item into a new value using the `transform` closure and adding it to the supplied `collector`.
    `<E, T>` | `public static List<T>` | `collect(Iterator<E> self, Closure<T> transform)` Iterates through this Iterator transforming each item into a new value using the `transform` closure, returning a list of transformed values.
    `<E, T, C extends Collection<T>>` | `public static C` | `collect(Iterator<E> self, C collector, Closure<? extends T> transform)` Iterates through this Iterator transforming each item into a new value using the `transform` closure and adding it to the supplied `collector`.
    `<T>` | `public static List<T>` | `collect(Iterator<T> self)` Convert an iterator to a List.
    `<T>` | `public static List<T>` | `collect(Iterable<T> self)` Iterates through this collection transforming each entry into a new value using Closure.IDENTITY as a transformer, basically returning a list of items copied from the original collection.
    `<E, T>` | `public static List<T>` | `collect(Iterable<E> self, Closure<T> transform)` Iterates through this Iterable transforming each entry into a new value using the `transform` closure returning a list of transformed values.
    `<E, T, C extends Collection<T>>` | `public static C` | `collect(Iterable<E> self, C collector, Closure<? extends T> transform)` Iterates through this collection transforming each value into a new value using the `transform` closure and adding it to the supplied `collector`.
    `<T, K, V, C extends Collection<T>>` | `public static C` | `collect(Map<K, V> self, C collector, Closure<? extends T> transform)` Iterates through this Map transforming each map entry into a new value using the `transform` closure returning the `collector` with all transformed values added to it.
    `<T, K, V>` | `public static List<T>` | `collect(Map<K, V> self, Closure<T> transform)` Iterates through this Map transforming each map entry into a new value using the `transform` closure returning a list of transformed values.
    `<E, T>` | `public static List<T>` | `collect(E[] self, Closure<T> transform)`
    `<E, T, C extends Collection<T>>` | `public static C` | `collect(E[] self, C collector, Closure<? extends T> transform)`
    `<K, V, X, Y>` | `public static Map<K, V>` | `collectEntries(Map<X, Y> self, Map<K, V> collector, Closure<?> transform)` Iterates through this Map transforming each map entry using the `transform` closure returning a map of the transformed entries.
    `<K, V, X, Y>` | `public static Map<K, V>` | `collectEntries(Map<X, Y> self, Closure<?> transform)` Iterates through this Map transforming each entry using the `transform` closure and returning a map of the transformed entries.
    `<K, V, E>` | `public static Map<K, V>` | `collectEntries(Iterator<E> self, Closure<?> transform)` A variant of collectEntries for Iterators.
    `<K, V, E>` | `public static Map<K, V>` | `collectEntries(Iterable<E> self, Closure<?> transform)` Iterates through this Iterable transforming each item using the `transform` closure and returning a map of the resulting transformed entries.
    `<K, V>` | `public static Map<K, V>` | `collectEntries(Iterator<?> self)` A variant of collectEntries for Iterators using the identity closure as the transform.
    `<K, V>` | `public static Map<K, V>` | `collectEntries(Iterable<?> self)` A variant of collectEntries for Iterable objects using the identity closure as the transform.
    `<K, V, E>` | `public static Map<K, V>` | `collectEntries(Iterator<E> self, Map<K, V> collector, Closure<?> transform)` A variant of collectEntries for Iterators using a supplied map as the destination of transformed entries.
    `<K, V, E>` | `public static Map<K, V>` | `collectEntries(Iterator<E> self, Map<K, V> collector, Function<? super E, K> keyTransform, Function<? super E, V> valueTransform)` A variant of collectEntries for Iterators with separate functions for transforming the keys and values.
    `<K, V, E>` | `public static Map<K, V>` | `collectEntries(Iterator<E> self, Function<? super E, K> keyTransform, Function<? super E, V> valueTransform)` A variant of collectEntries for Iterators with separate functions for transforming the keys and values.
    `<K, V, E>` | `public static Map<K, V>` | `collectEntries(Iterable<E> self, Map<K, V> collector, Function<? super E, K> keyTransform, Function<? super E, V> valueTransform)` A variant of collectEntries for Iterables with separate functions for transforming the keys and values.
    `<K, V, E>` | `public static Map<K, V>` | `collectEntries(Iterable<E> self, Function<? super E, K> keyTransform, Function<? super E, V> valueTransform)` A variant of collectEntries for Iterables with separate functions for transforming the keys and values.
    `<K, V, X, Y>` | `public static Map<K, V>` | `collectEntries(Map<X, Y> self, Map<K, V> collector, Function<? super X, K> keyTransform, Function<? super Y, V> valueTransform)` A variant of collectEntries for Maps with separate functions for transforming the keys and values.
    `<K, V, X, Y>` | `public static Map<K, V>` | `collectEntries(Map<X, Y> self, Function<? super X, K> keyTransform, Function<? super Y, V> valueTransform)` A variant of collectEntries for Maps with separate functions for transforming the keys and values.
    `<K, V, E>` | `public static Map<K, V>` | `collectEntries(Iterable<E> self, Map<K, V> collector, Closure<?> transform)` Iterates through this Iterable transforming each item using the closure as a transformer into a map entry, returning the supplied map with all the transformed entries added to it.
    `<K, V>` | `public static Map<K, V>` | `collectEntries(Iterator<?> self, Map<K, V> collector)` A variant of collectEntries for Iterators using the identity closure as the transform and a supplied map as the destination of transformed entries.
    `<K, V>` | `public static Map<K, V>` | `collectEntries(Iterable<?> self, Map<K, V> collector)` A variant of collectEntries for Iterables using the identity closure as the transform and a supplied map as the destination of transformed entries.
    `<K, V, E>` | `public static Map<K, V>` | `collectEntries(E[] self)`
    `<K, V, E>` | `public static Map<K, V>` | `collectEntries(E[] self, Map<K, V> collector)`
    `<K, V, E>` | `public static Map<K, V>` | `collectEntries(E[] self, Closure<?> transform)`
    `<K, V, E>` | `public static Map<K, V>` | `collectEntries(E[] self, Map<K, V> collector, Closure<?> transform)`
    `<K, V>` | `public static Map<K, V>` | `collectKeys(Map<K, V> keys, Map<K, V> collector, Function<? super K, K> keyTransform)` Transform a Maps' keys leaving the values unchanged.
    `<K, V>` | `public static Map<K, V>` | `collectKeys(Map<K, V> keys, Function<? super K, K> keyTransform)` Transform a Maps' keys leaving the values unchanged.
    `<T, E>` | `public static List<T>` | `collectMany(Iterable<E> self, Closure<? extends Collection<? extends T>> projection)` Projects each item from a source Iterable to a collection and concatenates (flattens) the resulting collections into a single list.
    `<T, E>` | `public static List<T>` | `collectMany(Iterable<E> self)` Flattens an iterable of collections into a list.
    `<T, E, C extends Collection<T>>` | `public static C` | `collectMany(Iterable<E> self, C collector, Closure<? extends Collection<? extends T>> projection)` Projects each item from a source collection to a result collection and concatenates (flattens) the resulting collections adding them into the `collector`.
    `<T, K, V, C extends Collection<T>>` | `public static C` | `collectMany(Map<K, V> self, C collector, Closure<? extends Collection<? extends T>> projection)` Projects each item from a source map to a result collection and concatenates (flattens) the resulting collections adding them into the `collector`.
    `<T, K, V>` | `public static List<T>` | `collectMany(Map<K, V> self, Closure<? extends Collection<? extends T>> projection)` Projects each item from a source map to a result collection and concatenates (flattens) the resulting collections adding them into a collection.
    `<T, E, C extends Collection<T>>` | `public static C` | `collectMany(Iterator<E> self, C collector, Closure<? extends Collection<? extends T>> projection)` Projects each item from a source iterator to a collection and concatenates (flattens) the resulting collections into a single list.
    `<T, E>` | `public static List<T>` | `collectMany(Iterator<E> self, Closure<? extends Collection<? extends T>> projection)` Projects each item from a source iterator to a collection and concatenates (flattens) the resulting collections into a single list.
    `<T, E>` | `public static List<T>` | `collectMany(Iterator<E> self)` Flattens an iterator of collections into a single list.
    `<T, E>` | `public static List<T>` | `collectMany(E[] self, Closure<? extends Collection<? extends T>> projection)`
    `<T, E, C extends Collection<T>>` | `public static C` | `collectMany(E[] self, C collector, Closure<? extends Collection<? extends T>> projection)`
    `<T, K, V>` | `public static Collection<T>` | `collectMany$$bridge(Map<K, V> self, Closure<? extends Collection<? extends T>> projection)`
    `` | `public static List` | `collectNested(Collection self, Closure transform)` Recursively iterates through this collection transforming each non-Collection value into a new value using the closure as a transformer.
    `` | `public static List` | `collectNested(Iterable self, Closure transform)` Recursively iterates through this Iterable transforming each non-Collection value into a new value using the closure as a transformer.
    `<C extends Collection>` | `public static C` | `collectNested(Iterable self, C collector, Closure transform)` Recursively iterates through this Iterable transforming each non-Collection value into a new value using the `transform` closure.
    `<K, V>` | `public static Map<K, V>` | `collectValues(Map<K, V> keys, Map<K, V> collector, Function<? super V, V> valueTransform)` Transform a Maps' values leaving the keys unchanged.
    `<K, V>` | `public static Map<K, V>` | `collectValues(Map<K, V> keys, Function<? super V, V> valueTransform)` Transform a Maps' values leaving the keys unchanged.
    `<E, T>` | `public static Iterator<T>` | `collecting(Iterator<E> self, Closure<T> transform)` Returns an iterator of transformed values from the source iterator using the `transform` closure.
    `<K, V, E>` | `public static Iterator<Map.Entry<K, V>>` | `collectingEntries(Iterator<E> self, Closure<?> transform)` Returns an iterator of transformed values from the source iterator using the `transform` closure.
    `<T, E>` | `public static Iterator<T>` | `collectingMany(Iterator<E> self, Closure<? extends Collection<? extends T>> projection)` Iterates through the elements produced by projecting and flattening the elements from a source iterator.
    `` | `public static List<List>` | `combinations(Iterable self)` Finds all combinations of items from the given aggregate of collections.
    `<T>` | `public static List<T>` | `combinations(Iterable self, Closure<T> function)` Finds all combinations of items from the given aggregate of collections, then returns the results of the supplied transform.
    `` | `public static int` | `compareTo(Character left, Number right)` Compares a Character and a Number.
    `` | `public static int` | `compareTo(Number left, Character right)` Compares a Number and a Character.
    `` | `public static int` | `compareTo(Character left, Character right)` Compares two Characters.
    `` | `public static int` | `compareTo(Number left, Number right)` Compares two Numbers.
    `` | `public static boolean` | `contains(Iterable self, Object item)` Returns `true` if this iterable contains the item.
    `` | `public static boolean` | `contains(boolean[] self, Object value)`
    `` | `public static boolean` | `contains(byte[] self, Object value)`
    `` | `public static boolean` | `contains(char[] self, Object value)`
    `` | `public static boolean` | `contains(short[] self, Object value)`
    `` | `public static boolean` | `contains(int[] self, Object value)`
    `` | `public static boolean` | `contains(long[] self, Object value)`
    `` | `public static boolean` | `contains(float[] self, Object value)`
    `` | `public static boolean` | `contains(double[] self, Object value)`
    `` | `public static boolean` | `contains(Object[] self, Object value)`
    `` | `public static boolean` | `containsAll(Iterable<?> self, Object[] items)` Returns `true` if this iterable contains all the elements in the specified array.
    `` | `public static Number` | `count(Iterator self, Object value)` Counts the number of occurrences of the given value from the items within this Iterator.
    `<T>` | `public static Number` | `count(Iterator<T> self, Closure closure)` Counts the number of occurrences which satisfy the given closure from the items within this Iterator.
    `<T, E extends Number>` | `public static E` | `count(Iterator<T> self, E initialCount, Closure closure)` Counts the number of occurrences which satisfy the given closure from the items within this Iterator, adding the count to the initial count.
    `` | `public static Number` | `count(Iterable self, Object value)` Counts the number of occurrences of the given value inside this Iterable.
    `<T>` | `public static Number` | `count(Iterable<T> self, Closure closure)` Counts the number of occurrences which satisfy the given closure from inside this Iterable.
    `<T, E extends Number>` | `public static E` | `count(Iterable<T> self, E initialCount, Closure closure)` Counts the number of occurrences which satisfy the given closure from inside this Iterable.
    `<K, V>` | `public static Number` | `count(Map<K, V> self, Closure<?> closure)` Counts the number of occurrences which satisfy the given closure from inside this map.
    `<K, V, E extends Number>` | `public static E` | `count(Map<K, V> self, E initialCount, Closure<?> closure)` Counts the number of occurrences which satisfy the given closure from inside this map.
    `` | `public static Number` | `count(boolean[] self, Object value)`
    `` | `public static Number` | `count(byte[] self, Object value)`
    `` | `public static Number` | `count(char[] self, Object value)`
    `` | `public static Number` | `count(short[] self, Object value)`
    `` | `public static Number` | `count(int[] self, Object value)`
    `` | `public static Number` | `count(long[] self, Object value)`
    `` | `public static Number` | `count(float[] self, Object value)`
    `` | `public static Number` | `count(double[] self, Object value)`
    `` | `public static Number` | `count(Object[] self, Object value)`
    `<T>` | `public static Number` | `count(T[] self, Closure predicate)`
    `<K, E>` | `public static Map<K, Integer>` | `countBy(Iterable<E> self, Closure<K> closure)` Sorts all collection members into groups determined by the supplied mapping closure and counts the group size.
    `<E>` | `public static Map<E, Integer>` | `countBy(Iterable<E> self)` Creates a multiset-like map of the collection members.
    `<K, E>` | `public static Map<K, Integer>` | `countBy(Iterator<E> self, Closure<K> closure)` Sorts all iterator items into groups determined by the supplied mapping closure and counts the group size.
    `<E>` | `public static Map<E, Integer>` | `countBy(Iterator<E> self)` Creates a multiset-like map of the iterator members.
    `<K, U, V>` | `public static Map<K, Integer>` | `countBy(Map<U, V> self, Closure<K> closure)` Groups the members of a map into groups determined by the supplied mapping closure and counts the frequency of the created groups.
    `<K, E>` | `public static Map<K, Integer>` | `countBy(E[] self, Closure<K> closure)`
    `` | `public static boolean` | `disjoint(Iterable left, Iterable right)` Returns `true` if the intersection of two iterables is empty.
    `` | `public static Number` | `div(Character left, Number right)` Divide a Character by a Number.
    `` | `public static Number` | `div(Number left, Character right)` Divide a Number by a Character.
    `` | `public static Number` | `div(Character left, Character right)` Divide one Character by another.
    `` | `public static void` | `downto(Number self, Number to, Closure closure)` Iterates from this number down to the given number, inclusive, decrementing by one each time.
    `` | `public static void` | `downto(long self, Number to, Closure closure)` Iterates from this number down to the given number, inclusive, decrementing by one each time.
    `` | `public static void` | `downto(Long self, Number to, Closure closure)` Iterates from this number down to the given number, inclusive, decrementing by one each time.
    `` | `public static void` | `downto(float self, Number to, Closure closure)` Iterates from this number down to the given number, inclusive, decrementing by one each time.
    `` | `public static void` | `downto(Float self, Number to, Closure closure)` Iterates from this number down to the given number, inclusive, decrementing by one each time.
    `` | `public static void` | `downto(double self, Number to, Closure closure)` Iterates from this number down to the given number, inclusive, decrementing by one each time.
    `` | `public static void` | `downto(Double self, Number to, Closure closure)` Iterates from this number down to the given number, inclusive, decrementing by one each time.
    `` | `public static void` | `downto(BigInteger self, Number to, Closure closure)` Iterates from this number down to the given number, inclusive, decrementing by one each time.
    `` | `public static void` | `downto(BigDecimal self, Number to, Closure closure)` Iterates from this number down to the given number, inclusive, decrementing by one each time.
    `<T>` | `public static List<T>` | `drain(Queue<T> self)` Drain the queue of elements, returning them as a list.
    `<T>` | `public static SortedSet<T>` | `drop(SortedSet<T> self, int num)` Drops the given number of elements from the head of this List.
    `<T>` | `public static List<T>` | `drop(List<T> self, int num)` Drops the given number of elements from the head of this List.
    `<T>` | `public static Collection<T>` | `drop(Iterable<T> self, int num)` Drops the given number of elements from the head of this Iterable.
    `<K, V>` | `public static Map<K, V>` | `drop(Map<K, V> self, int num)` Drops the given number of key/value pairs from the head of this map if they are available.
    `<T>` | `public static Iterator<T>` | `drop(Iterator<T> self, int num)` Drops the given number of elements from the head of this iterator if they are available.
    `<T>` | `public static T[]` | `drop(T[] self, int num)`
    `<T>` | `public static SortedSet<T>` | `dropRight(SortedSet<T> self, int num)` Drops the given number of elements from the tail of this SortedSet.
    `<T>` | `public static List<T>` | `dropRight(List<T> self, int num)` Drops the given number of elements from the tail of this List.
    `<T>` | `public static Collection<T>` | `dropRight(Iterable<T> self, int num)` Drops the given number of elements from the tail of this Iterable.
    `<T>` | `public static Iterator<T>` | `dropRight(Iterator<T> self, int num)` Drops the given number of elements from the tail of this Iterator.
    `<T>` | `public static T[]` | `dropRight(T[] self, int num)`
    `<T>` | `public static SortedSet<T>` | `dropWhile(SortedSet<T> self, Closure condition)` Returns a suffix of this SortedSet where elements are dropped from the front while the given Closure evaluates to true.
    `<T>` | `public static List<T>` | `dropWhile(List<T> self, Closure condition)` Returns a suffix of this List where elements are dropped from the front while the given Closure evaluates to true.
    `<T>` | `public static Collection<T>` | `dropWhile(Iterable<T> self, Closure condition)` Returns a suffix of this Iterable where elements are dropped from the front while the given closure evaluates to true.
    `<K, V>` | `public static Map<K, V>` | `dropWhile(Map<K, V> self, Closure condition)` Create a suffix of the given Map by dropping as many entries as possible from the front of the original Map such that calling the given closure condition evaluates to true when passed each of the dropped entries (or key/value pairs).
    `<T>` | `public static Iterator<T>` | `dropWhile(Iterator<T> self, Closure<?> condition)` Creates an Iterator that returns a suffix of the elements from an original Iterator.
    `<T>` | `public static T[]` | `dropWhile(T[] self, Closure<?> condition)`
    `` | `public static String` | `dump(Object self)` Generates a detailed dump string of an object showing its class, hashCode and all accessible fields.
    `<T>` | `public static T` | `each(T self, Closure closure)` Iterates through an aggregate type or data structure, passing each item to the given closure.
    `<T>` | `public static Iterable<T>` | `each(Iterable<T> self, Closure closure)` Iterates through an Iterable, passing each item to the given closure.
    `<T>` | `public static Iterator<T>` | `each(Iterator<T> self, Closure closure)` Iterates through an Iterator, passing each item to the given closure.
    `<T>` | `public static Collection<T>` | `each(Collection<T> self, Closure closure)` Iterates through a Collection, passing each item to the given closure.
    `<T>` | `public static List<T>` | `each(List<T> self, Closure closure)` Iterates through a List, passing each item to the given closure.
    `<T>` | `public static Set<T>` | `each(Set<T> self, Closure closure)` Iterates through a Set, passing each item to the given closure.
    `<T>` | `public static SortedSet<T>` | `each(SortedSet<T> self, Closure closure)` Iterates through a SortedSet, passing each item to the given closure.
    `<K, V>` | `public static Map<K, V>` | `each(Map<K, V> self, Closure<?> closure)` Allows a Map to be iterated through using a closure.
    `<T>` | `public static T[]` | `each(T[] self, Closure closure)`
    `` | `public static void` | `eachByte(byte[] self, Closure closure)`
    `` | `public static void` | `eachByte(Byte[] self, Closure closure)`
    `` | `public static void` | `eachCombination(Iterable self, Closure<?> function)` Applies a function on each combination of the input lists.
    `<T>` | `public static Iterator<List<T>>` | `eachPermutation(Iterable<T> self, Closure closure)` Iterates over all permutations of a collection, running a closure for each iteration.
    `<T>` | `public static T` | `eachWithIndex(T self, Closure closure)` Iterates through an aggregate type or data structure, passing each item and the item's index (a counter starting at zero) to the given closure.
    `<T>` | `public static Iterable<T>` | `eachWithIndex(Iterable<T> self, Closure closure)` Iterates through an iterable type, passing each item and the item's index (a counter starting at zero) to the given closure.
    `<T>` | `public static Iterator<T>` | `eachWithIndex(Iterator<T> self, Closure closure)` Iterates through an iterator type, passing each item and the item's index (a counter starting at zero) to the given closure.
    `<T>` | `public static Collection<T>` | `eachWithIndex(Collection<T> self, Closure closure)` Iterates through a Collection, passing each item and the item's index (a counter starting at zero) to the given closure.
    `<T>` | `public static List<T>` | `eachWithIndex(List<T> self, Closure closure)` Iterates through a List, passing each item and the item's index (a counter starting at zero) to the given closure.
    `<T>` | `public static Set<T>` | `eachWithIndex(Set<T> self, Closure closure)` Iterates through a Set, passing each item and the item's index (a counter starting at zero) to the given closure.
    `<T>` | `public static SortedSet<T>` | `eachWithIndex(SortedSet<T> self, Closure closure)` Iterates through a SortedSet, passing each item and the item's index (a counter starting at zero) to the given closure.
    `<K, V>` | `public static Map<K, V>` | `eachWithIndex(Map<K, V> self, Closure<?> closure)` Allows a Map to be iterated through using a closure.
    `<T>` | `public static T[]` | `eachWithIndex(T[] self, Closure closure)`
    `` | `public static boolean` | `equals(List left, Object[] right)` Determines if the contents of this list are equal to the contents of the given array in the same order.
    `` | `public static boolean` | `equals(List left, List right)` Compare the contents of two Lists.
    `<T>` | `public static boolean` | `equals(Set<T> self, Set<T> other)` Compare the contents of two Sets for equality using Groovy's coercion rules.
    `` | `public static boolean` | `equals(Map self, Map other)` Compares two Maps treating coerced numerical values as identical.
    `` | `public static boolean` | `equals(int[] left, int[] right)`
    `` | `public static boolean` | `equals(Object[] left, List right)`
    `` | `public static boolean` | `equalsIgnoreZeroSign(Float number, Object other)` Compares this object against the specified object returning the same result as Float.equals but returning true if this object and the specified object are both zero and negative zero respectively or vice versa.
    `` | `public static boolean` | `equalsIgnoreZeroSign(Double number, Object other)` Compares this object against the specified object returning the same result as Double.equals but returning true if this object and the specified object are both zero and negative zero respectively or vice versa.
    `` | `public static boolean` | `every(Object self, Closure predicate)` Used to determine if the given predicate closure is valid (i.e. returns `true` for all items in this data structure).
    `<T>` | `public static boolean` | `every(Iterator<T> self, Closure predicate)` Used to determine if the given predicate closure is valid (i.e. returns `true` for all items in this iterator).
    `<T>` | `public static boolean` | `every(Iterable<T> self, Closure predicate)` Used to determine if the given predicate closure is valid (i.e. returns `true` for all items in this iterable).
    `<K, V>` | `public static boolean` | `every(Map<K, V> self, Closure predicate)` Iterates over the entries of a map, and checks whether a predicate is valid for all entries.
    `` | `public static boolean` | `every(Object self)` Iterates over every element of a collection, and checks whether all elements are `true` according to the Groovy Truth.
    `<T>` | `public static boolean` | `every(T[] self, Closure predicate)`
    `` | `public static Object` | `find(Object self, Closure closure)` Finds the first value matching the closure condition.
    `` | `public static Object` | `find(Object self)` Finds the first item matching the IDENTITY Closure (i.e. matching Groovy truth).
    `<T>` | `public static T` | `find(Collection<T> self, Closure closure)` Finds the first value matching the closure condition.
    `<T>` | `public static T` | `find(Collection<T> self)` Finds the first item matching the IDENTITY Closure (i.e. matching Groovy truth).
    `<K, V>` | `public static Map.Entry<K, V>` | `find(Map<K, V> self, Closure<?> closure)` Finds the first entry matching the closure condition.
    `<T>` | `public static T` | `find(T[] self, Closure condition)`
    `<K, V>` | `public static Map<K, V>` | `findAll(Map<K, V> self, Closure closure)` Finds all entries matching the closure condition.
    `<T>` | `public static Set<T>` | `findAll(Set<T> self, Closure closure)` Finds all values matching the closure condition.
    `<T>` | `public static List<T>` | `findAll(List<T> self, Closure closure)` Finds all values matching the closure condition.
    `<T>` | `public static Collection<T>` | `findAll(Collection<T> self, Closure closure)` Finds all values matching the closure condition.
    `<T>` | `public static Set<T>` | `findAll(Set<T> self)` Finds the items matching the IDENTITY Closure (i.e. matching Groovy truth).
    `<T>` | `public static List<T>` | `findAll(List<T> self)` Finds the items matching the IDENTITY Closure (i.e. matching Groovy truth).
    `<T>` | `public static Collection<T>` | `findAll(Collection<T> self)` Finds the items matching the IDENTITY Closure (i.e. matching Groovy truth).
    `` | `public static List` | `findAll(Object self, Closure closure)` Finds all items matching the closure condition.
    `` | `public static List` | `findAll(Object self)` Finds all items matching the IDENTITY Closure (i.e. matching Groovy truth).
    `<T>` | `public static List<T>` | `findAll(T[] self)`
    `<T>` | `public static List<T>` | `findAll(T[] self, Closure condition)`
    `` | `public static Collection` | `findAll$$bridge(Object self)`
    `<T>` | `public static Collection<T>` | `findAll$$bridge(T[] self)`
    `` | `public static Collection` | `findAll$$bridge(Object self, Closure closure)`
    `<T>` | `public static Collection<T>` | `findAll$$bridge(T[] self, Closure condition)`
    `` | `public static int` | `findIndexOf(Object self, Closure condition)` Iterates over the elements of an aggregate of items and returns the index of the first item that matches the condition specified in the closure.
    `` | `public static int` | `findIndexOf(Object self, int startIndex, Closure condition)` Iterates over the elements of an aggregate of items, starting from a specified startIndex, and returns the index of the first item that matches the condition specified in the closure.
    `<T>` | `public static int` | `findIndexOf(Iterator<T> self, Closure condition)` Iterates over the elements of an Iterator and returns the index of the first item that satisfies the condition specified by the closure.
    `<T>` | `public static int` | `findIndexOf(Iterator<T> self, int startIndex, Closure condition)` Iterates over the elements of an Iterator, starting from a specified startIndex, and returns the index of the first item that satisfies the condition specified by the closure.
    `<T>` | `public static int` | `findIndexOf(Iterable<T> self, Closure condition)` Iterates over the elements of an Iterable and returns the index of the first item that satisfies the condition specified by the closure.
    `<T>` | `public static int` | `findIndexOf(Iterable<T> self, int startIndex, Closure condition)` Iterates over the elements of an Iterable, starting from a specified startIndex, and returns the index of the first item that satisfies the condition specified by the closure.
    `<T>` | `public static int` | `findIndexOf(T[] self, Closure condition)`
    `<T>` | `public static int` | `findIndexOf(T[] self, int startIndex, Closure condition)`
    `` | `public static List<Number>` | `findIndexValues(Object self, Closure condition)` Iterates over the elements of an aggregate of items and returns the index values of the items that match the condition specified in the closure.
    `` | `public static List<Number>` | `findIndexValues(Object self, Number startIndex, Closure condition)` Iterates over the elements of an aggregate of items, starting from a specified startIndex, and returns the index values of the items that match the condition specified in the closure.
    `<T>` | `public static List<Number>` | `findIndexValues(Iterable<T> self, Closure condition)` Iterates over the elements of an Iterable and returns the index values of the items that match the condition specified in the closure.
    `<T>` | `public static List<Number>` | `findIndexValues(Iterable<T> self, Number startIndex, Closure condition)` Iterates over the elements of an Iterable, starting from a specified startIndex, and returns the index values of the items that match the condition specified in the closure.
    `<T>` | `public static Iterator<Number>` | `findIndexValues(Iterator<T> self, Closure<?> transform)` Returns an iterator of transformed values from the source iterator using the `transform` closure.
    `<T>` | `public static Iterator<Number>` | `findIndexValues(Iterator<T> self, Number startIndex, Closure<?> transform)` Returns an iterator of transformed values from the source iterator using the `transform` closure and starting with index `startIndex`.
    `<T>` | `public static List<Number>` | `findIndexValues(T[] self, Closure condition)`
    `<T>` | `public static List<Number>` | `findIndexValues(T[] self, Number startIndex, Closure condition)`
    `<T>` | `public static List<Number>` | `findIndexValues$$bridge(Iterator<T> self, Closure condition)` Iterates over the elements of an Iterator and returns the index values of the items that match the condition specified in the closure.
    `<T>` | `public static List<Number>` | `findIndexValues$$bridge(Iterator<T> self, Number startIndex, Closure condition)` Iterates over the elements of an Iterator, starting from a specified startIndex, and returns the index values of the items that match the condition specified in the closure.
    `` | `public static int` | `findLastIndexOf(Object self, Closure condition)` Iterates over the elements of an aggregate of items and returns the index of the last item that matches the condition specified in the closure.
    `` | `public static int` | `findLastIndexOf(Object self, int startIndex, Closure condition)` Iterates over the elements of an aggregate of items, starting from a specified startIndex, and returns the index of the last item that matches the condition specified in the closure.
    `<T>` | `public static int` | `findLastIndexOf(Iterator<T> self, Closure condition)` Iterates over the elements of an Iterator and returns the index of the last item that matches the condition specified in the closure.
    `<T>` | `public static int` | `findLastIndexOf(Iterator<T> self, int startIndex, Closure condition)` Iterates over the elements of an Iterator, starting from a specified startIndex, and returns the index of the last item that matches the condition specified in the closure.
    `<T>` | `public static int` | `findLastIndexOf(Iterable<T> self, Closure condition)` Iterates over the elements of an Iterable and returns the index of the last item that matches the condition specified in the closure.
    `<T>` | `public static int` | `findLastIndexOf(Iterable<T> self, int startIndex, Closure condition)` Iterates over the elements of an Iterable, starting from a specified startIndex, and returns the index of the last item that matches the condition specified in the closure.
    `<T>` | `public static int` | `findLastIndexOf(T[] self, Closure condition)`
    `<T>` | `public static int` | `findLastIndexOf(T[] self, int startIndex, Closure condition)`
    `` | `public static Object` | `findResult(Object self, Closure condition)` Treats the object as iterable, iterating through the values it represents and returns the first non-null result obtained from calling the closure, otherwise returns null.
    `` | `public static Object` | `findResult(Object self)` Treats the object as iterable, iterating through the values it represents and returns the first non-null value, otherwise returns null.
    `` | `public static Object` | `findResult(Object self, Object defaultResult, Closure condition)` Treats the object as iterable, iterating through the values it represents and returns the first non-null result obtained from calling the closure, otherwise returns the defaultResult.
    `` | `public static Object` | `findResult(Object self, Object defaultResult)` Treats the object as iterable, iterating through the values it represents and returns the first non-null result, otherwise returns the defaultResult.
    `<S, T, U extends T, V extends T>` | `public static T` | `findResult(Iterator<S> self, U defaultResult, Closure<V> condition)` Iterates through the Iterator calling the given closure condition for each item but stopping once the first non-null result is found and returning that result.
    `<T, U extends T, V extends T>` | `public static T` | `findResult(Iterator<U> self, V defaultResult)` Iterates through the Iterator stopping once the first non-null result is found and returning that result.
    `<T, U>` | `public static T` | `findResult(Iterator<U> self, Closure<T> condition)` Iterates through the Iterator calling the given closure condition for each item but stopping once the first non-null result is found and returning that result.
    `<T>` | `public static T` | `findResult(Iterator<T> self)` Iterates through the Iterator stopping once the first non-null result is found and returning that result.
    `<S, T, U extends T, V extends T>` | `public static T` | `findResult(Iterable<S> self, U defaultResult, Closure<V> condition)` Iterates through the Iterable calling the given closure condition for each item but stopping once the first non-null result is found and returning that result.
    `<T, U extends T, V extends T>` | `public static T` | `findResult(Iterable<U> self, V defaultResult)` Iterates through the Iterable calling the given closure condition for each item but stopping once the first non-null result is found and returning that result.
    `<T, U>` | `public static T` | `findResult(Iterable<U> self, Closure<T> condition)` Iterates through the Iterable calling the given closure condition for each item but stopping once the first non-null result is found and returning that result.
    `<T>` | `public static T` | `findResult(Iterable<T> self)` Iterates through the Iterable stopping once the first non-null result is found and returning that result.
    `<T, K, V>` | `public static T` | `findResult(Map<K, V> self, Closure<T> condition)` Returns the first non-null closure result found by passing each map entry to the closure, otherwise null is returned.
    `<T, U extends T, V extends T, A, B>` | `public static T` | `findResult(Map<A, B> self, U defaultResult, Closure<V> condition)` Returns the first non-null closure result found by passing each map entry to the closure, otherwise the defaultResult is returned.
    `<T>` | `public static T` | `findResult(T[] self)`
    `<T, U extends T, V extends T>` | `public static T` | `findResult(U[] self, V defaultResult)`
    `<S, T>` | `public static T` | `findResult(S[] self, Closure<T> condition)`
    `<S, T, U extends T, V extends T>` | `public static T` | `findResult(S[] self, U defaultResult, Closure<V> condition)`
    `<T, U>` | `public static Collection<T>` | `findResults(Iterable<U> self, Closure<T> filteringTransform)` Iterates through the Iterable transforming items using the supplied closure and collecting any non-null results.
    `<T>` | `public static Collection<T>` | `findResults(Iterable<T> self)` Iterates through the Iterable collecting any non-null results.
    `<T, U>` | `public static Collection<T>` | `findResults(Iterator<U> self, Closure<T> filteringTransform)` Iterates through the Iterator transforming items using the supplied closure and collecting any non-null results.
    `<T>` | `public static Collection<T>` | `findResults(Iterator<T> self)` Iterates through the Iterator collecting any non-null results.
    `<T, K, V>` | `public static Collection<T>` | `findResults(Map<K, V> self, Closure<T> filteringTransform)` Iterates through the map transforming items using the supplied closure and collecting any non-null results.
    `<T>` | `public static Collection<T>` | `findResults(T[] self)`
    `<T, U>` | `public static Collection<T>` | `findResults(U[] self, Closure<T> filteringTransform)`
    `<T>` | `public static Iterator<T>` | `findingAll(Iterator<T> self, Closure<?> transform)` Lazily finds all items matching the closure condition.
    `<T, U>` | `public static Iterator<T>` | `findingResults(Iterator<U> self, Closure<T> filteringTransform)` Iterates through the Iterator transforming items using the supplied closure and finding any non-null results.
    `<T>` | `public static T` | `first(List<T> self)` Returns the first item from the List.
    `<T>` | `public static T` | `first(Iterable<T> self)` Returns the first item from the Iterable.
    `<T>` | `public static T` | `first(T[] self)`
    `<T, E>` | `public static Collection<T>` | `flatten(Collection<E> self)` Flatten a Collection.
    `<T, E>` | `public static Collection<T>` | `flatten(Iterable<E> self)` Flatten an Iterable.
    `<T, E>` | `public static Collection<T>` | `flatten(Iterable<E> self, boolean flattenOptionals)` Flatten an Iterable.
    `<T, E>` | `public static Iterator<T>` | `flatten(Iterator<E> self)` Flatten an Iterator.
    `<T, E>` | `public static Iterator<T>` | `flatten(Iterator<E> self, boolean flattenOptionals)` Flatten an Iterator.
    `<T, E>` | `public static List<T>` | `flatten(List<E> self)` Flatten a List.
    `<T, E>` | `public static Set<T>` | `flatten(Set<E> self)` Flatten a Set.
    `<T, E>` | `public static SortedSet<T>` | `flatten(SortedSet<E> self)` Flatten a SortedSet.
    `<T, E>` | `public static Collection<T>` | `flatten(Iterable<E> self, Closure<?> flattenUsing)` Flatten an Iterable.
    `<T, E>` | `public static Collection<T>` | `flatten(Iterable<E> self, boolean flattenOptionals, Closure<?> flattenUsing)` Flatten an Iterable.
    `<T, E>` | `public static Collection<T>` | `flatten(Optional<E> self)` Flatten an Optional.
    `<T, E>` | `public static Iterator<T>` | `flatten(Iterator<E> self, Closure<?> flattenUsing)` Flatten an Iterator.
    `<T, E>` | `public static Iterator<T>` | `flatten(Iterator<E> self, boolean flattenOptionals, Closure<?> flattenUsing)` Flatten an Iterator.
    `` | `public static Collection` | `flatten(boolean[] self)`
    `` | `public static Collection` | `flatten(byte[] self)`
    `` | `public static Collection` | `flatten(char[] self)`
    `` | `public static Collection` | `flatten(short[] self)`
    `` | `public static Collection` | `flatten(int[] self)`
    `` | `public static Collection` | `flatten(long[] self)`
    `` | `public static Collection` | `flatten(float[] self)`
    `` | `public static Collection` | `flatten(double[] self)`
    `` | `public static Collection` | `flatten(Object[] self)`
    `<T>` | `public static Collection<T>` | `flattenMany(Iterable<?> self, Closure<?> transform)` Flatten an Iterable.
    `<T, E>` | `public static Iterator<T>` | `flattenMany(Iterator<E> self, boolean flattenOptionals, Closure<?> flattenUsing)` Flatten the elements from an Iterator.
    `<K, V>` | `public static V` | `get(Map<K, V> map, K key, V defaultValue)` Looks up an item in a Map for the given key and returns the corresponding value.
    `` | `public static Object` | `getAt(Object self, String property)` Allows the subscript operator to be used to lookup dynamic property values.
    `<T>` | `public static List<T>` | `getAt(List<T> self, Range range)` Support the range subscript operator for a List.
    `<T>` | `public static List<T>` | `getAt(ListWithDefault<T> self, Collection indices)` Select a List of items from an eager or lazy List using a Collection to identify the indices to be selected.
    `<T>` | `public static List<T>` | `getAt(ListWithDefault<T> self, Range range)` Support the range subscript operator for an eager or lazy List.
    `<T>` | `public static List<T>` | `getAt(ListWithDefault<T> self, EmptyRange range)` Support the range subscript operator for an eager or lazy List.
    `<T>` | `public static List<T>` | `getAt(List<T> self, EmptyRange range)` Support the range subscript operator for a List.
    `<T>` | `public static List<T>` | `getAt(List<T> self, Collection indices)` Select a List of items from a List using a Collection to identify the indices to be selected.
    `<T>` | `public static T` | `getAt(List<T> self, int idx)` Support the subscript operator for a List.
    `<T>` | `public static T` | `getAt(List<T> self, Number idx)` Support subscript operator for list access.
    `<T>` | `public static T` | `getAt(Iterator<T> self, int idx)` Support the subscript operator for an Iterator.
    `<T>` | `public static T` | `getAt(Iterable<T> self, int idx)` Support the subscript operator for an Iterable.
    `<K, V>` | `public static V` | `getAt(Map<K, V> self, Object key)` Support the subscript operator for a Map.
    `` | `public static boolean` | `getAt(BitSet self, int index)` Support the subscript operator for a Bitset
    `` | `public static BitSet` | `getAt(BitSet self, IntRange range)` Support retrieving a subset of a BitSet using a Range
    `` | `public static List` | `getAt(Collection coll, String property)` Support the subscript operator for Collection.
    `` | `public static List<Boolean>` | `getAt(boolean[] self, Range range)`
    `` | `public static List<Byte>` | `getAt(byte[] self, Range range)`
    `` | `public static List<Character>` | `getAt(char[] self, Range range)`
    `` | `public static List<Short>` | `getAt(short[] self, Range range)`
    `` | `public static List<Integer>` | `getAt(int[] self, Range range)`
    `` | `public static List<Long>` | `getAt(long[] self, Range range)`
    `` | `public static List<Float>` | `getAt(float[] self, Range range)`
    `` | `public static List<Double>` | `getAt(double[] self, Range range)`
    `<T>` | `public static List<T>` | `getAt(T[] self, Range range)`
    `` | `public static List<Boolean>` | `getAt(boolean[] self, IntRange range)`
    `` | `public static List<Byte>` | `getAt(byte[] self, IntRange range)`
    `` | `public static List<Character>` | `getAt(char[] self, IntRange range)`
    `` | `public static List<Short>` | `getAt(short[] self, IntRange range)`
    `` | `public static List<Integer>` | `getAt(int[] self, IntRange range)`
    `` | `public static List<Long>` | `getAt(long[] self, IntRange range)`
    `` | `public static List<Float>` | `getAt(float[] self, IntRange range)`
    `` | `public static List<Double>` | `getAt(double[] self, IntRange range)`
    `<T>` | `public static List<T>` | `getAt(T[] self, IntRange range)`
    `` | `public static List<Boolean>` | `getAt(boolean[] self, ObjectRange range)`
    `` | `public static List<Byte>` | `getAt(byte[] self, ObjectRange range)`
    `` | `public static List<Character>` | `getAt(char[] self, ObjectRange range)`
    `` | `public static List<Short>` | `getAt(short[] self, ObjectRange range)`
    `` | `public static List<Integer>` | `getAt(int[] self, ObjectRange range)`
    `` | `public static List<Long>` | `getAt(long[] self, ObjectRange range)`
    `` | `public static List<Float>` | `getAt(float[] self, ObjectRange range)`
    `` | `public static List<Double>` | `getAt(double[] self, ObjectRange range)`
    `<T>` | `public static List<T>` | `getAt(T[] self, ObjectRange range)`
    `<T>` | `public static List<T>` | `getAt(T[] self, EmptyRange range)`
    `` | `public static List<Boolean>` | `getAt(boolean[] self, Collection indices)`
    `` | `public static List<Byte>` | `getAt(byte[] self, Collection indices)`
    `` | `public static List<Character>` | `getAt(char[] self, Collection indices)`
    `` | `public static List<Short>` | `getAt(short[] self, Collection indices)`
    `` | `public static List<Integer>` | `getAt(int[] self, Collection indices)`
    `` | `public static List<Long>` | `getAt(long[] self, Collection indices)`
    `` | `public static List<Float>` | `getAt(float[] self, Collection indices)`
    `` | `public static List<Double>` | `getAt(double[] self, Collection indices)`
    `<T>` | `public static List<T>` | `getAt(T[] self, Collection indices)`
    `` | `public static Groovydoc` | `getGroovydoc(AnnotatedElement holder)` Gets runtime groovydoc.
    `` | `public static IntRange` | `getIndices(Collection self)` Returns indices of the collection.
    `` | `public static IntRange` | `getIndices(boolean[] self)`
    `` | `public static IntRange` | `getIndices(byte[] self)`
    `` | `public static IntRange` | `getIndices(char[] self)`
    `` | `public static IntRange` | `getIndices(short[] self)`
    `` | `public static IntRange` | `getIndices(int[] self)`
    `` | `public static IntRange` | `getIndices(long[] self)`
    `` | `public static IntRange` | `getIndices(float[] self)`
    `` | `public static IntRange` | `getIndices(double[] self)`
    `<T>` | `public static IntRange` | `getIndices(T[] self)`
    `` | `public static URL` | `getLocation(Class self)` Gets the url of the jar file/source file containing the specified class.
    `` | `public static MetaClass` | `getMetaClass(Class c)` Adds a "metaClass" property to all class objects so you can use the syntax `String.metaClass.myMethod = { println "foo" }`
    `` | `public static MetaClass` | `getMetaClass(Object obj)` Obtains a MetaClass for an object either from the registry or in the case of a GroovyObject from the object itself.
    `` | `public static MetaClass` | `getMetaClass(GroovyObject obj)` Obtains a MetaClass for an object either from the registry or in the case of a GroovyObject from the object itself.
    `` | `public static List<PropertyValue>` | `getMetaPropertyValues(Object self)` Retrieves the list of MetaProperty objects for 'self' and wraps it in a list of PropertyValue objects that additionally provide the value for each property of 'self'.
    `` | `public static Map<String, Object>` | `getProperties(Object self)` Convenience method that calls getMetaPropertyValues(java.lang.Object)(self) and provides the data in form of simple key/value pairs, i.e. without type() information.
    `` | `public static ClassLoader` | `getRootLoader(ClassLoader self)` Iterates through the classloader parents until it finds a loader with a class named "org.codehaus.groovy.tools.RootLoader".
    `` | `public static Collection` | `grep(Object self, Object filter)` Iterates over the collection of items which this Object represents and returns each item that matches the given filter - calling the `isCase(java.lang.Object, java.lang.Object)` method used by switch statements.
    `<T>` | `public static Collection<T>` | `grep(Collection<T> self, Object filter)` Iterates over the collection of items and returns each item that matches the given filter - calling the `isCase(java.lang.Object, java.lang.Object)` method used by switch statements. method can be used with different kinds of filters like regular expressions, classes, ranges etc.
    `<T>` | `public static List<T>` | `grep(List<T> self, Object filter)` Iterates over the collection of items and returns each item that matches the given filter - calling the `isCase(java.lang.Object, java.lang.Object)` method used by switch statements.
    `<T>` | `public static Set<T>` | `grep(Set<T> self, Object filter)` Iterates over the collection of items and returns each item that matches the given filter - calling the `isCase(java.lang.Object, java.lang.Object)` method used by switch statements.
    `` | `public static Collection` | `grep(Object self)` Iterates over the collection of items which this Object represents and returns each item that matches using the IDENTITY Closure as a filter - effectively returning all elements which satisfy Groovy truth.
    `<T>` | `public static Collection<T>` | `grep(Collection<T> self)` Iterates over the collection returning each element that matches using the IDENTITY Closure as a filter - effectively returning all elements which satisfy Groovy truth.
    `<T>` | `public static List<T>` | `grep(List<T> self)` Iterates over the collection returning each element that matches using the IDENTITY Closure as a filter - effectively returning all elements which satisfy Groovy truth.
    `<T>` | `public static Set<T>` | `grep(Set<T> self)` Iterates over the collection returning each element that matches using the IDENTITY Closure as a filter - effectively returning all elements which satisfy Groovy truth.
    `<T>` | `public static Collection<T>` | `grep(T[] self)`
    `<T>` | `public static Collection<T>` | `grep(T[] self, Object filter)`
    `<K, T>` | `protected static void` | `groupAnswer(Map<K, List<T>> answer, T element, K value)` Groups the current element according to the value
    `<K, T>` | `public static Map<K, List<T>>` | `groupBy(Iterable<T> self, Closure<K> closure)` Sorts all Iterable members into groups determined by the supplied mapping closure.
    `` | `public static Map` | `groupBy(Iterable self, Object closures)` Sorts all Iterable members into (sub)groups determined by the supplied mapping closures.
    `` | `public static Map` | `groupBy(Iterable self, List<Closure> closures)` Sorts all Iterable members into (sub)groups determined by the supplied mapping closures.
    `<G, K, V>` | `public static Map<G, Map<K, V>>` | `groupBy(Map<K, V> self, Closure<G> closure)` Groups the members of a map into sub maps determined by the supplied mapping closure.
    `` | `public static Map<Object, Map>` | `groupBy(Map self, Object closures)` Groups the members of a map into sub maps determined by the supplied mapping closures.
    `` | `public static Map<Object, Map>` | `groupBy(Map self, List<Closure> closures)` Groups the members of a map into sub maps determined by the supplied mapping closures.
    `<K, T>` | `public static Map<K, List<T>>` | `groupBy(T[] self, Closure<K> closure)`
    `` | `public static Map` | `groupBy(Object[] self, Object closures)`
    `` | `public static Map` | `groupBy(Object[] self, List<Closure> closures)`
    `<G, K, V>` | `public static Map<G, List<Map.Entry<K, V>>>` | `groupEntriesBy(Map<K, V> self, Closure<G> closure)` Groups all map entries into groups determined by the supplied mapping closure.
    `` | `public boolean` | `hasNext()`
    `` | `public static MetaProperty` | `hasProperty(Object self, String name)`
    `<T>` | `public static T` | `head(Iterable<T> self)` Returns the first item from the Iterable.
    `<T>` | `public static T` | `head(List<T> self)` Returns the first item from the List.
    `<T>` | `public static T` | `head(T[] self)`
    `<T, U>` | `public static T` | `identity(U self, Closure<T> closure)` Allows the closure to be called for the object reference self.
    `` | `public static Boolean` | `implies(Boolean left, Boolean right)` Logical implication of two boolean operands.
    `<E>` | `public static Map<Integer, E>` | `indexed(Iterable<E> self)` Zips an Iterable with indices in (index, value) order.
    `<E>` | `public static Map<Integer, E>` | `indexed(Iterable<E> self, int offset)` Zips an Iterable with indices in (index, value) order.
    `<E>` | `public static Iterator<Tuple2<Integer, E>>` | `indexed(Iterator<E> self)` Zips an iterator with indices in (index, value) order.
    `<E>` | `public static Iterator<Tuple2<Integer, E>>` | `indexed(Iterator<E> self, int offset)` Zips an iterator with indices in (index, value) order.
    `` | `public static Map<Integer, Integer>` | `indexed(int[] self)`
    `` | `public static Map<Integer, Long>` | `indexed(long[] self)`
    `` | `public static Map<Integer, Double>` | `indexed(double[] self)`
    `` | `public static Map<Integer, Integer>` | `indexed(int[] self, int offset)`
    `` | `public static Map<Integer, Long>` | `indexed(long[] self, int offset)`
    `` | `public static Map<Integer, Double>` | `indexed(double[] self, int offset)`
    `<T>` | `public static Collection<T>` | `init(Iterable<T> self)` Returns the items from the Iterable excluding the last item.
    `<T>` | `public static List<T>` | `init(List<T> self)` Returns the items from the List excluding the last item.
    `<T>` | `public static SortedSet<T>` | `init(SortedSet<T> self)` Returns the items from the SortedSet excluding the last item.
    `<T>` | `public static Iterator<T>` | `init(Iterator<T> self)` Returns an Iterator containing all the items from this iterator except the last one.
    `<T>` | `public static T[]` | `init(T[] self)`
    `<T>` | `public static List<List<T>>` | `inits(Iterable<T> self)` Calculates the init values of this Iterable: the first value will be this list of all items from the iterable and the final one will be an empty list, with the intervening values the results of successive applications of init on the items.
    `<T, V extends T>` | `public static T` | `inject(Object self, Closure<V> closure)` Iterates through the given object, passing the first two elements to the closure.
    `<E extends T, T, V extends T>` | `public static T` | `inject(Iterable<E> self, Closure<V> closure)` Iterates through the given object, passing the first two elements to the closure.
    `<T, U extends T, V extends T>` | `public static T` | `inject(Object self, U initialValue, Closure<V> closure)` Iterates through the given object, passing in the initial value to the closure along with the first item.
    `<E, T, U extends T, V extends T>` | `public static T` | `inject(Iterable<E> self, U initialValue, Closure<V> closure)` Iterates through the given object, passing in the initial value to the 2-arg closure along with the first item.
    `<E, T, U extends T, V extends T>` | `public static T` | `inject(Iterator<E> self, U initialValue, Closure<V> closure)` Iterates through the given iterator, passing in the initial value to the closure along with the first item.
    `<K, V, T, U extends T, W extends T>` | `public static T` | `inject(Map<K, V> self, U initialValue, Closure<W> closure)` Iterates through the given map, passing in the initial value to the 2-arg Closure along with the first item (or 3-arg Closure along with the first key and value).
    `<E extends T, T, V extends T>` | `public static T` | `inject(E[] self, Closure<V> closure)`
    `<E extends T, T, V extends T>` | `public static T` | `inject(Collection<E> self, Closure<V> closure)`
    `<E, T, U extends T, V extends T>` | `public static T` | `inject(E[] self, U initialValue, Closure<V> closure)`
    `<E, T, U extends T, V extends T>` | `public static T` | `inject(Collection<E> self, U initialValue, Closure<V> closure)`
    `<E, T, U extends T, V extends T>` | `public static List<T>` | `injectAll(Iterable<E> self, U initialValue, Closure<V> closure)` Iterates through the given iterable, injecting values as per `inject` but returns the list of all calculated values instead of just the final result.
    `<E extends T, T, V extends T>` | `public static List<T>` | `injectAll(Iterable<E> self, Closure<V> closure)` Iterates through the given iterable, injecting values as per `inject` but returns the list of all calculated values instead of just the final result.
    `<E, T, U extends T, V extends T>` | `public static Iterator<T>` | `injectAll(Iterator<E> self, U initialValue, Closure<V> closure)` Iterates through the given iterator, injecting values as per `inject` but returns the list of all calculated values instead of just the final result.
    `<E, T, V extends T>` | `public static Iterator<T>` | `injectAll(Iterator<E> self, Closure<V> closure)` Iterates through the given iterator, injecting values as per `inject` but returns the list of all calculated values instead of just the final result.
    `<K, V, T, U extends T, W extends T>` | `public static List<T>` | `injectAll(Map<K, V> self, U initialValue, Closure<W> closure)` Iterates through the given map, passing in the initial value to the 2-arg Closure along with the first item (or 3-arg Closure along with the first key and value) and then similarly for other map entries.
    `` | `public static String` | `inspect(Object self)` Inspects returns the String that matches what would be typed into a terminal to create this object.
    `` | `public static Number` | `intdiv(Character left, Number right)` Integer Divide a Character by a Number.
    `` | `public static Number` | `intdiv(Number left, Character right)` Integer Divide a Number by a Character.
    `` | `public static Number` | `intdiv(Character left, Character right)` Integer Divide two Characters.
    `` | `public static Number` | `intdiv(Number left, Number right)` Integer Divide two Numbers.
    `<T, U extends T, V extends T>` | `public static List<T>` | `interleave(Iterable<U> self, Iterable<V> other)` The elements from two Iterables interleaved.
    `<T, U extends T, V extends T>` | `public static List<T>` | `interleave(Iterable<U> self, Iterable<V> other, boolean includeRemainder)` The elements from two Iterables interleaved.
    `<T, U extends T, V extends T>` | `public static Iterator<T>` | `interleave(Iterator<U> self, Iterator<V> other)` An iterator of the elements from two Iterators interleaved.
    `<T, U extends T, V extends T>` | `public static Iterator<T>` | `interleave(Iterator<U> self, Iterator<V> other, boolean includeRemainder)` An iterator of the elements from two Iterators interleaved.
    `<T>` | `public static Collection<T>` | `intersect(Collection<T> left, Collection<T> right)` Create a Collection composed of the intersection of both collections.
    `<T>` | `public static Collection<T>` | `intersect(Collection<T> left, Collection<T> right, Comparator<? super T> comparator)` Create a Collection composed of the intersection of both collections.
    `<T>` | `public static Collection<T>` | `intersect(Iterable<T> left, Iterable<T> right)` Create a Collection composed of the intersection of both iterables.
    `<T>` | `public static Collection<T>` | `intersect(Iterable<T> left, Iterable<T> right, Comparator<? super T> comparator)` Create a Collection composed of the intersection of both iterables.
    `<T>` | `public static Collection<T>` | `intersect(Iterable<T> left, Iterable<T> right, Closure condition)` Create a Collection composed of the intersection of both iterables.
    `<T>` | `public static List<T>` | `intersect(List<T> left, Iterable<T> right)` Create a List composed of the intersection of a List and an Iterable.
    `<T>` | `public static List<T>` | `intersect(List<T> left, Iterable<T> right, Comparator<? super T> comparator)` Create a List composed of the intersection of a List and an Iterable.
    `<T>` | `public static Set<T>` | `intersect(Set<T> left, Iterable<T> right)` Create a Set composed of the intersection of a Set and an Iterable.
    `<T>` | `public static Set<T>` | `intersect(Set<T> left, Iterable<T> right, Comparator<? super T> comparator)` Create a Set composed of the intersection of a Set and an Iterable.
    `<T>` | `public static SortedSet<T>` | `intersect(SortedSet<T> left, Iterable<T> right)` Create a SortedSet composed of the intersection of a SortedSet and an Iterable.
    `<T>` | `public static SortedSet<T>` | `intersect(SortedSet<T> left, Iterable<T> right, Comparator<? super T> comparator)` Create a SortedSet composed of the intersection of a SortedSet and an Iterable.
    `<K, V>` | `public static Map<K, V>` | `intersect(Map<K, V> left, Map<K, V> right)` Create a Map composed of the intersection of both maps.
    `` | `public static Object` | `invokeMethod(Object object, String method, Object arguments)` Provide a dynamic method invocation method which can be overloaded in classes to implement dynamic proxies easily.
    `` | `public static boolean` | `is(Object self, Object other)` Identity check.
    `` | `public static Boolean` | `isAtLeast(BigDecimal left, BigDecimal right)` Compare a BigDecimal to another.
    `` | `public static Boolean` | `isAtLeast(BigDecimal left, String right)` Compare a BigDecimal to a String representing a number.
    `` | `public static boolean` | `isCase(Object caseValue, Object switchValue)` Method for overloading the behavior of the 'case' method in switch statements.
    `` | `public static boolean` | `isCase(Class caseValue, Object switchValue)` Special 'case' implementation for Class, which allows testing whether some switch value is assignable from the given case class.
    `` | `public static boolean` | `isCase(Collection caseValue, Object switchValue)` Special 'case' implementation for collections which tests if the 'switch' operand is contained in any of the 'case' values.
    `` | `public static boolean` | `isCase(Iterable caseValue, Object switchValue)` Special 'case' implementation for iterables which tests if the 'switch' operand is contained in any of the 'case' values.
    `` | `public static boolean` | `isCase(Map caseValue, Object switchValue)` Special 'case' implementation for maps which tests if the 'switch' operand exists in the key set.
    `` | `public static boolean` | `isCase(Number caseValue, Number switchValue)` Special 'case' implementation for all numbers, which delegates to the `compareTo()` method for comparing numbers of different types.
    `` | `public static boolean` | `isDigit(Character self)` Determines if a character is a digit.
    `` | `public static boolean` | `isEmpty(Iterable self)` Check whether an `Iterable` has elements
         def items = [1]
         def iterable = { [ hasNext:{ !
    `` | `public static boolean` | `isLetter(Character self)` Determines if a character is a letter.
    `` | `public static boolean` | `isLetterOrDigit(Character self)` Determines if a character is a letter or digit.
    `` | `public static boolean` | `isLowerCase(Character self)` Determines if a Character is lowercase.
    `` | `public static boolean` | `isNotCase(Number caseValue, Number switchValue)` Since: 4.0.0
    `` | `public static boolean` | `isNotCase(Object caseValue, Object switchValue)` Since: 4.0.0
    `` | `public static boolean` | `isNotCase(Class<?> caseValue, Object switchValue)` Since: 4.0.0
    `` | `public static boolean` | `isNotCase(Closure<?> caseValue, Object switchValue)` Since: 4.0.0
    `` | `public static boolean` | `isNotCase(Collection<?> caseValue, Object switchValue)` Since: 4.0.0
    `` | `public static boolean` | `isNotCase(Map<?, ?> caseValue, Object switchValue)` Since: 4.0.0
    `` | `public static boolean` | `isUpperCase(Character self)` Determines if a Character is uppercase.
    `` | `public static boolean` | `isWhitespace(Character self)` Determines if a character is a whitespace character.
    `` | `public static Iterator` | `iterator(Object self)` Creates an Iterator for the given Object by converting it to a Collection.
    `<T>` | `public static Iterator<T>` | `iterator(Iterator<T> self)` Supports 'duck-typing' when trying to get an Iterator for each element of a Collection, some of which may already be an Iterator.
    `<T>` | `public static Iterator<T>` | `iterator(Enumeration<T> self)` Allows an Enumeration to behave like an Iterable.
    `<K, V>` | `public static Iterator<Map.Entry<K, V>>` | `iterator(Map<K, V> self)` Returns an Iterator for the given Map's entry set.
    `<T>` | `public static Iterator<T>` | `iterator(T[] self)`
    `` | `public static String` | `join(Iterator<?> self)` Concatenates the `toString()` representation of each item from the Iterator.
    `` | `public static String` | `join(Iterable<?> self)` Concatenates the `toString()` representation of each item from the Iterable.
    `` | `public static String` | `join(Iterator<?> self, String separator)` Concatenates the `toString()` representation of each item from the Iterator, with the given String as a separator between each item.
    `` | `public static String` | `join(Iterable<?> self, String separator)` Concatenates the `toString()` representation of each item from the Iterable, with the given String as a separator between each item.
    `` | `public static String` | `join(boolean[] self, String separator)`
    `` | `public static String` | `join(byte[] self, String separator)`
    `` | `public static String` | `join(char[] self, String separator)`
    `` | `public static String` | `join(short[] self, String separator)`
    `` | `public static String` | `join(int[] self, String separator)`
    `` | `public static String` | `join(long[] self, String separator)`
    `` | `public static String` | `join(float[] self, String separator)`
    `` | `public static String` | `join(double[] self, String separator)`
    `<T>` | `public static String` | `join(T[] self, String separator)`
    `<T>` | `public static T` | `last(List<T> self)` Returns the last item from the List.
    `<T>` | `public static T` | `last(Deque<T> self)` An optimized version of last(List).
    `<T>` | `public static T` | `last(Iterable<T> self)` Returns the last item from the Iterable.
    `<T>` | `public static T` | `last(T[] self)`
    `<T>` | `public static Collection<T>` | `leftShift(Collection<T> self, T value)` Overloads the left shift operator to provide an easy way to append objects to a Collection.
    `<T>` | `public static List<T>` | `leftShift(List<T> self, T value)` Overloads the left shift operator to provide an easy way to append objects to a List.
    `<T>` | `public static Set<T>` | `leftShift(Set<T> self, T value)` Overloads the left shift operator to provide an easy way to append objects to a Set.
    `<T>` | `public static SortedSet<T>` | `leftShift(SortedSet<T> self, T value)` Overloads the left shift operator to provide an easy way to append objects to a SortedSet.
    `<T>` | `public static BlockingQueue<T>` | `leftShift(BlockingQueue<T> self, T value)` Overloads the left shift operator to provide an easy way to append objects to a BlockingQueue.
    `<K, V>` | `public static Map<K, V>` | `leftShift(Map<K, V> self, Map.Entry<K, V> entry)` Overloads the left shift operator to provide an easy way to append Map.Entry values to a Map.
    `<K, V>` | `public static Map<K, V>` | `leftShift(Map<K, V> self, Map<K, V> other)` Overloads the left shift operator to provide an easy way to put one maps entries into another map.
    `` | `public static Number` | `leftShift(Number self, Number operand)` Implementation of the left shift operator for integral types.
    `` | `public static BitSet` | `leftShift(BitSet self, Number operand)` Implementation of the left shift operator for BitSets, returning a new BitSet and leaving the original unchanged.
    `<T>` | `public static T` | `max(Iterable<T> self)` Adds max() method to Iterable objects.
    `<T>` | `public static T` | `max(Iterator<T> self)` Adds max() method to Iterator objects.
    `<T>` | `public static T` | `max(Iterable<T> self, Comparator<? super T> comparator)` Selects the maximum value found in the Iterable using the given comparator.
    `<T>` | `public static T` | `max(Iterator<T> self, Comparator<? super T> comparator)` Selects the maximum value found from the Iterator using the given comparator.
    `<T>` | `public static T` | `max(Iterable<T> self, Closure closure)` Selects the item in the iterable which when passed as a parameter to the supplied closure returns the maximum value.
    `<T>` | `public static T` | `max(Iterator<T> self, Closure closure)` Selects the maximum value found from the Iterator using the closure to determine the correct ordering.
    `<K, V>` | `public static Map.Entry<K, V>` | `max(Map<K, V> self, Closure closure)` Selects an entry in the map having the maximum calculated value as determined by the supplied closure.
    `` | `public static int` | `max(int[] self)`
    `` | `public static long` | `max(long[] self)`
    `` | `public static double` | `max(double[] self)`
    `<T>` | `public static T` | `max(T[] self)`
    `<T>` | `public static T` | `max(T[] self, Comparator<? super T> comparator)`
    `<T>` | `public static T` | `max(T[] self, Closure closure)`
    `` | `public static MetaClass` | `metaClass(Class self, Closure closure)` Sets/updates the metaclass for a given class to a closure.
    `` | `public static MetaClass` | `metaClass(Object self, Closure closure)` Sets/updates the metaclass for a given object to a closure.
    `<T>` | `public static T` | `min(Iterable<T> self)` Adds min() method to Collection objects.
    `<T>` | `public static T` | `min(Iterator<T> self)` Adds min() method to Iterator objects.
    `<T>` | `public static T` | `min(Iterable<T> self, Comparator<? super T> comparator)` Selects the minimum value found in the Iterable using the given comparator.
    `<T>` | `public static T` | `min(Iterator<T> self, Comparator<? super T> comparator)` Selects the minimum value found from the Iterator using the given comparator.
    `<T>` | `public static T` | `min(Iterable<T> self, Closure closure)` Selects the item in the iterable which when passed as a parameter to the supplied closure returns the minimum value.
    `<T>` | `public static T` | `min(Iterator<T> self, Closure closure)` Selects the minimum value found from the Iterator using the closure to determine the correct ordering.
    `<K, V>` | `public static Map.Entry<K, V>` | `min(Map<K, V> self, Closure closure)` Selects an entry in the map having the minimum calculated value as determined by the supplied closure.
    `` | `public static int` | `min(int[] self)`
    `` | `public static long` | `min(long[] self)`
    `` | `public static double` | `min(double[] self)`
    `<T>` | `public static T` | `min(T[] self)`
    `<T>` | `public static T` | `min(T[] self, Comparator<? super T> comparator)`
    `<T>` | `public static T` | `min(T[] self, Closure closure)`
    `<T>` | `public static Set<T>` | `minus(Set<T> self, Collection<?> removeMe)` Create a Set composed of the elements of the first Set minus the elements of the given Collection.
    `<T>` | `public static Set<T>` | `minus(Set<T> self, Iterable<?> removeMe)` Create a Set composed of the elements of the first Set minus the elements from the given Iterable.
    `<T>` | `public static Set<T>` | `minus(Set<T> self, Object removeMe)` Create a Set composed of the elements of the first Set minus the given element.
    `<T>` | `public static SortedSet<T>` | `minus(SortedSet<T> self, Collection<?> removeMe)` Create a SortedSet composed of the elements of the first SortedSet minus the elements of the given Collection.
    `<T>` | `public static SortedSet<T>` | `minus(SortedSet<T> self, Iterable<?> removeMe)` Create a SortedSet composed of the elements of the first SortedSet minus the elements of the given Iterable.
    `<T>` | `public static SortedSet<T>` | `minus(SortedSet<T> self, Object removeMe)` Create a SortedSet composed of the elements of the first SortedSet minus the given element.
    `<T>` | `public static List<T>` | `minus(List<T> self, Collection<?> removeMe)` Create a List composed of the elements of the given List minus every occurrence of elements of the given Collection.
    `<T>` | `public static Collection<T>` | `minus(Collection<T> self, Collection<?> removeMe)` Create a new Collection composed of the elements of the first Collection minus every occurrence of elements of the given Collection.
    `<T>` | `public static List<T>` | `minus(List<T> self, Iterable<?> removeMe)` Create a new List composed of the elements of the first List minus every occurrence of elements of the given Iterable.
    `<T>` | `public static Collection<T>` | `minus(Iterable<T> self, Iterable<?> removeMe)` Create a new Collection composed of the elements of the first Iterable minus every occurrence of elements of the given Iterable.
    `<T>` | `public static Collection<T>` | `minus(Iterable<T> self, Iterable<?> removeMe, Closure condition)` Create a new Collection composed of the elements of the first Iterable minus every matching occurrence as determined by the condition closure of elements of the given Iterable.
    `<T>` | `public static Collection<T>` | `minus(Iterable<T> self, Iterable<?> removeMe, Comparator<? super T> comparator)` Create a new Collection composed of the elements of the first Iterable minus every matching occurrence as determined by the condition comparator of elements of the given Iterable.
    `<T>` | `public static List<T>` | `minus(List<T> self, Object removeMe)` Create a new List composed of the elements of the first List minus every occurrence of the given element to remove.
    `<T>` | `public static Collection<T>` | `minus(Iterable<T> self, Object removeMe)` Create a new Collection composed of the elements of the first Iterable minus every occurrence of the given element to remove.
    `<K, V>` | `public static Map<K, V>` | `minus(Map<K, V> self, Map removeMe)` Create a Map composed of the entries of the first map minus the entries of the given map.
    `` | `public static Number` | `minus(Character left, Number right)` Subtract a Number from a Character.
    `` | `public static Number` | `minus(Number left, Character right)` Subtract a Character from a Number.
    `` | `public static Number` | `minus(Character left, Character right)` Subtract one Character from another.
    `<T>` | `public static T[]` | `minus(T[] self, Iterable removeMe)`
    `<T>` | `public static T[]` | `minus(T[] self, Object[] removeMe)`
    `<T>` | `public static T[]` | `minus(T[] self, Object removeMe)`
    `` | `public static void` | `mixin(MetaClass self, List<Class> categoryClasses)` Extend object with category methods.
    `` | `public static void` | `mixin(Class self, List<Class> categoryClasses)` Extend class globally with category methods.
    `` | `public static void` | `mixin(Class self, Class categoryClass)` Extend class globally with category methods.
    `` | `public static void` | `mixin(Class self, Class[] categoryClass)` Extend class globally with category methods.
    `` | `public static void` | `mixin(MetaClass self, Class categoryClass)` Extend class globally with category methods.
    `` | `public static void` | `mixin(MetaClass self, Class[] categoryClass)` Extend class globally with category methods.
    `` | `public static Number` | `mod(Number left, Number right)` Performs a division modulus operation.
    `<T>` | `public static Collection<T>` | `multiply(Iterable<T> self, Number factor)` Create a Collection composed of the elements of this Iterable, repeated a certain number of times.
    `<T>` | `public static List<T>` | `multiply(List<T> self, Number factor)` Create a List composed of the elements of this Iterable, repeated a certain number of times.
    `` | `public static Number` | `multiply(Character left, Number right)` Multiply a Character by a Number.
    `` | `public static Number` | `multiply(Number left, Character right)` Multiply a Number by a Character.
    `` | `public static Number` | `multiply(Character left, Character right)` Multiply two Characters.
    `` | `public static Number` | `multiply(BigDecimal left, Double right)` Multiply a BigDecimal and a Double.
    `` | `public static Number` | `multiply(BigDecimal left, BigInteger right)` Multiply a BigDecimal and a BigInteger.
    `<T>` | `public static T` | `newInstance(Class<T> c)` Convenience method to dynamically create a new instance of this class.
    `<T>` | `public static T` | `newInstance(Class<T> c, Object[] args)` Helper to construct a new instance from the given arguments.
    `` | `public T` | `next()`
    `` | `public static Character` | `next(Character self)` Increment a Character by one.
    `` | `public static Number` | `next(Number self)` Increment a Number by one.
    `` | `public static int` | `numberAwareCompareTo(Comparable self, Comparable other)` Provides a method that compares two comparables using Groovy's default number aware comparator.
    `` | `public static Number` | `or(Number left, Number right)` Bitwise OR together two numbers.
    `` | `public static BitSet` | `or(BitSet left, BitSet right)` Bitwise OR together two BitSets.
    `` | `public static Boolean` | `or(Boolean left, Boolean right)` Logical disjunction of two boolean operators
    `<T>` | `public static Set<T>` | `or(Set<T> left, Iterable<T> right)` Create a Set as a union of a Set and an Iterable.
    `<T>` | `public static SortedSet<T>` | `or(SortedSet<T> left, Iterable<T> right)` Create a SortedSet as a union of a SortedSet and an Iterable.
    `<T>` | `public static int` | `partitionPoint(List<T> self, IntRange range, Predicate<T> condition)` Returns the index of the partition point according to the given predicate (the index of the first element of the second partition).
    `<T>` | `public static int` | `partitionPoint(List<T> self, Predicate<T> condition)` Returns the index of the partition point according to the given predicate (the index of the first element of the second partition).
    `<T>` | `public static Set<List<T>>` | `permutations(Iterable<T> self)` Finds all permutations of an iterable.
    `<T, V>` | `public static List<V>` | `permutations(Iterable<T> self, Closure<V> function)` Finds all permutations of an iterable, applies a function to each permutation and collects the result into a list.
    `<T>` | `public static Collection<T>` | `plus(Collection<T> left, Collection<T> right)` Create a Collection as a union of two collections.
    `<T>` | `public static Collection<T>` | `plus(Iterable<T> left, Iterable<T> right)` Create a Collection as a union of two iterables.
    `<T>` | `public static Collection<T>` | `plus(Collection<T> left, Iterable<T> right)` Create a Collection as a union of a Collection and an Iterable.
    `<T>` | `public static List<T>` | `plus(List<T> left, Iterable<T> right)` Create a List as a union of a List and an Iterable.
    `<T>` | `public static List<T>` | `plus(List<T> left, Collection<T> right)` Create a List as a union of a List and a Collection.
    `<T>` | `public static Set<T>` | `plus(Set<T> left, Iterable<T> right)` Create a Set as a union of a Set and an Iterable.
    `<T>` | `public static Set<T>` | `plus(Set<T> left, Collection<T> right)` Create a Set as a union of a Set and a Collection.
    `<T>` | `public static SortedSet<T>` | `plus(SortedSet<T> left, Iterable<T> right)` Create a SortedSet as a union of a SortedSet and an Iterable.
    `<T>` | `public static SortedSet<T>` | `plus(SortedSet<T> left, Collection<T> right)` Create a SortedSet as a union of a SortedSet and a Collection.
    `<T>` | `public static List<T>` | `plus(List<T> self, int index, T[] items)` Creates a new List by inserting all the elements in the specified array to the elements from the original List at the specified index.
    `<T>` | `public static List<T>` | `plus(List<T> self, int index, List<T> additions)` Creates a new List by inserting all the elements in the given additions List to the elements from the original List at the specified index.
    `<T>` | `public static List<T>` | `plus(List<T> self, int index, Iterable<T> additions)` Creates a new List by inserting all the elements in the given Iterable to the elements from this List at the specified index.
    `<T>` | `public static Collection<T>` | `plus(Collection<T> left, T right)` Create a collection as a union of a Collection and an Object.
    `<T>` | `public static Collection<T>` | `plus(Iterable<T> left, T right)` Create a collection as a union of an Iterable and an Object.
    `<T>` | `public static List<T>` | `plus(List<T> left, T right)` Create a List as a union of a List and an Object.
    `<T>` | `public static Set<T>` | `plus(Set<T> left, T right)` Create a Set as a union of a Set and an Object.
    `<T>` | `public static SortedSet<T>` | `plus(SortedSet<T> left, T right)` Create a SortedSet as a union of a SortedSet and an Object.
    `<K, V>` | `public static Map<K, V>` | `plus(Map<K, V> left, Map<K, V> right)` Returns a new `Map` containing all entries from `left` and `right`, giving precedence to `right`.
    `<K, V>` | `public static Map<K, V>` | `plus(Map<K, V> self, Collection<? extends Map.Entry<? extends K, ? extends V>> entries)` Returns a new `Map` containing all entries from `self` and `entries`, giving precedence to `entries`.
    `` | `public static Number` | `plus(Character left, Number right)` Add a Character and a Number.
    `` | `public static Number` | `plus(Number left, Character right)` Add a Number and a Character.
    `` | `public static Number` | `plus(Character left, Character right)` Add one Character to another.
    `` | `public static String` | `plus(Map left, String right)` Appends a String to the literal of the Map instance.
    `` | `public static String` | `plus(Map left, GString right)` Appends a GString to the literal of the Map instance.
    `<T>` | `public static Iterator<T>` | `plus(Iterator<T> left, Iterator<T> right)` Appends two iterators.
    `<T>` | `public static T[]` | `plus(T[] left, Collection<?> right)`
    `<T>` | `public static T[]` | `plus(T[] left, Iterable<?> right)`
    `<T>` | `public static T[]` | `plus(T[] left, Object[] right)`
    `<T>` | `public static T[]` | `plus(T[] left, Object right)`
    `<T>` | `public static T` | `pop(List<T> self)` Removes the initial item from the List.
    `` | `public static Number` | `power(Number self, Number exponent)` Power of a Number to a certain exponent.
    `` | `public static Number` | `power(BigDecimal self, Integer exponent)` Power of a BigDecimal to an integer certain exponent.
    `` | `public static Number` | `power(BigInteger self, Integer exponent)` Power of a BigInteger to an integer certain exponent.
    `` | `public static Number` | `power(Integer self, Integer exponent)` Power of an integer to an integer certain exponent.
    `` | `public static Number` | `power(Long self, Integer exponent)` Power of a long to an integer certain exponent.
    `` | `public static BigInteger` | `power(BigInteger self, BigInteger exponent)` Power of a BigInteger to a BigInteger certain exponent.
    `` | `public static Character` | `previous(Character self)` Decrement a Character by one.
    `` | `public static Number` | `previous(Number self)` Decrement a Number by one.
    `` | `protected static Object` | `primitiveArrayGet(Object self, int idx)` Implements the getAt(int) method for primitive type arrays.
    `` | `protected static List` | `primitiveArrayGet(Object self, Range range)` Implements the getAt(Range) method for primitive type arrays.
    `` | `protected static List` | `primitiveArrayGet(Object self, Collection indices)` Implements the getAt(Collection) method for primitive type arrays.
    `` | `protected static Object` | `primitiveArrayPut(Object self, int idx, Object newValue)` Implements the putAt(int) method for primitive type arrays.
    `` | `public static void` | `print(Object self, Object value)` Print a value formatted Groovy style to self if it is a Writer, otherwise to the standard output stream.
    `` | `public static void` | `print(PrintWriter self, Object value)` Print a value formatted Groovy style to the print writer.
    `` | `public static void` | `print(PrintStream self, Object value)` Print a value formatted Groovy style to the print stream.
    `` | `public static void` | `print(Object self, PrintWriter out)` Print to a console in interactive format.
    `` | `public static void` | `print(Closure self, Object value)` Print a value to the standard output stream.
    `` | `public static void` | `printf(Object self, String format, Object[] values)` Printf to the standard output stream.
    `` | `public static void` | `printf(Closure self, String format, Object[] values)` Printf 0 or more values to the standard output stream using a format string.
    `` | `public static void` | `printf(Closure self, String format, Object value)` Printf a value to the standard output stream using a format string.
    `` | `public static void` | `printf(Object self, String format, Object arg)` Prints a formatted string using the specified format string and arguments.
    `` | `public static void` | `println(Object self)` Print a linebreak to the standard output stream.
    `` | `public static void` | `println(Closure self)` Print a linebreak to the standard output stream.
    `` | `public static void` | `println(Object self, Object value)` Print a value formatted Groovy style (followed by a newline) to self if it is a Writer, otherwise to the standard output stream.
    `` | `public static void` | `println(PrintWriter self, Object value)` Print a value formatted Groovy style (followed by a newline) to the print writer.
    `` | `public static void` | `println(PrintStream self, Object value)` Print a value formatted Groovy style (followed by a newline) to the print stream.
    `` | `public static void` | `println(Closure self, Object value)` Print a value (followed by a newline) to the standard output stream.
    `` | `public static void` | `println(Object self, PrintWriter out)` Print to a console in interactive format.
    `<T>` | `public static boolean` | `push(List<T> self, T value)` Prepends an item to the start of the List.
    `<K, V>` | `public static Map<K, V>` | `putAll(Map<K, V> self, Collection<? extends Map.Entry<? extends K, ? extends V>> entries)` Provides an easy way to append multiple Map.Entry values to a Map.
    `` | `public static void` | `putAt(Object self, String property, Object newValue)` Allows the subscript operator to be used to set dynamically named property values.
    `<T>` | `public static void` | `putAt(List<T> self, int idx, T value)` A helper method to allow lists to work with subscript operators.
    `<T>` | `public static void` | `putAt(List<T> self, Number idx, T value)` Support subscript operator for list modification.
    `` | `public static void` | `putAt(List self, EmptyRange range, Object value)` A helper method to allow lists to work with subscript operators.
    `` | `public static void` | `putAt(List self, EmptyRange range, Collection value)` A helper method to allow lists to work with subscript operators.
    `` | `public static void` | `putAt(List self, IntRange range, Collection col)` List subscript assignment operator when given a range as the index and the assignment operand is a collection.
    `` | `public static void` | `putAt(List self, IntRange range, Object value)` List subscript assignment operator when given a range as the index.
    `` | `public static void` | `putAt(List self, List splice, Collection values)` A helper method to allow lists to work with subscript operators.
    `` | `public static void` | `putAt(List self, List splice, Object value)` A helper method to allow lists to work with subscript operators.
    `<K, V>` | `public static V` | `putAt(Map<K, V> self, K key, V value)` A helper method to allow maps to work with subscript operators
    `` | `public static void` | `putAt(BitSet self, IntRange range, boolean value)` Support assigning a range of values with a single assignment statement.
    `` | `public static void` | `putAt(BitSet self, int index, boolean value)` Support subscript-style assignment for a BitSet.
    `` | `public static void` | `putAt(List self, List splice, List values)`
    `` | `public static Number` | `remainder(Number left, Number right)` Performs a division modulus operation.
    `` | `public void` | `remove()`
    `` | `public static boolean` | `removeAll(Collection self, Object[] items)` Modifies this collection by removing its elements that are contained within the specified object array.
    `<T>` | `public static boolean` | `removeAll(Collection<T> self, Closure condition)` Modifies this collection by removing the elements that are matched according to the specified closure condition.
    `<K, V>` | `public static boolean` | `removeAll(Map<K, V> self, Closure condition)` Modifies this map by removing the elements that are matched according to the specified closure condition.
    `<E>` | `public static E` | `removeAt(List<E> self, int index)` Modifies this list by removing the element at the specified position in this list.
    `<E>` | `public static boolean` | `removeElement(Collection<E> self, Object o)` Modifies this collection by removing a single instance of the specified element from this collection, if it is present.
    `<T>` | `public static T` | `removeLast(List<T> self)` Removes the last item from the List.
    `<T>` | `public static Collection<T>` | `repeat(Iterable<T> self, int count)` Repeat the elements from an iterable.
    `<T>` | `public static Iterator<T>` | `repeat(Iterable<T> self)` Repeat the elements from an iterable infinitely.
    `<T>` | `public static Iterator<T>` | `repeat(Iterator<T> self, int count)` Repeat the elements from an iterator.
    `<T>` | `public static Iterator<T>` | `repeat(Iterator<T> self)` Repeat the elements from an iterator infinitely.
    `` | `public static List<MetaMethod>` | `respondsTo(Object self, String name, Object[] argTypes)`
    `` | `public static List<MetaMethod>` | `respondsTo(Object self, String name)`
    `` | `public static boolean` | `retainAll(Collection self, Object[] items)` Modifies this collection so that it retains only its elements that are contained in the specified array.
    `<T>` | `public static boolean` | `retainAll(Collection<T> self, Closure condition)` Modifies this collection so that it retains only its elements that are matched according to the specified closure condition.
    `<K, V>` | `public static boolean` | `retainAll(Map<K, V> self, Closure condition)` Modifies this map so that it retains only its elements that are matched according to the specified closure condition.
    `<T>` | `public static List<T>` | `reverse(List<T> self)` Creates a new List with the identical contents to this list but in reverse order.
    `<T>` | `public static List<T>` | `reverse(List<T> self, boolean mutate)` Reverses the elements in a list.
    `<T>` | `public static Iterator<T>` | `reverse(Iterator<T> self)` Reverses the iterator.
    `<T>` | `public static T[]` | `reverse(T[] self)`
    `<T>` | `public static T[]` | `reverse(T[] self, boolean mutate)`
    `<K, V>` | `public static Map<K, V>` | `reverseEach(Map<K, V> self, Closure<?> closure)` Allows a Map to be iterated through in reverse order using a closure.
    `<T>` | `public static List<T>` | `reverseEach(List<T> self, Closure closure)` Iterate over each element of the list in the reverse order.
    `<T>` | `public static NavigableSet<T>` | `reverseEach(NavigableSet<T> self, Closure closure)` Iterate over each element of the set in reverse order.
    `<T>` | `public static T[]` | `reverseEach(T[] self, Closure closure)`
    `` | `public static Number` | `rightShift(Number self, Number operand)` Implementation of the right shift operator for integral types.
    `` | `public static BitSet` | `rightShift(BitSet self, Number operand)` Implementation of the right shift operator for BitSets, returning a new BitSet and leaving the original unchanged.
    `` | `public static Number` | `rightShiftUnsigned(Number self, Number operand)` Implementation of the right shift (unsigned) operator for integral types.
    `` | `public static BitSet` | `rightShiftUnsigned(BitSet self, Number operand)` Implementation of the right shift (unsigned) operator for BitSets, returning a new BitSet and leaving the original unchanged.
    `` | `public static int` | `round(Float number)` Round the value
    `` | `public static float` | `round(Float number, int precision)` Round the value
    `` | `public static long` | `round(Double number)` Round the value
    `` | `public static double` | `round(Double number, int precision)` Round the value
    `` | `public static BigDecimal` | `round(BigDecimal number)` Round the value
    `` | `public static BigDecimal` | `round(BigDecimal number, int precision)` Round the value
    `` | `public void` | `run()`
    `` | `public static TimerTask` | `runAfter(Timer timer, int delay, Closure closure)` Allows a simple syntax for using timers.
    `` | `public static void` | `setMetaClass(Class self, MetaClass metaClass)` Sets the metaclass for a given class.
    `` | `public static void` | `setMetaClass(Object self, MetaClass metaClass)` Sets the metaclass for an object.
    `` | `public static void` | `setMetaClass(GroovyObject self, MetaClass metaClass)` Sets the metaclass for a `GroovyObject`.
    `` | `public static void` | `shuffle(List<?> self)` Randomly reorders the elements of the specified list.
    `` | `public static void` | `shuffle(List<?> self, Random rnd)` Randomly reorders the elements of the specified list using the specified random instance as the source of randomness.
    `<T>` | `public static void` | `shuffle(T[] self)`
    `<T>` | `public static void` | `shuffle(T[] self, Random rnd)`
    `<T>` | `public static List<T>` | `shuffled(List<T> self)` Creates a new list containing the elements of the specified list but in a random order.
    `<T>` | `public static List<T>` | `shuffled(List<T> self, Random rnd)` Creates a new list containing the elements of the specified list but in a random order using the specified random instance as the source of randomness.
    `<T>` | `public static T[]` | `shuffled(T[] self)`
    `<T>` | `public static T[]` | `shuffled(T[] self, Random rnd)`
    `` | `public static int` | `size(Iterator self)` Provide the standard Groovy `size()` method for `Iterator`.
    `` | `public static int` | `size(Iterable self)` Provide the standard Groovy `size()` method for `Iterable`.
    `` | `public static int` | `size(boolean[] self)`
    `` | `public static int` | `size(byte[] self)`
    `` | `public static int` | `size(char[] self)`
    `` | `public static int` | `size(short[] self)`
    `` | `public static int` | `size(int[] self)`
    `` | `public static int` | `size(long[] self)`
    `` | `public static int` | `size(float[] self)`
    `` | `public static int` | `size(double[] self)`
    `` | `public static int` | `size(Object[] self)`
    `<T>` | `public static List<T>` | `sort(Iterable<T> self)` Sorts the Collection.
    `<T>` | `public static List<T>` | `sort(Iterable<T> self, boolean mutate)` Sorts the Iterable.
    `<K, V>` | `public static Map<K, V>` | `sort(Map<K, V> self, Closure closure)` Sorts the elements from the given map into a new ordered map using the closure as a comparator to determine the ordering.
    `<K, V>` | `public static Map<K, V>` | `sort(Map<K, V> self, Comparator<? super K> comparator)` Sorts the elements from the given map into a new ordered Map using the specified key comparator to determine the ordering.
    `<K, V>` | `public static Map<K, V>` | `sort(Map<K, V> self)` Sorts the elements from the given map into a new ordered Map using the natural ordering of the keys to determine the ordering.
    `<T>` | `public static Iterator<T>` | `sort(Iterator<T> self)` Sorts the given iterator items into a sorted iterator.
    `<T>` | `public static Iterator<T>` | `sort(Iterator<T> self, Comparator<? super T> comparator)` Sorts the given iterator items into a sorted iterator using the comparator.
    `<T>` | `public static List<T>` | `sort(Iterable<T> self, boolean mutate, Comparator<? super T> comparator)` Sorts the Iterable using the given Comparator.
    `<T>` | `public static List<T>` | `sort(List<T> self, IntRange range, boolean mutate, Comparator<? super T> comparator)` Sorts the Iterable using the given Comparator over the given index range.
    `<T>` | `public static List<T>` | `sort(List<T> self, IntRange range, Comparator<? super T> comparator)` Sorts the Iterable using the given Comparator over the given index range.
    `<T>` | `public static List<T>` | `sort(List<T> self, IntRange range, boolean mutate, Closure<?> closure)` Sorts elements in the given index range using the given Closure to determine the ordering.
    `<T>` | `public static List<T>` | `sort(List<T> self, IntRange range, Closure<?> closure)` A sort variant that takes an index range and always mutates the original list.
    `<T>` | `public static List<T>` | `sort(List<T> self, IntRange range)` A mutating sort variant that takes an index range.
    `<T>` | `public static Iterator<T>` | `sort(Iterator<T> self, Closure closure)` Sorts the given iterator items into a sorted iterator using the Closure to determine the correct ordering.
    `<T>` | `public static List<T>` | `sort(Iterable<T> self, Closure closure)` Sorts this Iterable using the given Closure to determine the correct ordering.
    `<T>` | `public static List<T>` | `sort(Iterable<T> self, boolean mutate, Closure closure)` Sorts this Iterable using the given Closure to determine the correct ordering.
    `<T>` | `public static SortedSet<T>` | `sort(SortedSet<T> self)` Avoids doing unnecessary work when sorting an already sorted set (i.e. an identity function for an already sorted set).
    `<K, V>` | `public static SortedMap<K, V>` | `sort(SortedMap<K, V> self)` Avoids doing unnecessary work when sorting an already sorted map (i.e. an identity function for an already sorted map).
    `<T>` | `public static T[]` | `sort(T[] self)`
    `<T>` | `public static T[]` | `sort(T[] self, boolean mutate)`
    `<T>` | `public static T[]` | `sort(T[] self, Comparator<? super T> comparator)`
    `<T>` | `public static T[]` | `sort(T[] self, boolean mutate, Comparator<? super T> comparator)`
    `<T>` | `public static T[]` | `sort(T[] self, Closure closure)`
    `<T>` | `public static T[]` | `sort(T[] self, boolean mutate, Closure closure)`
    `` | `public static Collection` | `split(Object self, Closure closure)` Splits all items into two lists based on the closure condition.
    `<T>` | `public static Collection<Collection<T>>` | `split(Collection<T> self, Closure closure)` Splits all items into two collections based on the closure condition.
    `<T>` | `public static List<List<T>>` | `split(List<T> self, Closure closure)` Splits all items into two collections based on the closure condition.
    `<T>` | `public static List<Set<T>>` | `split(Set<T> self, Closure closure)` Splits all items into two collections based on the closure condition.
    `<T>` | `public static Collection<Collection<T>>` | `split(T[] self, Closure closure)`
    `` | `public static SpreadMap` | `spread(Map self)` Synonym for toSpreadMap(java.util.Map).
    `` | `public static String` | `sprintf(Object self, String format, Object[] values)` Sprintf to a string.
    `` | `public static String` | `sprintf(Object self, String format, Object arg)` Returns a formatted string using the specified format string and arguments.
    `` | `public static void` | `step(Number self, Number to, Number stepNumber, Closure closure)` Iterates from this number up to the given number using a step increment.
    `<T>` | `public static List<T>` | `subList(List<T> self, IntRange range)` Returns a view of the portion of this list given by the specified range.
    `<K, V>` | `public static Map<K, V>` | `subMap(Map<K, V> map, Collection<K> keys)` Creates a sub-Map containing the given keys.
    `<K, V>` | `public static Map<K, V>` | `subMap(Map<K, V> map, K[] keys)` Creates a sub-Map containing the given keys.
    `<T>` | `public static Future<T>` | `submit(ExecutorService self, Closure<T> task)` Submits a value-returning task for execution and returns a Future representing the pending results of the task.
    `<T>` | `public static Set<List<T>>` | `subsequences(List<T> self)` Finds all non-null subsequences of a list.
    `` | `public static Object` | `sum(Iterable<?> self)` Sums the items in an Iterable.
    `` | `public static Object` | `sum(Iterator<Object> self)` Sums the items from an Iterator.
    `` | `public static Object` | `sum(Iterable<?> self, Object initialValue)` Sums the items in an Iterable, adding the result to some initial value.
    `` | `public static Object` | `sum(Iterator<?> self, Object initialValue)` Sums the items from an Iterator, adding the result to some initial value.
    `<T>` | `public static Object` | `sum(Iterable<T> self, Closure closure)` Sums the result of applying a closure to each item of an Iterable.
    `<T>` | `public static Object` | `sum(Iterator<T> self, Closure closure)` Sums the result of applying a closure to each item returned from an iterator.
    `<T>` | `public static Object` | `sum(Iterable<T> self, Object initialValue, Closure closure)` Sums the result of applying a closure to each item of an Iterable to some initial value.
    `<T>` | `public static Object` | `sum(Iterator<T> self, Object initialValue, Closure closure)` Sums the result of applying a closure to each item of an Iterator to some initial value.
    `` | `public static byte` | `sum(byte[] self)`
    `` | `public static char` | `sum(char[] self)`
    `` | `public static short` | `sum(short[] self)`
    `` | `public static int` | `sum(int[] self)`
    `` | `public static long` | `sum(long[] self)`
    `` | `public static float` | `sum(float[] self)`
    `` | `public static double` | `sum(double[] self)`
    `` | `public static Object` | `sum(Object[] self)`
    `` | `public static byte` | `sum(byte[] self, byte initialValue)`
    `` | `public static float` | `sum(float[] self, float initialValue)`
    `` | `public static short` | `sum(short[] self, short initialValue)`
    `` | `public static int` | `sum(int[] self, int initialValue)`
    `` | `public static long` | `sum(long[] self, long initialValue)`
    `` | `public static char` | `sum(char[] self, char initialValue)`
    `` | `public static double` | `sum(double[] self, double initialValue)`
    `` | `public static Object` | `sum(Object[] self, Object initialValue)`
    `<T>` | `public static Object` | `sum(T[] self, Closure closure)`
    `<T>` | `public static Object` | `sum(T[] self, Object initialValue, Closure closure)`
    `<T>` | `public static List<T>` | `swap(List<T> self, int i, int j)` Swaps two elements at the specified positions.
    `` | `public static boolean[]` | `swap(boolean[] self, int i, int j)`
    `` | `public static byte[]` | `swap(byte[] self, int i, int j)`
    `` | `public static char[]` | `swap(char[] self, int i, int j)`
    `` | `public static short[]` | `swap(short[] self, int i, int j)`
    `` | `public static int[]` | `swap(int[] self, int i, int j)`
    `` | `public static long[]` | `swap(long[] self, int i, int j)`
    `` | `public static float[]` | `swap(float[] self, int i, int j)`
    `` | `public static double[]` | `swap(double[] self, int i, int j)`
    `<T>` | `public static T[]` | `swap(T[] self, int i, int j)`
    `<T>` | `public static List<T>` | `tail(List<T> self)` Returns the items from the List excluding the first item.
    `<T>` | `public static SortedSet<T>` | `tail(SortedSet<T> self)` Returns the items from the SortedSet excluding the first item.
    `<T>` | `public static Collection<T>` | `tail(Iterable<T> self)` Returns the items from the Iterable excluding the first item.
    `<T>` | `public static Iterator<T>` | `tail(Iterator<T> self)` Returns the original iterator after throwing away the first element.
    `<T>` | `public static T[]` | `tail(T[] self)`
    `<T>` | `public static List<List<T>>` | `tails(Iterable<T> self)` Calculates the tail values of this Iterable: the first value will be this list of all items from the iterable and the final one will be an empty list, with the intervening values the results of successive applications of tail on the items.
    `<T>` | `public static List<T>` | `take(List<T> self, int num)` Returns the first `num` elements from the head of this List.
    `<T>` | `public static SortedSet<T>` | `take(SortedSet<T> self, int num)` Returns the first `num` elements from the head of this SortedSet.
    `<T>` | `public static Collection<T>` | `take(Iterable<T> self, int num)` Returns the first `num` elements from the head of this Iterable.
    `<K, V>` | `public static Map<K, V>` | `take(Map<K, V> self, int num)` Returns a new map containing the first `num` elements from the head of this map.
    `<T>` | `public static Iterator<T>` | `take(Iterator<T> self, int num)` Returns an iterator of up to the first `num` elements from this iterator.
    `<T>` | `public static T[]` | `take(T[] self, int num)`
    `<T>` | `public static Collection<T>` | `takeRight(Iterable<T> self, int num)` Returns the last `num` elements from the tail of this Iterable.
    `<T>` | `public static List<T>` | `takeRight(List<T> self, int num)` Returns the last `num` elements from the tail of this List.
    `<T>` | `public static SortedSet<T>` | `takeRight(SortedSet<T> self, int num)` Returns the last `num` elements from the tail of this SortedSet.
    `<T>` | `public static T[]` | `takeRight(T[] self, int num)`
    `<T>` | `public static List<T>` | `takeWhile(List<T> self, Closure condition)` Returns the longest prefix of this list where each element passed to the given closure condition evaluates to true.
    `<T>` | `public static Collection<T>` | `takeWhile(Iterable<T> self, Closure condition)` Returns a Collection containing the longest prefix of the elements from this Iterable where each element passed to the given closure evaluates to true.
    `<T>` | `public static SortedSet<T>` | `takeWhile(SortedSet<T> self, Closure condition)` Returns the longest prefix of this SortedSet where each element passed to the given closure condition evaluates to true.
    `<K, V>` | `public static Map<K, V>` | `takeWhile(Map<K, V> self, Closure condition)` Returns the longest prefix of this Map where each entry (or key/value pair) when passed to the given closure evaluates to true.
    `<T>` | `public static Iterator<T>` | `takeWhile(Iterator<T> self, Closure condition)` Returns the longest prefix of elements in this iterator where each element passed to the given condition closure evaluates to true.
    `<T>` | `public static T[]` | `takeWhile(T[] self, Closure condition)`
    `<T, U>` | `public static U` | `tap(U self, Closure<T> closure)` Allows the closure to be called for the object reference self (similar to `with`) and always returns self.
    `<T, U>` | `public static Iterator<U>` | `tapEvery(Iterator<U> self, int every, Closure<T> closure)` Allows the closure to be called for each (or some) elements in the iterator.
    `<T, U>` | `public static Iterator<U>` | `tapEvery(Iterator<U> self, Closure<T> closure)` Allows the closure to be called for each element in the iterator.
    `` | `public static void` | `times(Number self, Closure closure)` Executes the closure this many times, starting from zero.
    `` | `public static String` | `toArrayString(Object[] self)`
    `` | `public static BigDecimal` | `toBigDecimal(Number self)` Transforms a Number into a BigDecimal.
    `` | `public static BigInteger` | `toBigInteger(Number self)` Transforms this Number into a BigInteger.
    `` | `public static Boolean` | `toBoolean(Boolean self)` Identity conversion which returns Boolean.TRUE for a true Boolean and Boolean.FALSE for a false Boolean.
    `` | `public static Double` | `toDouble(Number self)` Transforms a Number into a Double.
    `` | `public static Float` | `toFloat(Number self)` Transforms a Number into a Float.
    `` | `public static Integer` | `toInteger(Number self)` Transforms a Number into an Integer.
    `<T>` | `public static List<T>` | `toList(Iterator<T> self)` Convert an iterator to a List.
    `<T>` | `public static List<T>` | `toList(Iterable<T> self)` Convert an Iterable to a List.
    `<T>` | `public static List<T>` | `toList(Enumeration<T> self)` Convert an enumeration to a List.
    `` | `public static List<Boolean>` | `toList(boolean[] self)`
    `` | `public static List<Byte>` | `toList(byte[] self)`
    `` | `public static List<Character>` | `toList(char[] self)`
    `` | `public static List<Short>` | `toList(short[] self)`
    `` | `public static List<Integer>` | `toList(int[] self)`
    `` | `public static List<Long>` | `toList(long[] self)`
    `` | `public static List<Float>` | `toList(float[] self)`
    `` | `public static List<Double>` | `toList(double[] self)`
    `<T>` | `public static List<T>` | `toList(T[] self)`
    `` | `public static String` | `toListString(Collection self)` Returns the string representation of the given list.
    `` | `public static String` | `toListString(Collection self, int maxSize)` Returns the string representation of the given list.
    `` | `public static Long` | `toLong(Number self)` Transforms a Number into a Long.
    `` | `public static char` | `toLowerCase(Character self)` Converts the character to lowercase.
    `` | `public static String` | `toMapString(Map self)` Returns the string representation of this map.
    `` | `public static String` | `toMapString(Map self, int maxSize)` Returns the string representation of this map.
    `<T>` | `public static Set<T>` | `toSet(Collection<T> self)` Convert a Collection to a Set.
    `<T>` | `public static Set<T>` | `toSet(Iterable<T> self)` Convert an Iterable to a Set.
    `<T>` | `public static Set<T>` | `toSet(Iterator<T> self)` Convert an iterator to a Set.
    `<T>` | `public static Set<T>` | `toSet(Enumeration<T> self)` Convert an enumeration to a Set.
    `` | `public static Set<Boolean>` | `toSet(boolean[] self)`
    `` | `public static Set<Byte>` | `toSet(byte[] self)`
    `` | `public static Set<Character>` | `toSet(char[] self)`
    `` | `public static Set<Short>` | `toSet(short[] self)`
    `` | `public static Set<Integer>` | `toSet(int[] self)`
    `` | `public static Set<Long>` | `toSet(long[] self)`
    `` | `public static Set<Float>` | `toSet(float[] self)`
    `` | `public static Set<Double>` | `toSet(double[] self)`
    `<T>` | `public static List<T>` | `toSorted(Iterable<T> self)` Sorts the Iterable.
    `<T>` | `public static List<T>` | `toSorted(Iterable<T> self, Comparator<? super T> comparator)` Sorts the Iterable using the given Comparator.
    `<T>` | `public static List<T>` | `toSorted(Iterable<T> self, Closure closure)` Sorts this Iterable using the given Closure to determine the correct ordering.
    `<T>` | `public static Iterator<T>` | `toSorted(Iterator<T> self)` Sorts the Iterator.
    `<T>` | `public static Iterator<T>` | `toSorted(Iterator<T> self, Comparator<? super T> comparator)` Sorts the given iterator items using the comparator.
    `<T>` | `public static Iterator<T>` | `toSorted(Iterator<T> self, Closure closure)` Sorts the given iterator items into a sorted iterator using the Closure to determine the correct ordering.
    `<T>` | `public static List<T>` | `toSorted(List<T> self, IntRange range, Closure<?> closure)` A sort variant that takes an index range and never modifies the original list.
    `<T>` | `public static List<T>` | `toSorted(List<T> self, IntRange range, Comparator<? super T> comparator)` Returns a list, sorted over the given range using a NumberAwareComparator, leaving the original list unmodified.
    `<T>` | `public static List<T>` | `toSorted(List<T> self, IntRange range)` Returns a list, sorted over the given range using a NumberAwareComparator, leaving the original list unmodified.
    `<K, V>` | `public static Map<K, V>` | `toSorted(Map<K, V> self)` Sorts the elements from the given map into a new ordered map using a NumberAwareComparator on map entry values to determine the resulting order.
    `<K, V>` | `public static Map<K, V>` | `toSorted(Map<K, V> self, Comparator<Map.Entry<K, V>> comparator)` Sorts the elements from the given map into a new ordered map using the supplied comparator to determine the ordering.
    `<K, V>` | `public static Map<K, V>` | `toSorted(Map<K, V> self, Closure condition)` Sorts the elements from the given map into a new ordered map using the supplied Closure condition as a comparator to determine the ordering.
    `<T>` | `public static Set<T>` | `toSorted(SortedSet<T> self)` Avoids doing unnecessary work when sorting an already sorted set
    `<K, V>` | `public static Map<K, V>` | `toSorted(SortedMap<K, V> self)` Avoids doing unnecessary work when sorting an already sorted map
    `<T>` | `public static T[]` | `toSorted(T[] self)`
    `<T>` | `public static T[]` | `toSorted(T[] self, Comparator<? super T> comparator)`
    `<T>` | `public static T[]` | `toSorted(T[] self, Closure closure)`
    `` | `public static SpreadMap` | `toSpreadMap(Map self)` Returns a new `SpreadMap` from this map.
    `` | `public static SpreadMap` | `toSpreadMap(List self)` Creates a spreadable map from this list.
    `` | `public static SpreadMap` | `toSpreadMap(Iterable self)` Creates a spreadable map from this iterable.
    `` | `public static SpreadMap` | `toSpreadMap(Object[] self)`
    `` | `public static String` | `toString(AbstractMap self)` Returns the string representation of the given map.
    `` | `public static String` | `toString(AbstractCollection self)` Returns the string representation of the given collection.
    `` | `public static String` | `toString(Object value)` Create a String representation of this object.
    `` | `public static String` | `toString(boolean[] self)`
    `` | `public static String` | `toString(byte[] self)`
    `` | `public static String` | `toString(char[] self)`
    `` | `public static String` | `toString(short[] self)`
    `` | `public static String` | `toString(int[] self)`
    `` | `public static String` | `toString(long[] self)`
    `` | `public static String` | `toString(float[] self)`
    `` | `public static String` | `toString(double[] self)`
    `` | `public static String` | `toString(Object[] self)`
    `<K, V>` | `public static Tuple2<K, V>` | `toTuple(Map.Entry<K, V> entry)` Create a Tuple from the key and value of this Map Entry.
    `<T>` | `public static Iterator<T>` | `toUnique(Iterator<T> self, Closure condition)` Returns an iterator equivalent to this iterator but with all duplicated items removed where duplicate (equal) items are deduced by calling the supplied Closure condition.
    `<T>` | `public static Iterator<T>` | `toUnique(Iterator<T> self, Comparator<? super T> comparator)` Returns an iterator equivalent to this iterator with all duplicated items removed by using the supplied comparator.
    `<T>` | `public static Iterator<T>` | `toUnique(Iterator<T> self)` Returns an iterator equivalent to this iterator with all duplicated items removed by using the natural ordering of the items.
    `<T>` | `public static Collection<T>` | `toUnique(Iterable<T> self, Comparator<? super T> comparator)` Returns a Collection containing the items from the Iterable but with duplicates removed.
    `<T>` | `public static List<T>` | `toUnique(List<T> self, Comparator<? super T> comparator)` Returns a List containing the items from the List but with duplicates removed.
    `<T>` | `public static Collection<T>` | `toUnique(Iterable<T> self)` Returns a Collection containing the items from the Iterable but with duplicates removed using the natural ordering of the items to determine uniqueness.
    `<T>` | `public static List<T>` | `toUnique(List<T> self)` Returns a List containing the items from the List but with duplicates removed using the natural ordering of the items to determine uniqueness.
    `<T>` | `public static Collection<T>` | `toUnique(Iterable<T> self, Closure condition)` Returns a Collection containing the items from the Iterable but with duplicates removed.
    `<T>` | `public static List<T>` | `toUnique(List<T> self, Closure condition)` Returns a List containing the items from the List but with duplicates removed.
    `<T>` | `public static T[]` | `toUnique(T[] self)`
    `<T>` | `public static T[]` | `toUnique(T[] self, Comparator<? super T> comparator)`
    `<T>` | `public static T[]` | `toUnique(T[] self, Closure closure)`
    `` | `public static char` | `toUpperCase(Character self)` Converts the character to uppercase.
    `` | `public static List` | `transpose(List self)` Adds GroovyCollections#transpose(List) as a method on lists.
    `` | `public static int` | `transpose(int self)`
    `` | `public static long` | `transpose(long self)`
    `` | `public static double` | `transpose(double self)`
    `` | `public static float` | `trunc(Float number, int precision)` Truncate the value
    `` | `public static float` | `trunc(Float number)` Truncate the value
    `` | `public static double` | `trunc(Double number)` Truncate the value
    `` | `public static double` | `trunc(Double number, int precision)` Truncate the value
    `` | `public static BigDecimal` | `trunc(BigDecimal number)` Truncate the value
    `` | `public static BigDecimal` | `trunc(BigDecimal number, int precision)` Truncate the value
    `` | `public static Number` | `unaryMinus(Number left)` Negates the number.
    `` | `public static Number` | `unaryPlus(Number left)` Returns the number, effectively being a noop for numbers.
    `<T>` | `public static Collection<T>` | `union(Collection<T> left, Collection<T> right)` Create a Collection composed of the union of both collections.
    `<T>` | `public static Collection<T>` | `union(Collection<T> left, Collection<T> right, Comparator<? super T> comparator)` Create a Collection composed of the union of both collections.
    `<T>` | `public static Collection<T>` | `union(Iterable<T> left, Iterable<T> right)` Create a Collection composed of the union of both iterables.
    `<T>` | `public static Collection<T>` | `union(Iterable<T> left, Iterable<T> right, Comparator<? super T> comparator)` Create a Collection composed of the union of both iterables.
    `<T>` | `public static Collection<T>` | `union(Iterable<T> left, Iterable<T> right, Closure condition)` Create a Collection composed of the union of both iterables.
    `<T>` | `public static List<T>` | `union(List<T> left, Iterable<T> right)` Create a List composed of the union of a List and an Iterable.
    `<T>` | `public static List<T>` | `union(List<T> left, Iterable<T> right, Comparator<? super T> comparator)` Create a List composed of the union of a List and an Iterable.
    `<T>` | `public static Set<T>` | `union(Set<T> left, Iterable<T> right)` Create a Set composed of the union of a Set and an Iterable.
    `<T>` | `public static Set<T>` | `union(Set<T> left, Iterable<T> right, Comparator<? super T> comparator)` Create a Set composed of the union of a Set and an Iterable.
    `<T>` | `public static SortedSet<T>` | `union(SortedSet<T> left, Iterable<T> right)` Create a SortedSet composed of the union of a SortedSet and an Iterable.
    `<T>` | `public static SortedSet<T>` | `union(SortedSet<T> left, Iterable<T> right, Comparator<? super T> comparator)` Create a SortedSet composed of the intersection of a SortedSet and an Iterable.
    `` | `public static Object[]` | `union(Object[] left, Collection<?> right)`
    `` | `public static Object[]` | `union(Object[] left, Iterable<?> right)`
    `` | `public static Object[]` | `union(Object[] left, Object[] right)`
    `` | `public static Object[]` | `union(Object[] left, Object right)`
    `<T>` | `public static Iterator<T>` | `unique(Iterator<T> self)` Returns an iterator equivalent to this iterator with all duplicated items removed by using Groovy's default number-aware comparator.
    `<T>` | `public static Collection<T>` | `unique(Collection<T> self)` Modifies this collection to remove all duplicated items, using Groovy's default number-aware comparator.
    `<T>` | `public static List<T>` | `unique(List<T> self)` Modifies this List to remove all duplicated items, using Groovy's default number-aware comparator.
    `<T>` | `public static Collection<T>` | `unique(Collection<T> self, boolean mutate)` Remove all duplicates from a given Collection using Groovy's default number-aware comparator.
    `<T>` | `public static List<T>` | `unique(List<T> self, boolean mutate)` Remove all duplicates from a given List using Groovy's default number-aware comparator.
    `<T>` | `public static Iterator<T>` | `unique(Iterator<T> self, Closure condition)` Returns an iterator equivalent to this iterator but with all duplicated items removed by using a Closure to determine duplicate (equal) items.
    `<T>` | `public static Collection<T>` | `unique(Collection<T> self, Closure closure)` A convenience method for making a collection unique using a Closure to determine duplicate (equal) items.
    `<T>` | `public static List<T>` | `unique(List<T> self, Closure closure)` A convenience method for making a List unique using a Closure to determine duplicate (equal) items.
    `<T>` | `public static Collection<T>` | `unique(Collection<T> self, boolean mutate, Closure closure)` A convenience method for making a collection unique using a Closure to determine duplicate (equal) items.
    `<T>` | `public static List<T>` | `unique(List<T> self, boolean mutate, Closure closure)` A convenience method for making a List unique using a Closure to determine duplicate (equal) items.
    `<T>` | `public static Iterator<T>` | `unique(Iterator<T> self, Comparator<? super T> comparator)` Returns an iterator equivalent to this iterator with all duplicated items removed by using the supplied comparator.
    `<T>` | `public static Collection<T>` | `unique(Collection<T> self, Comparator<? super T> comparator)` Remove all duplicates from a given Collection.
    `<T>` | `public static List<T>` | `unique(List<T> self, Comparator<? super T> comparator)` Remove all duplicates from a given List.
    `<T>` | `public static Collection<T>` | `unique(Collection<T> self, boolean mutate, Comparator<? super T> comparator)` Remove all duplicates from a given Collection.
    `<T>` | `public static List<T>` | `unique(List<T> self, boolean mutate, Comparator<? super T> comparator)` Remove all duplicates from a given List.
    `` | `public static void` | `upto(Number self, Number to, Closure closure)` Iterates from this number up to the given number, inclusive, incrementing by one each time.
    `` | `public static void` | `upto(long self, Number to, Closure closure)` Iterates from this number up to the given number, inclusive, incrementing by one each time.
    `` | `public static void` | `upto(Long self, Number to, Closure closure)` Iterates from this number up to the given number, inclusive, incrementing by one each time.
    `` | `public static void` | `upto(float self, Number to, Closure closure)` Iterates from this number up to the given number, inclusive, incrementing by one each time.
    `` | `public static void` | `upto(Float self, Number to, Closure closure)` Iterates from this number up to the given number, inclusive, incrementing by one each time.
    `` | `public static void` | `upto(double self, Number to, Closure closure)` Iterates from this number up to the given number, inclusive, incrementing by one each time.
    `` | `public static void` | `upto(Double self, Number to, Closure closure)` Iterates from this number up to the given number, inclusive, incrementing by one each time.
    `` | `public static void` | `upto(BigInteger self, Number to, Closure closure)` Iterates from this number up to the given number, inclusive, incrementing by one each time.
    `` | `public static void` | `upto(BigDecimal self, Number to, Closure closure)` Iterates from this number up to the given number, inclusive, incrementing by one each time.
    `<T>` | `public static T` | `use(Object self, Class categoryClass, Closure<T> closure)` Scoped use method
    `<T>` | `public static T` | `use(Object self, List<Class> categoryClassList, Closure<T> closure)` Scoped use method with list of categories.
    `` | `public static Object` | `use(Object self, Object[] array)` Allows you to use a list of categories, specifying the list as varargs.
    `<T, U>` | `public static T` | `with(U self, Closure<T> closure)` Allows the closure to be called for the object reference self.
    `<T, U extends T, V extends T>` | `public static T` | `with(U self, boolean returnIt, Closure<V> closure)` Allows the closure to be called for the object reference self.
    `<K, V>` | `public static Map<K, V>` | `withCollectedKeys(Iterator<V> values, Map<K, V> collector, Function<? super V, K> keyTransform)` A variant of withCollectedKeys for Iterators.
    `<K, V>` | `public static Map<K, V>` | `withCollectedKeys(Iterator<V> values, Function<? super V, K> keyTransform)` A variant of withCollectedKeys for Iterators.
    `<K, V>` | `public static Map<K, V>` | `withCollectedKeys(Iterable<V> values, Map<K, V> collector, Function<? super V, K> keyTransform)` Transform Iterable elements into Map entries with values unchanged and keys transformed using the supplied function.
    `<K, V>` | `public static Map<K, V>` | `withCollectedKeys(Iterable<V> values, Function<? super V, K> keyTransform)` Transform Iterable elements into Map entries with values unchanged and keys transformed using the supplied function.
    `<K, V>` | `public static Map<K, V>` | `withCollectedValues(Iterator<K> keys, Map<K, V> collector, Function<? super K, V> valueTransform)` A variant of withCollectedValues for Iterators.
    `<K, V>` | `public static Map<K, V>` | `withCollectedValues(Iterator<K> keys, Function<? super K, V> valueTransform)` A variant of withCollectedValues for Iterators.
    `<K, V>` | `public static Map<K, V>` | `withCollectedValues(Iterable<K> keys, Map<K, V> collector, Function<? super K, V> valueTransform)` Transform Iterable elements into Map entries with keys unchanged and values transformed using the supplied function.
    `<K, V>` | `public static Map<K, V>` | `withCollectedValues(Iterable<K> keys, Function<? super K, V> valueTransform)` Transform Iterable elements into Map entries with keys unchanged and values transformed using the supplied function.
    `<K, V>` | `public static Map<K, V>` | `withDefault(Map<K, V> self, Closure<V> init)` Wraps a map using the decorator pattern with a wrapper that intercepts all calls to `get(key)`.
    `<K, V>` | `public static Map<K, V>` | `withDefault(Map<K, V> self, boolean autoGrow, boolean autoShrink, Closure<V> init)` Wraps a map using the decorator pattern with a wrapper that intercepts all calls to `get(key)` and `put(key, value)`.
    `<T>` | `public static ListWithDefault<T>` | `withDefault(List<T> self, Closure<T> init)` An alias for `withLazyDefault` which decorates a list allowing it to grow when called with index values outside the normal list bounds.
    `<T>` | `public static List<T>` | `withDefault$$bridge(List<T> self, Closure<T> init)`
    `<T>` | `public static ListWithDefault<T>` | `withEagerDefault(List<T> self, Closure<T> init)` Decorates a list allowing it to grow when called with a non-existent index value.
    `<T>` | `public static List<T>` | `withEagerDefault$$bridge(List<T> self, Closure<T> init)`
    `<E>` | `public static List<Tuple2<E, Integer>>` | `withIndex(Iterable<E> self)` Zips an Iterable with indices in (value, index) order.
    `<E>` | `public static List<Tuple2<E, Integer>>` | `withIndex(Iterable<E> self, int offset)` Zips an Iterable with indices in (value, index) order.
    `<E>` | `public static Iterator<Tuple2<E, Integer>>` | `withIndex(Iterator<E> self)` Zips an iterator with indices in (value, index) order.
    `<E>` | `public static Iterator<Tuple2<E, Integer>>` | `withIndex(Iterator<E> self, int offset)` Zips an iterator with indices in (value, index) order.
    `<T>` | `public static ListWithDefault<T>` | `withLazyDefault(List<T> self, Closure<T> init)` Decorates a list allowing it to grow when called with a non-existent index value.
    `<T>` | `public static List<T>` | `withLazyDefault$$bridge(List<T> self, Closure<T> init)`
    `` | `public static Object` | `withMethodClosure(Object self, MethodClosure mc)` A utility method for calling a method closure on an object.
    `` | `public static Object` | `withTraits(Object self, Class<?> traits)` Dynamically wraps an instance into something which implements the supplied trait classes.
    `` | `public static Number` | `xor(Number left, Number right)` Bitwise XOR together two Numbers.
    `` | `public static BitSet` | `xor(BitSet left, BitSet right)` Bitwise XOR together two BitSets.
    `` | `public static Boolean` | `xor(Boolean left, Boolean right)` Exclusive disjunction of two boolean operators
    `<T>` | `public static Set<T>` | `xor(Set<T> left, Iterable<T> right)` Create a Set composed of the symmetric difference of a Set and an Iterable.
    `<T>` | `public static Set<T>` | `xor(Set<T> left, Iterable<T> right, Comparator<? super T> comparator)` Create a Set composed of the symmetric difference of a Set and an Iterable.
    `<T>` | `public static SortedSet<T>` | `xor(SortedSet<T> left, Iterable<T> right)` Create a SortedSet composed of the symmetric difference of a SortedSet and an Iterable.
    `<T>` | `public static SortedSet<T>` | `xor(SortedSet<T> left, Iterable<T> right, Comparator<? super T> comparator)` Create a SortedSet composed of the symmetric difference of a SortedSet and an Iterable.
    `<U, V>` | `public static List<Tuple2<U, V>>` | `zip(Iterable<U> self, Iterable<V> other)` A list of all the pairs from two Iterables.
    `<U, V>` | `public static Iterator<Tuple2<U, V>>` | `zip(Iterator<U> self, Iterator<V> other)` An iterator of all the pairs of two Iterators.
    `<U, V>` | `public static Collection<Tuple2<U, V>>` | `zipAll(Iterable<U> self, Iterable<V> other, U selfDefault, V otherDefault)` A collection of all the pairs of two Iterables of potentially different size.
    `<U, V>` | `public static Iterator<Tuple2<U, V>>` | `zipAll(Iterator<U> left, Iterator<V> right, U leftDefault, V rightDefault)` An iterator of all the pairs of two Iterators with potentially different numbers of elements.

  - ### Inherited Methods Summary

    Inherited Methods
    Methods inherited from class | Name
    --- | ---
    `class DefaultGroovyMethodsSupport` | `cloneSimilarCollection, cloneSimilarMap, closeQuietly, closeWithWarning, createSimilarArray, createSimilarCollection, createSimilarCollection, createSimilarCollection, createSimilarList, createSimilarMap, createSimilarOrDefaultCollection, createSimilarQueue, createSimilarSet, normaliseIndex, sameType, sameType, subListBorders, subListBorders, subListRange, writeUTF16BomIfRequired, writeUTF16BomIfRequired, writeUTF16BomIfRequired, writeUTF16BomIfRequired`

- - ### Field Detail

    - #### public static final Class[] ADDITIONAL_CLASSES

    - #### public static final Class[] DGM_LIKE_CLASSES

  - ### Method Detail

    - #### public static int abs(Number number)

      Gets the absolute value.

      Note: This method is NOT called if number is a BigInteger or BigDecimal, because those classes implement a method with a better exact match.

      Parameters:
        `number` - a Number
      Returns:
        the absolute value of that Number
      Since:
        1.0

    - #### public static long abs(Long number)

      Gets the absolute value.

      Parameters:
        `number` - a Long
      Returns:
        the absolute value of that Long
      Since:
        1.0

    - #### public static float abs(Float number)

      Gets the absolute value.

      Parameters:
        `number` - a Float
      Returns:
        the absolute value of that Float
      Since:
        1.0

    - #### public static double abs(Double number)

      Gets the absolute value.

      Parameters:
        `number` - a Double
      Returns:
        the absolute value of that Double
      Since:
        1.0

    - #### <T> public static boolean addAll(Collection<T> self, Iterator<? extends T> items)

      Adds all items from the iterator to the Collection.

      Parameters:
        `self` - the collection
        `items` - the items to add
      Returns:
        true if the collection changed

    - #### <T> public static boolean addAll(Collection<T> self, Iterable<? extends T> items)

      Adds all items from the iterable to the Collection.

      Parameters:
        `self` - the collection
        `items` - the items to add
      Returns:
        true if the collection changed

    - #### <T> public static boolean addAll(Collection<T> self, T[] items)

      Modifies the collection by adding all the elements in the specified array to the collection. The behavior of this operation is undefined if the specified array is modified while the operation is in progress.

      See also `plus` or the '+' operator if wanting to produce a new collection containing additional items but while leaving the original collection unchanged.

      Parameters:
        `self` - a Collection to be modified
        `items` - array containing elements to be added to this collection
      Returns:
        `true` if this collection changed as a result of the call
      See Also:
        Collections.addAll
      Since:
        1.7.2

    - #### <T> public static boolean addAll(List<T> self, int index, T[] items)

      Modifies this list by inserting all the elements in the specified array into the list at the specified position. Shifts the element currently at that position (if any) and any subsequent elements to the right (increases their indices). The new elements will appear in this list in the order that they occur in the array. The behavior of this operation is undefined if the specified array is modified while the operation is in progress. See also `plus` for similar functionality with copy semantics, i.e. which produces a new list after adding the additional items at the specified position but leaves the original list unchanged.

      Parameters:
        `self` - a list to be modified
        `items` - array containing elements to be added to this collection
        `index` - index at which to insert the first element from the specified array
      Returns:
        `true` if this collection changed as a result of the call
      See Also:
        List.addAll
      Since:
        1.7.2

    - #### public static void addShutdownHook(Object self, Closure closure)

      Allows the usage of addShutdownHook without getting the runtime first.

      Parameters:
        `self` - the object the method is called on (ignored)
        `closure` - the shutdown hook action
      Since:
        1.5.0

    - #### public static Number and(Number left, Number right)

      Bitwise AND together two Numbers.

      Parameters:
        `left` - a Number
        `right` - another Number to bitwise AND
      Returns:
        the bitwise AND of both Numbers
      Since:
        1.0

    - #### public static BitSet and(BitSet left, BitSet right)

      Bitwise AND together two BitSets.

      Parameters:
        `left` - a BitSet
        `right` - another BitSet to bitwise AND
      Returns:
        the bitwise AND of both BitSets
      Since:
        1.5.0

    - #### public static Boolean and(Boolean left, Boolean right)

      Logical conjunction of two boolean operators.

      Parameters:
        `left` - left operator
        `right` - right operator
      Returns:
        result of logical conjunction
      Since:
        1.0

    - #### <T> public static Set<T> and(Set<T> left, Iterable<T> right)

      Creates a Set composed of the intersection of a Set and an Iterable. Any elements that exist in both are added to the resultant Set.

      This operation will always create a new object for the result, while the operands remain unchanged.

           def a = [1,2,3,4] as Set
           def b = [3,4,5,6] as Set
           assert (a & b) == [3,4] as Set

      By default, Groovy uses a NumberAwareComparator when determining if an element exists in both sets.
      Parameters:
        `left` - a Set
        `right` - an Iterable
      Returns:
        a Set as an intersection of a Set and an Iterable
      See Also:
        intersect(Set, Iterable)
      Since:
        5.0.0

    - #### <T> public static Set<T> and(Set<T> left, Iterable<T> right, Comparator<? super T> comparator)

      Creates a Set composed of the intersection of a Set and an Iterable. Any elements that exist in both iterables are added to the resultant collection.

      This operation will always create a new object for the result, while the operands remain unchanged.

           assert [3,4] as Set == ([1,2,3,4] as Set).and([3,4,5,6], Comparator.naturalOrder())

      Parameters:
        `left` - a Set
        `right` - an Iterable
        `comparator` - a Comparator
      Returns:
        a Set as an intersection of a Set and an Iterable
      See Also:
        intersect(Set, Iterable, Comparator)
      Since:
        5.0.0

    - #### <T> public static SortedSet<T> and(SortedSet<T> left, Iterable<T> right)

      Creates a SortedSet composed of the intersection of a SortedSet and an Iterable. Any elements that exist in both are added to the resultant SortedSet.

      This operation will always create a new object for the result, while the operands remain unchanged.

           def a = [1,2,3,4] as SortedSet
           def b = [3,4,5,6] as Set
           assert (a & b) == [3,4] as SortedSet

      By default, Groovy uses a NumberAwareComparator when determining if an element exists in both sets.
      Parameters:
        `left` - a SortedSet
        `right` - an Iterable
      Returns:
        a SortedSet as an intersection of a SortedSet and an Iterable
      See Also:
        intersect(Set, Iterable)
      Since:
        5.0.0

    - #### <T> public static SortedSet<T> and(SortedSet<T> left, Iterable<T> right, Comparator<? super T> comparator)

      Creates a SortedSet composed of the intersection of a SortedSet and an Iterable. Any elements that exist in both iterables are added to the resultant collection.

      This operation will always create a new object for the result, while the operands remain unchanged.

           assert [3,4] as SortedSet == ([1,2,3,4] as SortedSet).and([3,4,5,6], Comparator.naturalOrder())

      Parameters:
        `left` - a SortedSet
        `right` - an Iterable
        `comparator` - a Comparator
      Returns:
        a SortedSet as an intersection of a SortedSet and an Iterable
      See Also:
        intersect(SortedSet, Iterable, Comparator)
      Since:
        5.0.0

    - #### public static boolean any(Object self)

      Iterates over the elements of a collection, and checks whether at least one element is true according to the Groovy Truth. Equivalent to self.any({element `->` element})

           assert [false, true].any()
           assert [0, 1].any()
           assert ![0, 0].any()

      Parameters:
        `self` - the object over which we iterate
      Returns:
        true if any item in the collection matches the closure predicate
      Since:
        1.5.0

    - #### public static boolean any(Object self, Closure predicate)

      Iterates over the contents of an object or collection, and checks whether a predicate is valid for at least one element.

           assert [1, 2, 3].any { it == 2 }
           assert ![1, 2, 3].any { it > 3 }

      Parameters:
        `self` - the object over which we iterate
        `predicate` - the closure predicate used for matching
      Returns:
        true if any iteration for the object matches the closure predicate
      Since:
        1.0

    - #### <T> public static boolean any(Iterator<T> self, @ClosureParams(FirstParam.FirstGenericType.class)
      Closure predicate)

      Iterates over the contents of an iterator, and checks whether a predicate is valid for at least one element.

           assert [1, 2, 3].iterator().any { it == 2 }
           assert ![1, 2, 3].iterator().any { it > 3 }

      Parameters:
        `self` - the iterator over which we iterate
        `predicate` - the closure predicate used for matching
      Returns:
        true if any iteration for the object matches the closure predicate
      Since:
        1.0

    - #### <T> public static boolean any(Iterable<T> self, @ClosureParams(FirstParam.FirstGenericType.class)
      Closure predicate)

      Iterates over the contents of an iterable, and checks whether a predicate is valid for at least one element.

           assert [1, 2, 3].any { it == 2 }
           assert ![1, 2, 3].any { it > 3 }

      Parameters:
        `self` - the iterable over which we iterate
        `predicate` - the closure predicate used for matching
      Returns:
        true if any iteration for the object matches the closure predicate
      Since:
        1.0

    - #### <K, V> public static boolean any(Map<K, V> self, @ClosureParams(MapEntryOrKeyValue.class)
      Closure<?> predicate)

      Iterates over the entries of a map, and checks whether a predicate is valid for at least one entry. If the closure takes one parameter then it will be passed the Map.Entry otherwise if the closure takes two parameters then it will be passed the key and the value.

           assert [2:3, 4:5, 5:10].any { key, value -> key * 2 == value }
           assert ![2:3, 4:5, 5:10].any { entry -> entry.key == entry.value * 2 }

      Parameters:
        `self` - the map over which we iterate
        `predicate` - the 1 or 2 arg closure predicate used for matching
      Returns:
        true if any entry in the map matches the closure predicate
      Since:
        1.5.0

    - #### <T> @Deprecated(since = "5.0.0")
      public static boolean any(T[] self, @ClosureParams(FirstParam.Component.class)
      Closure predicate)

    - #### public static boolean asBoolean(Object object)

      Coerce an object instance to a boolean value. An object is coerced to true if it's not null, to false if it is null.

      Parameters:
        `object` - the object to coerce
      Returns:
        the boolean value
      Since:
        1.7.0

    - #### public static boolean asBoolean(Boolean bool)

      Coerce a Boolean instance to a boolean value.

           // you can omit ".asBoolean()"
           assert Boolean.TRUE.asBoolean()
           assert !Boolean.FALSE.asBoolean()

      Since:
        1.7.0

    - #### public static boolean asBoolean(AtomicBoolean bool)

      Coerce an AtomicBoolean instance to a boolean value.

           import java.util.concurrent.atomic.AtomicBoolean

           // you can omit ".asBoolean()"
           assert  new AtomicBoolean(true).asBoolean()
           assert !new AtomicBoolean(false).asBoolean()
           assert !new AtomicBoolean(true).tap{set(false)}

      Since:
        5.0.0

    - #### public static boolean asBoolean(Collection collection)

      Coerce a collection instance to a boolean value. A collection is coerced to false if it's empty, and to true otherwise.

          assert [1,2].asBoolean() == true

          assert [].asBoolean() == false

      Parameters:
        `collection` - the collection
      Returns:
        the boolean value
      Since:
        1.7.0

    - #### public static boolean asBoolean(Map map)

      Coerce a map instance to a boolean value. A map is coerced to false if it's empty, and to true otherwise.

          assert [:] as Boolean == false
           assert [a:2] as Boolean == true

      Parameters:
        `map` - the map
      Returns:
        the boolean value
      Since:
        1.7.0

    - #### public static boolean asBoolean(Iterator iterator)

      Coerce an iterator instance to a boolean value. An iterator is coerced to false if there are no more elements to iterate over, and to true otherwise.

      Parameters:
        `iterator` - the iterator
      Returns:
        the boolean value
      Since:
        1.7.0

    - #### public static boolean asBoolean(Enumeration enumeration)

      Coerce an enumeration instance to a boolean value. An enumeration is coerced to false if there are no more elements to enumerate, and to true otherwise.

      Parameters:
        `enumeration` - the enumeration
      Returns:
        the boolean value
      Since:
        1.7.0

    - #### public static boolean asBoolean(Character character)

      Coerce a character to a boolean value. A character is coerced to false if it's character value is equal to 0, and to true otherwise.

      Parameters:
        `character` - the character
      Returns:
        the boolean value
      Since:
        1.7.0

    - #### public static boolean asBoolean(Float object)

      Coerce a Float instance to a boolean value.

      Parameters:
        `object` - the Float
      Returns:
        `true` for non-zero and non-NaN values, else `false`
      Since:
        2.6.0

    - #### public static boolean asBoolean(Double object)

      Coerce a Double instance to a boolean value.

      Parameters:
        `object` - the Double
      Returns:
        `true` for non-zero and non-NaN values, else `false`
      Since:
        2.6.0

    - #### public static boolean asBoolean(Number number)

      Coerce a number to a boolean value. A number is coerced to false if its double value is equal to 0, and to true otherwise.

      Parameters:
        `number` - the number
      Returns:
        the boolean value
      Since:
        1.7.0

    - #### @Deprecated(since = "5.0.0")
      public static boolean asBoolean(boolean[] self)

    - #### @Deprecated(since = "5.0.0")
      public static boolean asBoolean(byte[] self)

    - #### @Deprecated(since = "5.0.0")
      public static boolean asBoolean(char[] self)

    - #### @Deprecated(since = "5.0.0")
      public static boolean asBoolean(short[] self)

    - #### @Deprecated(since = "5.0.0")
      public static boolean asBoolean(int[] self)

    - #### @Deprecated(since = "5.0.0")
      public static boolean asBoolean(long[] self)

    - #### @Deprecated(since = "5.0.0")
      public static boolean asBoolean(float[] self)

    - #### @Deprecated(since = "5.0.0")
      public static boolean asBoolean(double[] self)

    - #### @Deprecated(since = "5.0.0")
      public static boolean asBoolean(Object[] self)

    - #### <T> public static List<T> asChecked(List<T> self, Class<T> type)

      Creates a checked view of a List.

      See Also:
        Collections.checkedList
      Since:
        5.0.0

    - #### <T> public static Queue<T> asChecked(Queue<T> self, Class<T> type)

      Creates a checked view of a Queue.

      See Also:
        Collections.checkedQueue
      Since:
        5.0.0

    - #### <T> public static Collection<T> asChecked(Collection<T> self, Class<T> type)

      Creates a checked view of a Collection.

      See Also:
        Collections.checkedCollection
      Since:
        5.0.0

    - #### <T> public static Set<T> asChecked(Set<T> self, Class<T> type)

      Creates a checked view of a Set.

      See Also:
        Collections.checkedSet
      Since:
        5.0.0

    - #### <T> public static SortedSet<T> asChecked(SortedSet<T> self, Class<T> type)

      Creates a checked view of a SortedSet.

      See Also:
        Collections.checkedSortedSet
      Since:
        5.0.0

    - #### <T> public static NavigableSet<T> asChecked(NavigableSet<T> self, Class<T> type)

      Creates a checked view of a NavigableSet.

      See Also:
        Collections.checkedNavigableSet
      Since:
        5.0.0

    - #### <K, V> public static Map<K, V> asChecked(Map<K, V> self, Class<K> keyType, Class<V> valueType)

      Creates a checked view of a Map.

      See Also:
        Collections.checkedMap
      Since:
        5.0.0

    - #### <K, V> public static SortedMap<K, V> asChecked(SortedMap<K, V> self, Class<K> keyType, Class<V> valueType)

      Creates a checked view of a SortedMap.

      See Also:
        Collections.checkedSortedMap
      Since:
        5.0.0

    - #### <K, V> public static NavigableMap<K, V> asChecked(NavigableMap<K, V> self, Class<K> keyType, Class<V> valueType)

      Creates a checked view of a NavigableMap.

      See Also:
        Collections.checkedNavigableMap
      Since:
        5.0.0

    - #### <T> public static Collection<T> asCollection(Iterable<T> self)

      Converts this Iterable to a Collection. Returns the original argument if it is already a Collection.

      Example usage:

           assert new HashSet().asCollection() instanceof Collection

      Parameters:
        `self` - an Iterable to be converted into a Collection
      Returns:
        a newly created List if this Iterable is not already a Collection
      Since:
        2.4.0

    - #### <K, V> public static Map<K, V> asImmutable(Map<K, V> self)

      A convenience method for creating an immutable Map.

      Parameters:
        `self` - a Map
      Returns:
        an unmodifiable view of a copy of the original, i.e. an effectively immutable copy
      See Also:
        asImmutable(java.util.List)
        asUnmodifiable(java.util.Map)
      Since:
        1.0

    - #### <K, V> public static SortedMap<K, V> asImmutable(SortedMap<K, V> self)

      A convenience method for creating an immutable SortedMap.

      Parameters:
        `self` - a SortedMap
      Returns:
        an unmodifiable view of a copy of the original, i.e. an effectively immutable copy
      See Also:
        asImmutable(java.util.List)
        asUnmodifiable(java.util.SortedMap)
      Since:
        1.0

    - #### <T> public static List<T> asImmutable(List<T> self)

      A convenience method for creating an immutable List.

           def mutable = [1,2,3]
           def immutable = mutable.asImmutable()
           try {
               immutable << 4
               assert false
           } catch (UnsupportedOperationException) {
               assert true
           }
           mutable << 4
           assert mutable.size() == 4
           assert immutable.size() == 3

      Parameters:
        `self` - a List
      Returns:
        an unmodifiable view of a copy of the original, i.e. an effectively immutable copy
      See Also:
        asUnmodifiable(java.util.List)
      Since:
        1.0

    - #### <T> public static Set<T> asImmutable(Set<T> self)

      A convenience method for creating an immutable Set.

      Parameters:
        `self` - a Set
      Returns:
        an unmodifiable view of a copy of the original, i.e. an effectively immutable copy
      See Also:
        asImmutable(java.util.List)
        asUnmodifiable(java.util.Set)
      Since:
        1.0

    - #### <T> public static SortedSet<T> asImmutable(SortedSet<T> self)

      A convenience method for creating an immutable SortedSet.

      Parameters:
        `self` - a SortedSet
      Returns:
        an unmodifiable view of a copy of the original, i.e. an effectively immutable copy
      See Also:
        asImmutable(java.util.List)
        asUnmodifiable(java.util.SortedSet)
      Since:
        1.0

    - #### <T> public static Collection<T> asImmutable(Collection<T> self)

      A convenience method for creating an immutable Collection.

      Parameters:
        `self` - a Collection
      Returns:
        an unmodifiable view of a copy of the original, i.e. an effectively immutable copy
      See Also:
        asImmutable(java.util.List)
        asUnmodifiable(java.util.Collection)
      Since:
        1.5.0

    - #### <T> public static List<T> asList(Iterable<T> self)

      Converts this Iterable to a List. Returns the original Iterable if it is already a List.

      Example usage:

           assert new HashSet().asList() instanceof List

      Parameters:
        `self` - an Iterable to be converted into a List
      Returns:
        a newly created List if this Iterable is not already a List
      Since:
        2.2.0

    - #### <T> public static List<T> asReversed(List<T> self)

      Creates a view list with reversed order, and the order of original list will not change.

           def list = ["a", 6, true]
           assert list.asReversed() == [true, 6, "a"]
           assert list == ["a", 6, true]

      Parameters:
        `self` - a list
      Type Parameters:
        `T` - the type of element
      Returns:
        the reversed list
      Since:
        4.0.0

    - #### <T> public static NavigableSet<T> asReversed(NavigableSet<T> self)

      Creates a reverse order view of the set. The order of original list will not change.

           TreeSet navSet = [2, 4, 1, 3]  // natural order is sorted
           assert navSet.asReversed() == [4, 3, 2, 1] as Set

      Parameters:
        `self` - a NavigableSet
      Type Parameters:
        `T` - the type of element
      Returns:
        the reversed view NavigableSet
      Since:
        4.0.11

    - #### public static String asString(Throwable self)

      Get the detail information of Throwable instance's stack trace

      Parameters:
        `self` - a Throwable instance
      Returns:
        the detail information of stack trace
      Since:
        2.5.3

    - #### <K, V> public static Map<K, V> asSynchronized(Map<K, V> self)

      Creates a synchronized view of a Map.

      Parameters:
        `self` - a Map
      Returns:
        a synchronized Map
      See Also:
        Collections.synchronizedMap
      Since:
        1.0

    - #### <K, V> public static SortedMap<K, V> asSynchronized(SortedMap<K, V> self)

      Creates a synchronized view of a SortedMap.

      Parameters:
        `self` - a SortedMap
      Returns:
        a synchronized SortedMap
      See Also:
        Collections.synchronizedSortedMap
      Since:
        1.0

    - #### <K, V> public static NavigableMap<K, V> asSynchronized(NavigableMap<K, V> self)

      Creates a synchronized view of a NavigableMap.

      Parameters:
        `self` - a NavigableMap
      Returns:
        a synchronized NavigableMap
      See Also:
        Collections.synchronizedNavigableMap
      Since:
        5.0.0

    - #### <T> public static Collection<T> asSynchronized(Collection<T> self)

      Creates a synchronized view of a Collection.

      Parameters:
        `self` - a Collection
      Returns:
        a synchronized Collection
      See Also:
        Collections.synchronizedCollection
      Since:
        1.0

    - #### <T> public static List<T> asSynchronized(List<T> self)

      Creates a synchronized view of a List.

      Parameters:
        `self` - a List
      Returns:
        a synchronized List
      See Also:
        Collections.synchronizedList
      Since:
        1.0

    - #### <T> public static Set<T> asSynchronized(Set<T> self)

      Creates a synchronized view of a Set.

      Parameters:
        `self` - a Set
      Returns:
        a synchronized Set
      See Also:
        Collections.synchronizedSet
      Since:
        1.0

    - #### <T> public static SortedSet<T> asSynchronized(SortedSet<T> self)

      Creates a synchronized view of a SortedSet.

      Parameters:
        `self` - a SortedSet
      Returns:
        a synchronized SortedSet
      See Also:
        Collections.synchronizedSortedSet
      Since:
        1.0

    - #### <T> public static NavigableSet<T> asSynchronized(NavigableSet<T> self)

      Creates a synchronized view of a NavigableSet.

      Parameters:
        `self` - a NavigableSet
      Returns:
        a synchronized NavigableSet
      See Also:
        Collections.synchronizedNavigableSet
      Since:
        5.0.0

    - #### <T> @SuppressWarnings("unchecked")
      public static T asType(Iterable iterable, Class<T> clazz)

      Converts the given iterable to another type.

      Parameters:
        `iterable` - an Iterable
        `clazz` - the desired class
      Returns:
        the object resulting from this type conversion
      See Also:
        asType(Collection, Class)
      Since:
        2.4.12

    - #### <T> @SuppressWarnings("unchecked")
      public static T asType(Collection col, Class<T> clazz)

      Converts the given collection to another type. A default concrete type is used for List, Set, or SortedSet. If the given type has a constructor taking a collection, that is used. Otherwise, the call is deferred to asType(Object,Class). If this collection is already of the given type, the same instance is returned.

      Parameters:
        `col` - a collection
        `clazz` - the desired class
      Returns:
        the object resulting from this type conversion
      See Also:
        asType(java.lang.Object, java.lang.Class)
      Since:
        1.0

    - #### <T> @SuppressWarnings("unchecked")
      public static T asType(Closure impl, Class<T> type)

      Coerces the closure to an implementation of the given class. The class is assumed to be an interface or class with a single method definition. The closure is used as the implementation of that single method.

      Parameters:
        `impl` - the implementation of the single method
        `type` - the target type
      Returns:
        A proxy of the given type which wraps this closure.
      Since:
        1.0

    - #### <T> @SuppressWarnings("unchecked")
      public static T asType(Map map, Class<T> clazz)

      Coerces this map to the given type, using the map's keys as the public method names, and values as the implementation. Typically the value would be a closure which behaves like the method implementation.

      Parameters:
        `map` - this map
        `clazz` - the target type
      Returns:
        a Proxy of the given type, which defers calls to this map's elements.
      Since:
        1.0

    - #### <T> @SuppressWarnings("unchecked")
      public static T asType(Number self, Class<T> type)

      Transform this number to the given type, using the 'as' operator. The following types are supported in addition to the default asType(java.lang.Object, java.lang.Class):

      - BigDecimal
      - BigInteger
      - Double
      - Float
      Parameters:
        `self` - this number
        `type` - the desired type of the transformed result
      Returns:
        an instance of the given type
      Since:
        1.0

    - #### <T> @SuppressWarnings("unchecked")
      public static T asType(Object obj, Class<T> type)

      Converts a given object to a type. This method is used through the "as" operator and is overloadable as any other operator.

      Parameters:
        `obj` - the object to convert
        `type` - the goal type
      Returns:
        the resulting object
      Since:
        1.0

    - #### <T> @Deprecated(since = "5.0.0")
      public static T asType(Object[] self, Class<T> type)

    - #### <K, V> public static Map<K, V> asUnmodifiable(Map<K, V> self)

      Creates an unmodifiable view of a Map.

      Parameters:
        `self` - a Map
      Returns:
        an unmodifiable view of the Map
      See Also:
        Collections.unmodifiableMap
        asUnmodifiable(java.util.List)
      Since:
        2.5.0

    - #### <K, V> public static SortedMap<K, V> asUnmodifiable(SortedMap<K, V> self)

      Creates an unmodifiable view of a SortedMap.

      Parameters:
        `self` - a SortedMap
      Returns:
        an unmodifiable view of the SortedMap
      See Also:
        Collections.unmodifiableSortedMap
        asUnmodifiable(java.util.List)
      Since:
        2.5.0

    - #### <K, V> public static SortedMap<K, V> asUnmodifiable(NavigableMap<K, V> self)

      Creates an unmodifiable view of a NavigableMap.

      Parameters:
        `self` - a NavigableMap
      Returns:
        an unmodifiable view of the NavigableMap
      See Also:
        Collections.unmodifiableNavigableMap
        asUnmodifiable(java.util.List)
      Since:
        5.0.0

    - #### <T> public static List<T> asUnmodifiable(List<T> self)

      Creates an unmodifiable view of a List.

           def mutable = [1,2,3]
           def unmodifiable = mutable.asUnmodifiable()
           try {
               unmodifiable << 4
               assert false
           } catch (UnsupportedOperationException) {
               assert true
           }
           mutable << 4
           assert unmodifiable.size() == 4

      Parameters:
        `self` - a List
      Returns:
        an unmodifiable view of the List
      See Also:
        Collections.unmodifiableList
      Since:
        2.5.0

    - #### <T> public static Set<T> asUnmodifiable(Set<T> self)

      Creates an unmodifiable view of a Set.

      Parameters:
        `self` - a Set
      Returns:
        an unmodifiable view of the Set
      See Also:
        Collections.unmodifiableSet
        asUnmodifiable(java.util.List)
      Since:
        2.5.0

    - #### <T> public static SortedSet<T> asUnmodifiable(SortedSet<T> self)

      Creates an unmodifiable view of a SortedSet.

      Parameters:
        `self` - a SortedSet
      Returns:
        an unmodifiable view of the SortedSet
      See Also:
        Collections.unmodifiableSortedSet
        asUnmodifiable(java.util.List)
      Since:
        2.5.0

    - #### <T> public static NavigableSet<T> asUnmodifiable(NavigableSet<T> self)

      Creates an unmodifiable view of a NavigableSet.

      Parameters:
        `self` - a NavigableSet
      Returns:
        an unmodifiable view of the NavigableSet
      See Also:
        Collections.unmodifiableNavigableSet
        asUnmodifiable(java.util.List)
      Since:
        5.0.0

    - #### <T> public static Collection<T> asUnmodifiable(Collection<T> self)

      Creates an unmodifiable view of a Collection.

      Parameters:
        `self` - a Collection
      Returns:
        an unmodifiable view of the Collection
      See Also:
        Collections.unmodifiableCollection
        asUnmodifiable(java.util.List)
      Since:
        2.5.0

    - #### public static Object average(Iterable<?> self)

      Averages the items in an Iterable. This is equivalent to invoking the "plus" method on all items in the Iterable and then dividing by the total count using the "div" method for the resulting sum.

           assert 3 == [1, 2, 6].average()

      Parameters:
        `self` - Iterable of values to average
      Returns:
        The average of all the items
      See Also:
        average(Iterator)
      Since:
        3.0.0

    - #### public static Object average(Iterator<?> self)

      Averages the items from an Iterator. This is equivalent to invoking the "plus" method on all items in the array and then dividing by the total count using the "div" method for the resulting sum. The iterator will become exhausted of elements after determining the average value. While most frequently used with aggregates of numbers, `average` will work with any class supporting `plus` and `div`, e.g.:

           class Stars {
               int numStars = 0
               String toString() {
                   '*' * numStars
               }
               Stars plus(Stars other) {
                   new Stars(numStars: numStars + other.numStars)
               }
               Stars div(Number divisor) {
                   int newSize = numStars.intdiv(divisor)
                   new Stars(numStars: newSize)
               }
           }

           def stars = [new Stars(numStars: 1), new Stars(numStars: 3)]
           assert stars*.toString() == ['*', '***']
           assert stars.average().toString() == '**'

      Parameters:
        `self` - an Iterator for the values to average
      Returns:
        The average of all the items
      Since:
        3.0.0

    - #### <T> public static Object average(Iterable<T> self, @ClosureParams(FirstParam.FirstGenericType.class)
      Closure closure)

      Averages the result of applying a closure to each item of an Iterable. `iter.average(closure)` is equivalent to: `iter.collect(closure).average()`.

      Example:

           assert 20 == [1, 3].average { it * 10 }
           assert 3 == ['to', 'from'].average { it.size() }

      Parameters:
        `self` - an Iterable
        `closure` - a single parameter closure that returns a (typically) numeric value.
      Returns:
        The average of the values returned by applying the closure to each item of the Iterable.
      Since:
        3.0.0

    - #### <T> public static Object average(Iterator<T> self, @ClosureParams(FirstParam.FirstGenericType.class)
      Closure closure)

      Averages the result of applying a closure to each item returned from an iterator. `iter.average(closure)` is equivalent to: `iter.collect(closure).average()`. The iterator will become exhausted of elements after determining the average value.

      Example:

           assert ['to', 'from'].iterator().average{ it.size() } == 3

      Parameters:
        `self` - An Iterator
        `closure` - a single parameter closure that returns a (typically) numeric value.
      Returns:
        The average of the values returned by applying the closure to each item from the Iterator.
      Since:
        3.0.0

    - #### @Deprecated(since = "5.0.0")
      public static BigDecimal average(byte[] self)

    - #### @Deprecated(since = "5.0.0")
      public static BigDecimal average(short[] self)

    - #### @Deprecated(since = "5.0.0")
      public static BigDecimal average(int[] self)

    - #### @Deprecated(since = "5.0.0")
      public static BigDecimal average(long[] self)

    - #### @Deprecated(since = "5.0.0")
      public static double average(float[] self)

    - #### @Deprecated(since = "5.0.0")
      public static double average(double[] self)

    - #### @Deprecated(since = "5.0.0")
      public static Object average(Object[] self)

    - #### <T> @Deprecated(since = "5.0.0")
      public static Object average(T[] self, @ClosureParams(FirstParam.Component.class)
      Closure closure)

    - #### public static BitSet bitwiseNegate(BitSet self)

      Bitwise NEGATE a BitSet.

      Parameters:
        `self` - a BitSet
      Returns:
        the bitwise NEGATE of the BitSet
      Since:
        1.5.0

    - #### public static Number bitwiseNegate(Number left)

      Bitwise NEGATE a Number.

      Parameters:
        `left` - a Number
      Returns:
        the bitwise NEGATE of the Number
      Since:
        2.2.0

    - #### <T> public static BufferedIterator<T> buffered(Iterator<T> self)

      Returns a `BufferedIterator` that allows examining the next element without consuming it.

           assert [1, 2, 3, 4].iterator().buffered().with { [head(), toList()] } == [1, [1, 2, 3, 4]]

      Parameters:
        `self` - an iterator object
      Returns:
        a BufferedIterator wrapping self
      Since:
        2.5.0

    - #### <T> public static BufferedIterator<T> bufferedIterator(Iterable<T> self)

      Returns a `BufferedIterator` that allows examining the next element without consuming it.

           assert new LinkedHashSet([1,2,3,4]).bufferedIterator().with { [head(), toList()] } == [1, [1,2,3,4]]

      Parameters:
        `self` - an iterable object
      Returns:
        a BufferedIterator for traversing self
      Since:
        2.5.0

    - #### <T> public static BufferedIterator<T> bufferedIterator(List<T> self)

      Returns a `BufferedIterator` that allows examining the next element without consuming it.

           assert [1, 2, 3, 4].bufferedIterator().with { [head(), toList()] } == [1, [1, 2, 3, 4]]

      Parameters:
        `self` - a list
      Returns:
        a BufferedIterator for traversing self
      Since:
        2.5.0

    - #### <T> protected static T callClosureForLine(@ClosureParams(value=FromString.class, options={"String","String,Integer"})
      Closure<T> closure, String line, int counter)

    - #### <T, K, V> protected static T callClosureForMapEntry(@ClosureParams(value=FromString.class, options={"K,V","Map.Entry"})
      Closure<T> closure, Map.Entry<K, V> entry)

    - #### <T, K, V> protected static T callClosureForMapEntryAndCounter(@ClosureParams(value=FromString.class, options={"K,V,Integer", "K,V","Map.Entry"})
      Closure<T> closure, Map.Entry<K, V> entry, int counter)

    - #### <T> public static List<List<T>> chop(Iterable<T> self, int chopSizes)

      Chops the Iterable into pieces, returning lists with sizes corresponding to the supplied chop sizes. Using a chop size of -1 will cause that piece to contain all remaining items from the Iterable.

      Example usage:

           assert [1, 2, 3, 4].chop(1) == [[1]]
           assert [1, 2, 3, 4].chop(1,-1) == [[1], [2, 3, 4]]
           assert ('a'..'h').chop(2, 4) == [['a', 'b'], ['c', 'd', 'e', 'f']]
           assert ['a', 'b', 'c', 'd', 'e'].chop(3) == [['a', 'b', 'c']]
           assert ['a', 'b', 'c', 'd', 'e'].chop(1, 2, 3) == [['a'], ['b', 'c'], ['d', 'e']]
           assert ['a', 'b', 'c', 'd', 'e'].chop(1, 2, 3, 3, 3) == [['a'], ['b', 'c'], ['d', 'e']]

      Parameters:
        `self` - an Iterable to be chopped
        `chopSizes` - the sizes for the returned pieces
      Returns:
        a list of lists chopping the original iterable into pieces determined by chopSizes
      See Also:
        to chop an Iterable into pieces of a fixed size
      Since:
        2.5.2

    - #### <T> public static List<List<T>> chop(Iterable<T> self, boolean returnEarly, int chopSizes)

      Chops the Iterable into pieces, returning lists with sizes corresponding to the supplied chop sizes. When no more elements remain in the iterable, truncated (possibly empty) pieces are returned unless returnEarly is true. Using a chop size of -1 will cause that piece to contain all remaining items from the Iterable.

      Example usage:

           assert ['a', 'b', 'c', 'd', 'e'].chop(false, 1, 2, 3, 3, 3) == [['a'], ['b', 'c'], ['d', 'e'], [], []]
           assert ['a', 'b', 'c', 'd', 'e'].chop(true, 1, 2, 3, 3, 3) == [['a'], ['b', 'c'], ['d', 'e']]

      Parameters:
        `self` - an Iterable to be chopped
        `chopSizes` - the sizes for the returned pieces
        `returnEarly` - as soon as the source is exhausted, ignore remaining asked for chop sizes
      Returns:
        a list of lists chopping the original iterable into pieces determined by chopSizes
      See Also:
        to chop an Iterable into pieces of a fixed size
      Since:
        2.5.2

    - #### <T> public static Iterator<List<T>> chop(Iterator<T> self, int chopSizes)

      Chops the iterator items into pieces, returning lists with sizes corresponding to the supplied chop sizes. Using a chop size of -1 will cause that piece to contain all remaining items from the iterator.

      Example usage:

           assert (1..6).iterator().chop(1, 2, -1).toList() == [[1], [2, 3], [4, 5, 6]]

      Parameters:
        `self` - an Iterator to be chopped
        `chopSizes` - the sizes for the returned pieces
      Returns:
        an iterator of lists chopping the original iterator elements into pieces determined by chopSizes
      Since:
        5.0.0

    - #### <T> public static Iterator<List<T>> chop(Iterator<T> self, boolean returnEarly, int chopSizes)

      Chops the source iterator elements into pieces, returning lists with sizes corresponding to the supplied chop sizes. If the source iterator is exhausted early, truncated (possibly empty) pieces are returned unless returnEarly is true. Using a chop size of -1 will cause that piece to contain all remaining items from the source iterator.

      Example usage:

           assert (1..6).iterator().chop(1, 2, -1).toList() == [[1], [2, 3], [4, 5, 6]]

      Parameters:
        `self` - an Iterator to be chopped
        `chopSizes` - the sizes for the returned pieces
        `returnEarly` - as soon as the source is exhausted, ignore remaining asked for chop sizes
      Returns:
        an iterator of lists chopping the original source iterator elements into pieces determined by chopSizes
      Since:
        5.0.0

    - #### <T> public static Iterator<List<T>> chop(Iterator<T> self, Iterator<Integer> chopSizes)

      Chops the source iterator elements into pieces, returning lists with sizes corresponding to the supplied chop sizes. Using a chop size of -1 will cause that piece to contain all remaining items from the source iterator.

      Example usage:

           def stars = ['*']
               .repeat()
               .chop(Iterators.iterate(1, n -> n + 2))
               .take(10)
               *.join()
               .toList()
           def width = stars[-1].size()
           assert stars*.center(width, '.').join('\n') == '''
           .........*.........
           ........***........
           .......*****.......
           ......*******......
           .....*********.....
           ....***********....
           ...*************...
           ..***************..
           .*****************.
           *******************
           '''.trim()

      Parameters:
        `self` - an Iterator of source elements to be chopped
        `chopSizes` - the sizes for the returned pieces
      Returns:
        an iterator of lists chopping the original iterator elements into pieces determined by chopSizes
      Since:
        5.0.0

    - #### <T> public static Iterator<List<T>> chop(Iterator<T> self, boolean returnEarly, Iterator<Integer> chopSizes)

      Chops the source iterator elements into pieces, returning lists with sizes corresponding to the supplied chop sizes. If the source iterator is exhausted early, truncated (possibly empty) pieces are returned unless returnEarly is true. Using a chop size of -1 will cause that piece to contain all remaining items from the source iterator.

      Example usage:

           def trunk = [3, 3, 3].iterator()
           def shape = Iterators.iterate(1, n -> n + 2).take(10).plus(trunk)
           def tree = ['*']
               .repeat()
               .chop(true, shape)
               *.join()
               .toList()
           def width = tree*.size().max()
           assert tree*.center(width, '.').join('\n') == '''
           .........*.........
           ........***........
           .......*****.......
           ......*******......
           .....*********.....
           ....***********....
           ...*************...
           ..***************..
           .*****************.
           *******************
           ........***........
           ........***........
           ........***........
           '''.trim()

      Parameters:
        `self` - an Iterator of source elements to be chopped
        `chopSizes` - the sizes for the returned pieces
        `returnEarly` - as soon as the source is exhausted, ignore remaining asked for chop sizes
      Returns:
        an iterator of lists chopping the original iterator elements into pieces determined by chopSizes
      Since:
        5.0.0

    - #### <T> @Deprecated(since = "5.0.0")
      public static List<List<T>> chop(T[] self, int chopSizes)

    - #### <T> @Deprecated
      public static List<List<T>> chop$$bridge(Iterator<T> self, int chopSizes)

      Chops the iterator items into pieces, returning lists with sizes corresponding to the supplied chop sizes.

      deprecated:
        @since 2.5.2

    - #### <T> public static List<List<T>> collate(Iterable<T> self, int size)

      Collates this iterable into sub-lists of length `size`. Example:

          def list = [ 1, 2, 3, 4, 5, 6, 7 ]
           def coll = list.collate( 3 )
           assert coll == [ [ 1, 2, 3 ], [ 4, 5, 6 ], [ 7 ] ]

      Parameters:
        `self` - an Iterable
        `size` - the length of each sub-list in the returned list
      Returns:
        a List containing the data collated into sub-lists
      Since:
        2.4.0

    - #### <T> public static List<List<T>> collate(Iterable<T> self, int size, int step)

      Collates this iterable into sub-lists of length `size` stepping through the code `step` elements for each subList. Example:

          def list = [ 1, 2, 3, 4 ]
           def coll = list.collate( 3, 1 )
           assert coll == [ [ 1, 2, 3 ], [ 2, 3, 4 ], [ 3, 4 ], [ 4 ] ]

      Parameters:
        `self` - an Iterable
        `size` - the length of each sub-list in the returned list
        `step` - the number of elements to step through for each sub-list
      Returns:
        a List containing the data collated into sub-lists
      Since:
        2.4.0

    - #### <T> public static List<List<T>> collate(Iterable<T> self, int size, boolean keepRemainder)

      Collates this iterable into sub-lists of length `size`. Any remaining elements in the iterable after the subdivision will be dropped if `keepRemainder` is false. Example:

          def list = [ 1, 2, 3, 4, 5, 6, 7 ]
           def coll = list.collate( 3, false )
           assert coll == [ [ 1, 2, 3 ], [ 4, 5, 6 ] ]

      Parameters:
        `self` - an Iterable
        `size` - the length of each sub-list in the returned list
        `keepRemainder` - if true, any remaining elements are returned as sub-lists. Otherwise they are discarded
      Returns:
        a List containing the data collated into sub-lists
      Since:
        2.4.0

    - #### <T> public static List<List<T>> collate(Iterable<T> self, int size, int step, boolean keepRemainder)

      Collates this iterable into sub-lists of length `size` stepping through the code `step` elements for each sub-list. Any remaining elements in the iterable after the subdivision will be dropped if `keepRemainder` is false.

      Example:

           def list = [ 1, 2, 3, 4 ]
           assert list.collate( 2, 2, true  ) == [ [ 1, 2 ], [ 3, 4 ] ]
           assert list.collate( 3, 1, true  ) == [ [ 1, 2, 3 ], [ 2, 3, 4 ], [ 3, 4 ], [ 4 ] ]
           assert list.collate( 3, 1, false ) == [ [ 1, 2, 3 ], [ 2, 3, 4 ] ]

      throws:
        IllegalArgumentException if the step is zero.
      Parameters:
        `self` - an Iterable
        `size` - the length of each sub-list in the returned list
        `step` - the number of elements to step through for each sub-list
        `keepRemainder` - if true, any remaining elements are returned as sub-lists. Otherwise they are discarded
      Returns:
        a List containing the data collated into sub-lists
      Since:
        2.4.0

    - #### <T> public static Iterator<List<T>> collate(Iterator<T> self, int size, int step, boolean keepRemainder)

      Collates this iterator into sub-lists of length `size` stepping through the code `step` elements for each sub-list. Any remaining elements in the iterator after the subdivision will be dropped if `keepRemainder` is false.

      Example:

           var letters = 'A'..'G'
           assert letters.iterator().collate(2, 2, false).toList() == [['A', 'B'], ['C', 'D'], ['E', 'F']]
           assert letters.iterator().collate(3, 2, true).toList() == [['A', 'B', 'C'], ['C', 'D', 'E'], ['E', 'F', 'G'], ['G']]
           assert letters.iterator().collate(2, 3, true).toList() == [['A', 'B'], ['D', 'E'], ['G']]

      Parameters:
        `self` - an Iterator
        `size` - the length of each sub-list in the returned elements
        `step` - the number of elements to step through for each sub-list
        `keepRemainder` - if true, any remaining elements are returned as sub-lists. Otherwise they are discarded
      Returns:
        an iterator for the collated sub-lists
      Since:
        5.0.0

    - #### <T> public static Iterator<List<T>> collate(Iterator<T> self, int size, int step)

      Collates this iterator into sub-lists of length `size` stepping through the code `step` elements for each sub-list including any remaining elements as the last sub-list.

      Example:

           assert ('A'..'I').iterator().collate(4, 4).toList() == [['A', 'B', 'C', 'D'], ['E', 'F', 'G', 'H'], ['I']]

      Parameters:
        `self` - an Iterator
        `size` - the length of each sub-list in the returned elements
        `step` - the number of elements to step through for each sub-list
      Returns:
        an iterator for the collated sub-lists
      Since:
        5.0.0

    - #### <T> public static Iterator<List<T>> collate(Iterator<T> self, int size, boolean keepRemainder)

      Collates this iterator into sub-lists of length `size`. Any remaining elements in the iterator after the subdivision will be dropped if `keepRemainder` is false.

      Example:

           assert ('A'..'I').iterator().collate(4, false).toList() == [['A', 'B', 'C', 'D'], ['E', 'F', 'G', 'H']]

      Parameters:
        `self` - an Iterator
        `size` - the length of each sub-list in the returned elements
        `keepRemainder` - if true, any remaining elements are returned as sub-lists. Otherwise they are discarded
      Returns:
        an iterator for the collated sub-lists
      Since:
        5.0.0

    - #### <T> public static Iterator<List<T>> collate(Iterator<T> self, int size)

      Collates this iterator into sub-lists of length `size` including any remaining elements as the last sub-list.

      Example:

           assert ('A'..'H').iterator().collate(3).toList() == [['A', 'B', 'C'], ['D', 'E', 'F'], ['G', 'H']]

      Parameters:
        `self` - an Iterator
        `size` - the length of each sub-list in the returned elements
      Returns:
        an iterator for the collated sub-lists
      Since:
        5.0.0

    - #### <T> @Deprecated(since = "5.0.0")
      public static List<List<T>> collate(T[] self, int size)

    - #### <T> @Deprecated(since = "5.0.0")
      public static List<List<T>> collate(T[] self, int size, int step)

    - #### <T> @Deprecated(since = "5.0.0")
      public static List<List<T>> collate(T[] self, int size, boolean keepRemainder)

    - #### <T> @Deprecated(since = "5.0.0")
      public static List<List<T>> collate(T[] self, int size, int step, boolean keepRemainder)

    - #### @SuppressWarnings("unchecked")
      public static Collection collect(Object self)

      Iterates through this aggregate Object transforming each item into a new value using Closure.IDENTITY as a transformer, basically returning a list of items copied from the original object.

          def obj = new Object(); assert obj.collect() == [obj]

      Parameters:
        `self` - an aggregate Object with an Iterator returning its items
      Returns:
        a Collection of the transformed values
      See Also:
        Closure.IDENTITY
      Since:
        1.8.5

    - #### <T> public static List<T> collect(Object self, Closure<T> transform)

      Iterates through this aggregate Object transforming each item into a new value using the `transform` closure, returning a list of transformed values.

           def list = [1, 'a', 1.23, true ]
           def types = list.collect { it.class }
           assert types == [Integer, String, BigDecimal, Boolean]

      Parameters:
        `self` - an aggregate Object with an Iterator returning its items
        `transform` - the closure used to transform each item of the aggregate object
      Returns:
        a List of the transformed values
      Since:
        1.0

    - #### <T, C extends Collection<T>> public static C collect(Object self, C collector, Closure<? extends T> transform)

      Iterates through this aggregate Object transforming each item into a new value using the `transform` closure and adding it to the supplied `collector`.

      Parameters:
        `self` - an aggregate Object with an Iterator returning its items
        `collector` - the Collection to which the transformed values are added
        `transform` - the closure used to transform each item of the aggregate object
      Returns:
        the collector with all transformed values added to it
      Since:
        1.0

    - #### <E, T> public static List<T> collect(Iterator<E> self, @ClosureParams(FirstParam.FirstGenericType.class)
      Closure<T> transform)

      Iterates through this Iterator transforming each item into a new value using the `transform` closure, returning a list of transformed values.

      Parameters:
        `self` - an Iterator
        `transform` - the closure used to transform each item
      Returns:
        a List of the transformed values
      Since:
        2.5.0

    - #### <E, T, C extends Collection<T>> public static C collect(Iterator<E> self, C collector, @ClosureParams(FirstParam.FirstGenericType.class)
      Closure<? extends T> transform)

      Iterates through this Iterator transforming each item into a new value using the `transform` closure and adding it to the supplied `collector`.

          assert [1,2,3].iterator().collect([]){ it * 2 } == [2,4,6]

      Parameters:
        `self` - an Iterator
        `collector` - the Collection to which the transformed values are added
        `transform` - the closure used to transform each item
      Returns:
        the collector with all transformed values added to it
      Since:
        2.5.0

    - #### <T> @SuppressWarnings("unchecked")
      public static List<T> collect(Iterator<T> self)

      Convert an iterator to a List. The iterator will become exhausted of elements after making this conversion. Alias for `toList`.

      Parameters:
        `self` - an iterator
      Returns:
        a List of the elements from the iterator
      See Also:
        toList(Iterator)
      Since:
        5.0.0

    - #### <T> @SuppressWarnings("unchecked")
      public static List<T> collect(Iterable<T> self)

      Iterates through this collection transforming each entry into a new value using Closure.IDENTITY as a transformer, basically returning a list of items copied from the original collection.

          assert [1,2,3].collect() == [1,2,3]

      Parameters:
        `self` - an Iterable
      Returns:
        a List of the transformed values
      See Also:
        Closure.IDENTITY
      Since:
        2.5.0

    - #### <E, T> public static List<T> collect(Iterable<E> self, @ClosureParams(FirstParam.FirstGenericType.class)
      Closure<T> transform)

      Iterates through this Iterable transforming each entry into a new value using the `transform` closure returning a list of transformed values.

          assert [1,2,3].collect { it * 2 } == [2,4,6]

      Parameters:
        `self` - an Iterable
        `transform` - the closure used to transform each item of the collection
      Returns:
        a List of the transformed values
      Since:
        2.5.0

    - #### <E, T, C extends Collection<T>> public static C collect(Iterable<E> self, C collector, @ClosureParams(FirstParam.FirstGenericType.class)
      Closure<? extends T> transform)

      Iterates through this collection transforming each value into a new value using the `transform` closure and adding it to the supplied `collector`.

          assert [2,4,5,6].collect(new HashSet()) { (int)(it / 2) } == [1,2,3] as Set

      Parameters:
        `self` - an Iterable
        `collector` - the Collection to which the transformed values are added
        `transform` - the closure used to transform each item
      Returns:
        the collector with all transformed values added to it
      Since:
        2.5.0

    - #### <T, K, V, C extends Collection<T>> public static C collect(Map<K, V> self, C collector, @ClosureParams(MapEntryOrKeyValue.class)
      Closure<? extends T> transform)

      Iterates through this Map transforming each map entry into a new value using the `transform` closure returning the `collector` with all transformed values added to it.

           assert [a:1, b:2].collect(new HashSet()) { key, value -> key * value } == ["a", "bb"] as Set
           assert [3:20, 2:30].collect(new HashSet()) { entry -> entry.key * entry.value } == [60] as Set

      Parameters:
        `self` - a Map
        `collector` - the Collection to which transformed values are added
        `transform` - the transformation closure which can take one (Map.Entry) or two (key, value) parameters
      Returns:
        the collector with all transformed values added to it
      Since:
        1.0

    - #### <T, K, V> public static List<T> collect(Map<K, V> self, @ClosureParams(MapEntryOrKeyValue.class)
      Closure<T> transform)

      Iterates through this Map transforming each map entry into a new value using the `transform` closure returning a list of transformed values.

           assert [a:1, b:2].collect { key, value -> key * value } == ["a", "bb"]
           assert [3:20, 2:30].collect { entry -> entry.key * entry.value } == [60, 60]

      Parameters:
        `self` - a Map
        `transform` - the transformation closure which can take one (Map.Entry) or two (key, value) parameters
      Returns:
        the resultant list of transformed values
      Since:
        1.0

    - #### <E, T> @Deprecated(since = "5.0.0")
      public static List<T> collect(E[] self, @ClosureParams(FirstParam.Component.class)
      Closure<T> transform)

    - #### <E, T, C extends Collection<T>> @Deprecated(since = "5.0.0")
      public static C collect(E[] self, C collector, @ClosureParams(FirstParam.Component.class)
      Closure<? extends T> transform)

    - #### <K, V, X, Y> public static Map<K, V> collectEntries(Map<X, Y> self, Map<K, V> collector, @ClosureParams(MapEntryOrKeyValue.class)
      Closure<?> transform)

      Iterates through this Map transforming each map entry using the `transform` closure returning a map of the transformed entries.

           assert [a:1, b:2].collectEntries([:]) { k, v -> Map.entry(v, k) } == [1:'a', 2:'b']
           assert [a:1, b:2].collectEntries([30:'C']) { key, value -> [(value*10): key.toUpperCase()] } == [10:'A', 20:'B', 30:'C']

      Note: When using the list-style of result, the behavior is '`def (key, value) = listResultFromClosure`'. While we strongly discourage using a list of size other than 2, Groovy's normal semantics apply in this case; throwing away elements after the second one and using null for the key or value for the case of a shortened list. If your collector Map doesn't support null keys or values, you might get a runtime error, e.g. NullPointerException or IllegalArgumentException.
      Parameters:
        `self` - a Map
        `collector` - the Map into which the transformed entries are put
        `transform` - the closure used for transforming, which can take one (Map.Entry) or two (key, value) parameters and should return a Map.Entry, a Map or a two-element list containing the resulting key and value
      Returns:
        the collector with all transformed values added to it
      See Also:
        collect(Map, Collection, Closure)
      Since:
        1.7.9

    - #### <K, V, X, Y> @SuppressWarnings({"rawtypes","unchecked"})
      public static Map<K, V> collectEntries(Map<X, Y> self, @ClosureParams(MapEntryOrKeyValue.class)
      Closure<?> transform)

      Iterates through this Map transforming each entry using the `transform` closure and returning a map of the transformed entries.

           assert [a:1, b:2].collectEntries { key, value -> [value, key] } == [1:'a', 2:'b']
           assert [a:1, b:2].collectEntries { key, value -> [(value*10): key.toUpperCase()] } == [10:'A', 20:'B']

      Note: When using the list-style of result, the behavior is '`def (key, value) = listResultFromClosure`'. While we strongly discourage using a list of size other than 2, Groovy's normal semantics apply in this case; throwing away elements after the second one and using null for the key or value for the case of a shortened list. If your Map doesn't support null keys or values, you might get a runtime error, e.g. NullPointerException or IllegalArgumentException.
      Parameters:
        `self` - a Map
        `transform` - the closure used for transforming, which can take one (Map.Entry) or two (key, value) parameters and should return a Map.Entry, a Map or a two-element list containing the resulting key and value
      Returns:
        a Map of the transformed entries
      See Also:
        collect(Map, Collection, Closure)
      Since:
        1.7.9

    - #### <K, V, E> public static Map<K, V> collectEntries(Iterator<E> self, @ClosureParams(FirstParam.FirstGenericType.class)
      Closure<?> transform)

      A variant of collectEntries for Iterators.

           assert Iterators.iterate(0, Integer::next).take(4).collectEntries { n ->
               ['a'.next(n), n]
           } == [a:0, b:1, c:2, d:3]

      Parameters:
        `self` - an Iterator
        `transform` - the closure used for transforming, which has an item from self as the parameter and should return a Map.Entry, a Map or a two-element list containing the resulting key and value
      Returns:
        a Map of the transformed entries
      See Also:
        collectEntries(Iterable, Closure)
      Since:
        1.8.7

    - #### <K, V, E> public static Map<K, V> collectEntries(Iterable<E> self, @ClosureParams(FirstParam.FirstGenericType.class)
      Closure<?> transform)

      Iterates through this Iterable transforming each item using the `transform` closure and returning a map of the resulting transformed entries.

           def letters = "abc"
           // collect letters with index using list style
           assert (0..2).collectEntries { index -> [index, letters[index]] } == [0:'a', 1:'b', 2:'c']
           // collect letters with index using map style
           assert (0..2).collectEntries { index -> [(index): letters[index]] } == [0:'a', 1:'b', 2:'c']

      Note: When using the list-style of result, the behavior is '`def (key, value) = listResultFromClosure`'. While we strongly discourage using a list of size other than 2, Groovy's normal semantics apply in this case; throwing away elements after the second one and using null for the key or value for the case of a shortened list.
      Parameters:
        `self` - an Iterable
        `transform` - the closure used for transforming, which has an item from self as the parameter and should return a Map.Entry, a Map or a two-element list containing the resulting key and value
      Returns:
        a Map of the transformed entries
      See Also:
        collectEntries(Iterator, Closure)
      Since:
        1.8.7

    - #### <K, V> public static Map<K, V> collectEntries(Iterator<?> self)

      A variant of collectEntries for Iterators using the identity closure as the transform.

      Parameters:
        `self` - an Iterator
      Returns:
        a Map of the transformed entries
      See Also:
        collectEntries(Iterable)
      Since:
        1.8.7

    - #### <K, V> public static Map<K, V> collectEntries(Iterable<?> self)

      A variant of collectEntries for Iterable objects using the identity closure as the transform. The source Iterable should contain a list of `[key, value]` tuples or `Map.Entry` objects.

           def nums = [1, 10, 100, 1000]
           def tuples = nums.collect{ [it, it.toString().size()] }
           assert tuples == [[1, 1], [10, 2], [100, 3], [1000, 4]]
           def map = tuples.collectEntries()
           assert map == [1:1, 10:2, 100:3, 1000:4]

      Parameters:
        `self` - an Iterable
      Returns:
        a Map of the transformed entries
      See Also:
        collectEntries(Iterator)
      Since:
        1.8.7

    - #### <K, V, E> public static Map<K, V> collectEntries(Iterator<E> self, Map<K, V> collector, @ClosureParams(FirstParam.FirstGenericType.class)
      Closure<?> transform)

      A variant of collectEntries for Iterators using a supplied map as the destination of transformed entries.

      Parameters:
        `self` - an Iterator
        `collector` - the Map into which the transformed entries are put
        `transform` - the closure used for transforming, which has an item from self as the parameter and should return a Map.Entry, a Map or a two-element list containing the resulting key and value
      Returns:
        the collector with all transformed values added to it
      Since:
        1.8.7

    - #### <K, V, E> public static Map<K, V> collectEntries(Iterator<E> self, Map<K, V> collector, Function<? super E, K> keyTransform, Function<? super E, V> valueTransform)

      A variant of collectEntries for Iterators with separate functions for transforming the keys and values. The supplied collector map is used as the destination for transformed entries.

      Parameters:
        `self` - an Iterator
        `collector` - the Map into which the transformed entries are put
        `keyTransform` - a function for transforming Iterator elements into keys
        `valueTransform` - a function for transforming Iterator elements into values
      Returns:
        the collector with all transformed values added to it
      Since:
        5.0.0

    - #### <K, V, E> public static Map<K, V> collectEntries(Iterator<E> self, Function<? super E, K> keyTransform, Function<? super E, V> valueTransform)

      A variant of collectEntries for Iterators with separate functions for transforming the keys and values.

      Parameters:
        `self` - an Iterator
        `keyTransform` - a function for transforming Iterator elements into keys
        `valueTransform` - a function for transforming Iterator elements into values
      Returns:
        a Map of the transformed entries
      Since:
        5.0.0

    - #### <K, V, E> public static Map<K, V> collectEntries(Iterable<E> self, Map<K, V> collector, Function<? super E, K> keyTransform, Function<? super E, V> valueTransform)

      A variant of collectEntries for Iterables with separate functions for transforming the keys and values. The supplied collector map is used as the destination for transformed entries.

           def languages = ['Groovy', 'Java', 'Kotlin', 'Scala']
           assert languages.collectEntries([clojure:7], String::toLowerCase, String::size) == [clojure:7, groovy:6, java:4, kotlin:6, scala:5]

      Parameters:
        `self` - an Iterable
        `collector` - the Map into which the transformed entries are put
        `keyTransform` - a function for transforming Iterable elements into keys
        `valueTransform` - a function for transforming Iterable elements into values
      Returns:
        the collector with all transformed values added to it
      Since:
        5.0.0

    - #### <K, V, E> public static Map<K, V> collectEntries(Iterable<E> self, Function<? super E, K> keyTransform, Function<? super E, V> valueTransform)

      A variant of collectEntries for Iterables with separate functions for transforming the keys and values.

           def languages = ['Groovy', 'Java', 'Kotlin', 'Scala']
           assert languages.collectEntries(String::toLowerCase, String::size) ==
               [groovy:6, java:4, kotlin:6, scala:5]

      Parameters:
        `self` - an Iterable
        `keyTransform` - a function for transforming Iterable elements into keys
        `valueTransform` - a function for transforming Iterable elements into values
      Returns:
        a Map of the transformed entries
      Since:
        5.0.0

    - #### <K, V, X, Y> public static Map<K, V> collectEntries(Map<X, Y> self, Map<K, V> collector, Function<? super X, K> keyTransform, Function<? super Y, V> valueTransform)

      A variant of collectEntries for Maps with separate functions for transforming the keys and values. The supplied collector map is used as the destination for transformed entries.

      Parameters:
        `self` - a Map
        `collector` - the Map into which the transformed entries are put
        `keyTransform` - a function for transforming Map keys
        `valueTransform` - a function for transforming Map values
      Returns:
        the collector with all transformed values added to it
      Since:
        5.0.0

    - #### <K, V, X, Y> public static Map<K, V> collectEntries(Map<X, Y> self, Function<? super X, K> keyTransform, Function<? super Y, V> valueTransform)

      A variant of collectEntries for Maps with separate functions for transforming the keys and values.

      Parameters:
        `self` - a Map
        `keyTransform` - a function for transforming Map keys
        `valueTransform` - a function for transforming Map values
      Returns:
        a Map of the transformed entries
      Since:
        5.0.0

    - #### <K, V, E> public static Map<K, V> collectEntries(Iterable<E> self, Map<K, V> collector, @ClosureParams(FirstParam.FirstGenericType.class)
      Closure<?> transform)

      Iterates through this Iterable transforming each item using the closure as a transformer into a map entry, returning the supplied map with all the transformed entries added to it.

           def letters = "abc"
           // collect letters with index
           assert (0..2).collectEntries( [:] ) { index -> [index, letters[index]] } == [0:'a', 1:'b', 2:'c']
           assert (0..2).collectEntries( [4:'d'] ) { index -> [(index+1): letters[index]] } == [1:'a', 2:'b', 3:'c', 4:'d']

      Note: When using the list-style of result, the behavior is '`def (key, value) = listResultFromClosure`'. While we strongly discourage using a list of size other than 2, Groovy's normal semantics apply in this case; throwing away elements after the second one and using null for the key or value for the case of a shortened list. If your collector Map doesn't support null keys or values, you might get a runtime error, e.g. NullPointerException or IllegalArgumentException.
      Parameters:
        `self` - an Iterable
        `collector` - the Map into which the transformed entries are put
        `transform` - the closure used for transforming, which has an item from self as the parameter and should return a Map.Entry, a Map or a two-element list containing the resulting key and value
      Returns:
        the collector with all transformed values added to it
      See Also:
        collectEntries(Iterator, Map, Closure)
      Since:
        1.8.7

    - #### <K, V> public static Map<K, V> collectEntries(Iterator<?> self, Map<K, V> collector)

      A variant of collectEntries for Iterators using the identity closure as the transform and a supplied map as the destination of transformed entries.

      Parameters:
        `self` - an Iterator
        `collector` - the Map into which the transformed entries are put
      Returns:
        the collector with all transformed values added to it
      See Also:
        collectEntries(Iterable, Map)
      Since:
        1.8.7

    - #### <K, V> public static Map<K, V> collectEntries(Iterable<?> self, Map<K, V> collector)

      A variant of collectEntries for Iterables using the identity closure as the transform and a supplied map as the destination of transformed entries.

      Parameters:
        `self` - an Iterable
        `collector` - the Map into which the transformed entries are put
      Returns:
        the collector with all transformed values added to it
      See Also:
        collectEntries(Iterator, Map)
      Since:
        1.8.7

    - #### <K, V, E> @Deprecated(since = "5.0.0")
      public static Map<K, V> collectEntries(E[] self)

    - #### <K, V, E> @Deprecated(since = "5.0.0")
      public static Map<K, V> collectEntries(E[] self, Map<K, V> collector)

    - #### <K, V, E> @Deprecated(since = "5.0.0")
      public static Map<K, V> collectEntries(E[] self, @ClosureParams(FirstParam.Component.class)
      Closure<?> transform)

    - #### <K, V, E> @Deprecated(since = "5.0.0")
      public static Map<K, V> collectEntries(E[] self, Map<K, V> collector, @ClosureParams(FirstParam.Component.class)
      Closure<?> transform)

    - #### <K, V> public static Map<K, V> collectKeys(Map<K, V> keys, Map<K, V> collector, Function<? super K, K> keyTransform)

      Transform a Maps' keys leaving the values unchanged. Similar to withCollectedKeys(Iterable, Map, Function) but for Maps.

           def lengths = [Groovy:6, Java:4, Kotlin:6, Scala:5]
           def firstLetter = (s) -> s[0]
           assert lengths.collectKeys([C:7], firstLetter) == [C:7, G:6, J:4, K:6, S:5]

      Parameters:
        `keys` - a Map
        `collector` - the Map into which the transformed entries are put
        `keyTransform` - a function for transforming Map keys
      Returns:
        the collector with all transformed values added to it
      Since:
        5.0.0

    - #### <K, V> public static Map<K, V> collectKeys(Map<K, V> keys, Function<? super K, K> keyTransform)

      Transform a Maps' keys leaving the values unchanged. Similar to withCollectedKeys(Iterable, Function) but for Maps.

           def lengths = [Groovy:6, Java:4, Kotlin:6, Scala:5]
           def firstLetter = (s) -> s[0]
           assert lengths.collectKeys(firstLetter) == [G:6, J:4, K:6, S:5]

      Parameters:
        `keys` - a Map
        `keyTransform` - a function for transforming Map keys
      Returns:
        a Map of the transformed entries
      Since:
        5.0.0

    - #### <T, E> public static List<T> collectMany(Iterable<E> self, @ClosureParams(FirstParam.FirstGenericType.class)
      Closure<? extends Collection<? extends T>> projection)

      Projects each item from a source Iterable to a collection and concatenates (flattens) the resulting collections into a single list.

           def nums = 1..10
           def squaresAndCubesOfEvens = nums.collectMany{ it % 2 ? [] : [it**2, it**3] }
           assert squaresAndCubesOfEvens == [4, 8, 16, 64, 36, 216, 64, 512, 100, 1000]

           def animals = ['CAT', 'DOG', 'ELEPHANT'] as Set
           def smallAnimals = animals.collectMany{ it.size() > 3 ? [] : [it.toLowerCase()] }
           assert smallAnimals == ['cat', 'dog']

           def orig = nums as Set
           def origPlusIncrements = orig.collectMany{ [it, it+1] }
           assert origPlusIncrements.size() == orig.size() * 2
           assert origPlusIncrements.unique().size() == orig.size() + 1

      Parameters:
        `self` - an Iterable
        `projection` - a projecting Closure returning a collection of items
      Returns:
        a list created from the projected collections concatenated (flattened) together
      See Also:
        sum(java.lang.Iterable, groovy.lang.Closure)
      Since:
        2.2.0

    - #### <T, E> public static List<T> collectMany(Iterable<E> self)

      Flattens an iterable of collections into a list.

      Parameters:
        `self` - an iterable of iterables
      Returns:
        the flattened list of elements
      Since:
        5.0.0

    - #### <T, E, C extends Collection<T>> public static C collectMany(Iterable<E> self, C collector, @ClosureParams(FirstParam.FirstGenericType.class)
      Closure<? extends Collection<? extends T>> projection)

      Projects each item from a source collection to a result collection and concatenates (flattens) the resulting collections adding them into the `collector`.

           def animals = ['CAT', 'DOG', 'ELEPHANT']
           def smallAnimals = animals.collectMany(['ant', 'bee']){ it.size() > 3 ? [] : [it.toLowerCase()] }
           assert smallAnimals == ['ant', 'bee', 'cat', 'dog']

           def nums = 1..5
           def origPlusIncrements = nums.collectMany([] as Set){ [it, it+1] }
           assert origPlusIncrements.size() == nums.size() + 1

           @groovy.transform.TypeChecked void test() {
             LinkedHashSet<String> lhs = ['abc','def'].collectMany(new LinkedHashSet<>()){ it.iterator().toList() }
             assert lhs == ['a','b','c','d','e','f'] as Set<String>
           }
           test()

      Parameters:
        `self` - an Iterable
        `collector` - an initial collection to add the projected items to
        `projection` - a projecting Closure returning a collection of items
      Returns:
        the collector with the projected collections concatenated (flattened) into it
      Since:
        2.2.0

    - #### <T, K, V, C extends Collection<T>> public static C collectMany(Map<K, V> self, C collector, @ClosureParams(MapEntryOrKeyValue.class)
      Closure<? extends Collection<? extends T>> projection)

      Projects each item from a source map to a result collection and concatenates (flattens) the resulting collections adding them into the `collector`.

           def map = [bread:3, milk:5, butter:2]
           def result = map.collectMany(['x']){ k, v -> if (k.startsWith('b')) k.toList() }
           assert result == ['x', 'b', 'r', 'e', 'a', 'd', 'b', 'u', 't', 't', 'e', 'r']

      Parameters:
        `self` - a map
        `collector` - an initial collection to add the projected items to
        `projection` - a projecting Closure returning a collection of items
      Returns:
        the collector with the projected collections concatenated (flattened) to it
      Since:
        1.8.8

    - #### <T, K, V> public static List<T> collectMany(Map<K, V> self, @ClosureParams(MapEntryOrKeyValue.class)
      Closure<? extends Collection<? extends T>> projection)

      Projects each item from a source map to a result collection and concatenates (flattens) the resulting collections adding them into a collection.

           def map = [bread:3, milk:5, butter:2]
           def result = map.collectMany{ k, v -> k.startsWith('b') ? k.toList() : [] }
           assert result == ['b', 'r', 'e', 'a', 'd', 'b', 'u', 't', 't', 'e', 'r']

      Parameters:
        `self` - a map
        `projection` - a projecting Closure returning a collection of items
      Returns:
        a list created from the projected collections concatenated (flattened) together
      Since:
        1.8.8

    - #### <T, E, C extends Collection<T>> public static C collectMany(Iterator<E> self, C collector, @ClosureParams(FirstParam.FirstGenericType.class)
      Closure<? extends Collection<? extends T>> projection)

      Projects each item from a source iterator to a collection and concatenates (flattens) the resulting collections into a single list.

           def numsIter = [1, 2, 3, 4, 5, 6].iterator()
           def squaresAndCubesOfEvens = numsIter.collectMany{ if (it % 2 == 0) [it**2, it**3] }
           assert squaresAndCubesOfEvens == [4, 8, 16, 64, 36, 216]

           var letters = 'a'..'z'
           var pairs = letters.collectMany{ a ->
               letters.collectMany{ b ->
                   if (a != b) ["$a$b"]
               }
           }
           assert pairs.join(',').matches('ab,ac,ad,.*,zw,zx,zy')

      Parameters:
        `self` - an iterator
        `collector` - an initial collection to add the projected items to
        `projection` - a projecting Closure returning a collection of items
      Returns:
        the collector with the projected collections concatenated (flattened) to it
      See Also:
        sum(Iterator, groovy.lang.Closure)
      Since:
        1.8.1

    - #### <T, E> public static List<T> collectMany(Iterator<E> self, @ClosureParams(FirstParam.FirstGenericType.class)
      Closure<? extends Collection<? extends T>> projection)

      Projects each item from a source iterator to a collection and concatenates (flattens) the resulting collections into a single list.

           def numsIter = [1, 2, 3, 4, 5, 6].iterator()
           def squaresAndCubesOfEvens = numsIter.collectMany{ it % 2 ? [] : [it**2, it**3] }
           assert squaresAndCubesOfEvens == [4, 8, 16, 64, 36, 216]

      Parameters:
        `self` - an iterator
        `projection` - a projecting Closure returning a collection of items
      Returns:
        a list created from the projected collections concatenated (flattened) together
      See Also:
        collectMany(Iterator, Collection, groovy.lang.Closure)
      Since:
        1.8.1

    - #### <T, E> public static List<T> collectMany(Iterator<E> self)

      Flattens an iterator of collections into a single list.

           assert [1, 2].zip([10, 20]).collectMany() == [1, 10, 2, 20]

      Parameters:
        `self` - an iterator
      Returns:
        a list created from the source collections concatenated (flattened) together
      See Also:
        collectMany(Iterator, groovy.lang.Closure)
      Since:
        5.0.0

    - #### <T, E> @Deprecated(since = "5.0.0")
      public static List<T> collectMany(E[] self, @ClosureParams(FirstParam.Component.class)
      Closure<? extends Collection<? extends T>> projection)

    - #### <T, E, C extends Collection<T>> @Deprecated(since = "5.0.0")
      public static C collectMany(E[] self, C collector, @ClosureParams(FirstParam.Component.class)
      Closure<? extends Collection<? extends T>> projection)

    - #### <T, K, V> @Deprecated
      public static Collection<T> collectMany$$bridge(Map<K, V> self, @ClosureParams(MapEntryOrKeyValue.class)
      Closure<? extends Collection<? extends T>> projection)

    - #### public static List collectNested(Collection self, Closure transform)

      Recursively iterates through this collection transforming each non-Collection value into a new value using the closure as a transformer. Returns a potentially nested list of transformed values.

           assert [2,[4,6],[8],[]] == [1,[2,3],[4],[]].collectNested { it * 2 }

      Parameters:
        `self` - a collection
        `transform` - the closure used to transform each item of the collection
      Returns:
        the resultant collection
      Since:
        1.8.1

    - #### public static List collectNested(Iterable self, Closure transform)

      Recursively iterates through this Iterable transforming each non-Collection value into a new value using the closure as a transformer. Returns a potentially nested list of transformed values.

           assert [2,[4,6],[8],[]] == [1,[2,3],[4],[]].collectNested { it * 2 }

      Parameters:
        `self` - an Iterable
        `transform` - the closure used to transform each item of the Iterable
      Returns:
        the resultant list
      Since:
        2.2.0

    - #### <C extends Collection> @SuppressWarnings("unchecked")
      public static C collectNested(Iterable self, C collector, Closure transform)

      Recursively iterates through this Iterable transforming each non-Collection value into a new value using the `transform` closure. Returns a potentially nested collection of transformed values.

           def x = [1,[2,3],[4],[]].collectNested(new Vector()) { it * 2 }
           assert x == [2,[4,6],[8],[]]
           assert x instanceof Vector

      Parameters:
        `self` - an Iterable
        `collector` - an initial Collection to which the transformed values are added
        `transform` - the closure used to transform each element of the Iterable
      Returns:
        the collector with all transformed values added to it
      Since:
        2.2.0

    - #### <K, V> public static Map<K, V> collectValues(Map<K, V> keys, Map<K, V> collector, Function<? super V, V> valueTransform)

      Transform a Maps' values leaving the keys unchanged. Similar to withCollectedValues(Iterable, Map, Function) but for Maps.

           def lengths = [Groovy:6, Java:4, Kotlin:6, Scala:5]
           def squared = (e) -> e ** 2
           assert lengths.collectValues([Clojure:49], squared) ==
               [Clojure:49, Groovy:36, Java:16, Kotlin:36, Scala:25]

      Parameters:
        `keys` - a Map
        `collector` - the Map into which the transformed entries are put
        `valueTransform` - a function for transforming Map values
      Returns:
        the collector with all transformed values added to it
      Since:
        5.0.0

    - #### <K, V> public static Map<K, V> collectValues(Map<K, V> keys, Function<? super V, V> valueTransform)

      Transform a Maps' values leaving the keys unchanged. Similar to withCollectedValues(Iterable, Function) but for Maps.

           def lengths = [Groovy:6, Java:4, Kotlin:6, Scala:5]
           def squared = (e) -> e ** 2
           assert lengths.collectValues(squared) == [Groovy:36, Java:16, Kotlin:36, Scala:25]

      Parameters:
        `keys` - a Map
        `valueTransform` - a function for transforming Map values
      Returns:
        a Map of the transformed entries
      Since:
        5.0.0

    - #### <E, T> public static Iterator<T> collecting(@groovy.lang.DelegatesTo.Target
      Iterator<E> self, @DelegatesTo(genericTypeIndex = 0)
      @ClosureParams(FirstParam.FirstGenericType.class)
      Closure<T> transform)

      Returns an iterator of transformed values from the source iterator using the `transform` closure.

           assert [1, 2, 3].repeat().collecting(Integer::next).take(6).toList() == [2, 3, 4, 2, 3, 4]
           assert Iterators.iterate('a', String::next).collecting{ (int)it - (int)'a' }.take(26).toList() == 0..25

      Parameters:
        `self` - an Iterator
        `transform` - the closure used to transform each element
      Returns:
        an Iterator for the transformed values
      Since:
        5.0.0

    - #### <K, V, E> public static Iterator<Map.Entry<K, V>> collectingEntries(@groovy.lang.DelegatesTo.Target
      Iterator<E> self, @DelegatesTo(genericTypeIndex = 0)
      @ClosureParams(FirstParam.FirstGenericType.class)
      Closure<?> transform)

      Returns an iterator of transformed values from the source iterator using the `transform` closure.

           assert Iterators.iterate(0, Integer::next).take(40).collectingEntries { n ->
               var c = 'a'
               n.times{ c = c.next() }
               [c, n]
           }.take(4).collect(e -> e.key + e.value) == ['a0', 'b1', 'c2', 'd3']

      Parameters:
        `self` - an Iterator
        `transform` - the closure used to transform each element
      Returns:
        an Iterator for the transformed values
      Since:
        5.0.0

    - #### <T, E> public static Iterator<T> collectingMany(@groovy.lang.DelegatesTo.Target
      Iterator<E> self, @DelegatesTo(genericTypeIndex = 0)
      @ClosureParams(FirstParam.FirstGenericType.class)
      Closure<? extends Collection<? extends T>> projection)

      Iterates through the elements produced by projecting and flattening the elements from a source iterator.

           def numsIter = [1, 2, 3, 4, 5, 6].iterator()
           def squaresAndCubesOfEvens = numsIter.collectingMany{ if (it % 2 == 0) [it**2, it**3] }.collect()
           assert squaresAndCubesOfEvens == [4, 8, 16, 64, 36, 216]

               var letters = 'a'..'z'
           var pairs = letters.iterator().collectingMany{ a ->
               letters.iterator().collectingMany{ b ->
                   if (a != b) ["$a$b"]
               }.collect()
           }.collect()
           assert pairs.join(',').matches('ab,ac,ad,.*,zw,zx,zy')

      Parameters:
        `self` - a source iterator
        `projection` - a projecting Closure returning a collection of items
      Returns:
        an iterator of the projected collections flattened
      Since:
        5.0.0

    - #### public static List<List> combinations(Iterable self)

      Finds all combinations of items from the given aggregate of collections.

      Example usage:

           result = [['a', 'b'], [1, 2, 3]].combinations()
           assert result == [['a', 1], ['b', 1], ['a', 2], ['b', 2], ['a', 3], ['b', 3]]

      Parameters:
        `self` - an iterable of collections
      Returns:
        A list of the combinations (lists).
      See Also:
        GroovyCollections.combinations
      Since:
        2.2.0

    - #### <T> public static List<T> combinations(Iterable self, @ClosureParams(value=FromString.class, options="List")
      Closure<T> function)

      Finds all combinations of items from the given aggregate of collections, then returns the results of the supplied transform.

      Example usage:

           result = [[2, 3], [4, 5, 6]].combinations { x,y -> x*y }
           assert result == [8, 12, 10, 15, 12, 18]

      Parameters:
        `self` - an iterable of collections
        `function` - a closure to be called on each combination (list)
      Returns:
        A list of the results of applying the closure to each combination.
      See Also:
        GroovyCollections.combinations
        collect(Iterable,Closure)
      Since:
        2.2.0

    - #### public static int compareTo(Character left, Number right)

      Compares a Character and a Number. The ordinal value of the Character is used in the comparison (the ordinal value is the unicode value which for simple character sets is the ASCII value).

      Parameters:
        `left` - a Character
        `right` - a Number
      Returns:
        the result of the comparison
      Since:
        1.0

    - #### public static int compareTo(Number left, Character right)

      Compares a Number and a Character. The ordinal value of the Character is used in the comparison (the ordinal value is the unicode value which for simple character sets is the ASCII value).

      Parameters:
        `left` - a Number
        `right` - a Character
      Returns:
        the result of the comparison
      Since:
        1.0

    - #### public static int compareTo(Character left, Character right)

      Compares two Characters. The ordinal values of the Characters are compared (the ordinal value is the unicode value which for simple character sets is the ASCII value).

      Parameters:
        `left` - a Character
        `right` - a Character
      Returns:
        the result of the comparison
      Since:
        1.0

    - #### public static int compareTo(Number left, Number right)

      Compares two Numbers. Equality (==) for numbers dispatches to this.

      Parameters:
        `left` - a Number
        `right` - another Number to compare to
      Returns:
        the comparison of both numbers
      Since:
        1.0

    - #### public static boolean contains(Iterable self, Object item)

      Returns `true` if this iterable contains the item.

      Parameters:
        `self` - an Iterable to be checked for containment
        `item` - an Object to be checked for containment in this iterable
      Returns:
        `true` if this iterable contains the item
      See Also:
        Collection.contains
      Since:
        2.4.0

    - #### @Deprecated(since = "5.0.0")
      public static boolean contains(boolean[] self, Object value)

    - #### @Deprecated(since = "5.0.0")
      public static boolean contains(byte[] self, Object value)

    - #### @Deprecated(since = "5.0.0")
      public static boolean contains(char[] self, Object value)

    - #### @Deprecated(since = "5.0.0")
      public static boolean contains(short[] self, Object value)

    - #### @Deprecated(since = "5.0.0")
      public static boolean contains(int[] self, Object value)

    - #### @Deprecated(since = "5.0.0")
      public static boolean contains(long[] self, Object value)

    - #### @Deprecated(since = "5.0.0")
      public static boolean contains(float[] self, Object value)

    - #### @Deprecated(since = "5.0.0")
      public static boolean contains(double[] self, Object value)

    - #### @Deprecated(since = "5.0.0")
      public static boolean contains(Object[] self, Object value)

    - #### public static boolean containsAll(Iterable<?> self, Object[] items)

      Returns `true` if this iterable contains all the elements in the specified array.

      Parameters:
        `self` - an Iterable to be checked for containment
        `items` - array to be checked for containment in this iterable
      Returns:
        `true` if this collection contains all the elements in the specified array
      See Also:
        Collection.containsAll
      Since:
        2.4.0

    - #### public static Number count(Iterator self, Object value)

      Counts the number of occurrences of the given value from the items within this Iterator. Comparison is done using Groovy's == operator (using `compareTo(value) == 0` or `equals(value)` ). The iterator will become exhausted of elements after determining the count value.

      Example usage:

           var nums = [2,4,2,1,3,2,4]
           assert nums.iterator().count(2) == 3
           assert nums.iterator().count(4) == 2

      Parameters:
        `self` - the Iterator from which we count the number of matching occurrences
        `value` - the value being searched for
      Returns:
        the number of occurrences
      Since:
        1.5.0

    - #### <T> public static Number count(Iterator<T> self, @ClosureParams(FirstParam.FirstGenericType.class)
      Closure closure)

      Counts the number of occurrences which satisfy the given closure from the items within this Iterator. The iterator will become exhausted of elements after determining the count value.

      Example usage:

           assert [2,4,2,1,3,5,2,4,3].toSet().iterator().count{ it % 2 == 0 } == 2

      Parameters:
        `self` - the Iterator from which we count the number of matching occurrences
        `closure` - a closure condition
      Returns:
        the number of occurrences
      Since:
        1.8.0

    - #### <T, E extends Number> public static E count(Iterator<T> self, E initialCount, @ClosureParams(FirstParam.FirstGenericType.class)
      Closure closure)

      Counts the number of occurrences which satisfy the given closure from the items within this Iterator, adding the count to the initial count. The iterator will become exhausted of elements after determining the count value.

      Example usage:

           assert [2,4,2,1,3,5,2,4,3].toSet().iterator().count(100){ it % 2 == 0 } == 102

      Parameters:
        `self` - the Iterator from which we count the number of matching occurrences
        `initialCount` - start counting from this value
        `closure` - a closure condition
      Returns:
        the number of occurrences
      Since:
        4.0.14

    - #### public static Number count(Iterable self, Object value)

      Counts the number of occurrences of the given value inside this Iterable. Comparison is done using Groovy's == operator (using `compareTo(value) == 0` or `equals(value)` ).

      Example usage:

           assert [2,4,2,1,3,5,2,4,3].count(4) == 2

      Parameters:
        `self` - the Iterable within which we count the number of occurrences
        `value` - the value being searched for
      Returns:
        the number of occurrences
      Since:
        2.2.0

    - #### <T> public static Number count(Iterable<T> self, @ClosureParams(FirstParam.FirstGenericType.class)
      Closure closure)

      Counts the number of occurrences which satisfy the given closure from inside this Iterable.

      Example usage:

           assert [2,4,2,1,3,5,2,4,3].count{ it % 2 == 0 } == 5

      Parameters:
        `self` - the Iterable within which we count the number of occurrences
        `closure` - a closure condition
      Returns:
        the number of occurrences
      Since:
        2.2.0

    - #### <T, E extends Number> public static E count(Iterable<T> self, E initialCount, @ClosureParams(FirstParam.FirstGenericType.class)
      Closure closure)

      Counts the number of occurrences which satisfy the given closure from inside this Iterable.

      Example usage:

           assert [2,4,2,1,3,5,2,4,3].count(100L){ it % 2 == 0 } == 105L

      Parameters:
        `self` - the Iterable within which we count the number of occurrences
        `initialCount` - start counting from this value
        `closure` - a closure condition
      Returns:
        the number of occurrences
      Since:
        4.0.14

    - #### <K, V> public static Number count(Map<K, V> self, @ClosureParams(MapEntryOrKeyValue.class)
      Closure<?> closure)

      Counts the number of occurrences which satisfy the given closure from inside this map. If the closure takes one parameter then it will be passed the Map.Entry. Otherwise, the closure should take two parameters and will be passed the key and value.

      Example usage:

           assert [a:1, b:1, c:2, d:2].count{ k,v -> k == 'a' || v == 2 } == 3

      Parameters:
        `self` - the map within which we count the number of occurrences
        `closure` - a 1 or 2 arg Closure condition applying on the entries
      Returns:
        the number of occurrences
      Since:
        1.8.0

    - #### <K, V, E extends Number> public static E count(Map<K, V> self, E initialCount, @ClosureParams(MapEntryOrKeyValue.class)
      Closure<?> closure)

      Counts the number of occurrences which satisfy the given closure from inside this map. If the closure takes one parameter then it will be passed the Map.Entry. Otherwise, the closure should take two parameters and will be passed the key and value.

      Example usage:

           assert [a:1, b:1, c:2, d:2].count(100G){ k,v -> k == 'a' || v == 2 } == 103G

      Parameters:
        `self` - the map within which we count the number of occurrences
        `initialCount` - start counting from this value
        `closure` - a 1 or 2 arg Closure condition applying on the entries
      Returns:
        the number of occurrences
      Since:
        4.0.14

    - #### @Deprecated(since = "5.0.0")
      public static Number count(boolean[] self, Object value)

    - #### @Deprecated(since = "5.0.0")
      public static Number count(byte[] self, Object value)

    - #### @Deprecated(since = "5.0.0")
      public static Number count(char[] self, Object value)

    - #### @Deprecated(since = "5.0.0")
      public static Number count(short[] self, Object value)

    - #### @Deprecated(since = "5.0.0")
      public static Number count(int[] self, Object value)

    - #### @Deprecated(since = "5.0.0")
      public static Number count(long[] self, Object value)

    - #### @Deprecated(since = "5.0.0")
      public static Number count(float[] self, Object value)

    - #### @Deprecated(since = "5.0.0")
      public static Number count(double[] self, Object value)

    - #### @Deprecated(since = "5.0.0")
      public static Number count(Object[] self, Object value)

    - #### <T> @Deprecated(since = "5.0.0")
      public static Number count(T[] self, @ClosureParams(FirstParam.Component.class)
      Closure predicate)

    - #### <K, E> public static Map<K, Integer> countBy(Iterable<E> self, @ClosureParams(FirstParam.FirstGenericType.class)
      Closure<K> closure)

      Sorts all collection members into groups determined by the supplied mapping closure and counts the group size. The closure should return the key that each item should be grouped by. The returned Map will have an entry for each distinct key returned from the closure, with each value being the frequency of items occurring for that group.

      Example usage:

          assert [0:2, 1:3] == [1,2,3,4,5].countBy { it % 2 }

      Parameters:
        `self` - a collection to group and count
        `closure` - a closure mapping items to the frequency keys
      Returns:
        a new Map grouped by keys with frequency counts
      Since:
        2.2.0

    - #### <E> public static Map<E, Integer> countBy(Iterable<E> self)

      Creates a multiset-like map of the collection members.

      Example usage:

          assert [1:2, 2:2, 3:1] == [1,2,1,2,3].countBy()

      Parameters:
        `self` - a collection to group and count
      Returns:
        a new Map where the keys are the set of values in the collection and the values are the frequency counts
      Since:
        5.0.0

    - #### <K, E> public static Map<K, Integer> countBy(Iterator<E> self, @ClosureParams(FirstParam.FirstGenericType.class)
      Closure<K> closure)

      Sorts all iterator items into groups determined by the supplied mapping closure and counts the group size. The closure should return the key that each item should be grouped by. The returned Map will have an entry for each distinct key returned from the closure, with each value being the frequency of items occurring for that group.

      Example usage:

          assert [1,2,2,2,3].toSet().iterator().countBy{ it % 2 } == [1:2, 0:1]

      Parameters:
        `self` - an iterator to group and count
        `closure` - a closure mapping items to the frequency keys
      Returns:
        a new Map grouped by keys with frequency counts
      Since:
        1.8.0

    - #### <E> public static Map<E, Integer> countBy(Iterator<E> self)

      Creates a multiset-like map of the iterator members.

      Example usage:

          assert [1:2, 2:2, 3:1] == [1,2,1,2,3].iterator().countBy()

      Parameters:
        `self` - an iterator to group and count
      Returns:
        a new Map where the keys are the set of values produced by the iterator and the values are the frequency counts
      Since:
        5.0.0

    - #### <K, U, V> public static Map<K, Integer> countBy(Map<U, V> self, @ClosureParams(MapEntryOrKeyValue.class)
      Closure<K> closure)

      Groups the members of a map into groups determined by the supplied mapping closure and counts the frequency of the created groups. The closure will be passed a Map.Entry or key and value (depending on the number of parameters the closure accepts) and should return the key that each item should be grouped under. The resulting map will have an entry for each 'group' key returned by the closure, with values being the frequency counts for that 'group'.

          def result = [a:1,b:2,c:3,d:4,e:5].countBy { it.value % 2 }
           assert result == [0:2, 1:3]

      Parameters:
        `self` - a map to group and count
        `closure` - a closure mapping entries to frequency count keys
      Returns:
        a new Map grouped by keys with frequency counts
      Since:
        1.8.0

    - #### <K, E> @Deprecated(since = "5.0.0")
      public static Map<K, Integer> countBy(E[] self, @ClosureParams(FirstParam.Component.class)
      Closure<K> closure)

    - #### @SuppressWarnings("unchecked")
      public static boolean disjoint(Iterable left, Iterable right)

      Returns `true` if the intersection of two iterables is empty.

          assert [1,2,3].disjoint([3,4,5]) == false

          assert [1,2].disjoint([3,4]) == true

      Parameters:
        `left` - an Iterable
        `right` - an Iterable
      Returns:
        boolean `true` if the intersection of two iterables is empty, `false` otherwise.
      Since:
        2.4.0

    - #### public static Number div(Character left, Number right)

      Divide a Character by a Number. The ordinal value of the Character is used in the division (the ordinal value is the unicode value which for simple character sets is the ASCII value).

      Parameters:
        `left` - a Character
        `right` - a Number
      Returns:
        the Number corresponding to the division of left by right
      Since:
        1.0

    - #### public static Number div(Number left, Character right)

      Divide a Number by a Character. The ordinal value of the Character is used in the division (the ordinal value is the unicode value which for simple character sets is the ASCII value).

      Parameters:
        `left` - a Number
        `right` - a Character
      Returns:
        the Number corresponding to the division of left by right
      Since:
        1.0

    - #### public static Number div(Character left, Character right)

      Divide one Character by another. The ordinal values of the Characters are used in the division (the ordinal value is the unicode value which for simple character sets is the ASCII value).

      Parameters:
        `left` - a Character
        `right` - another Character
      Returns:
        the Number corresponding to the division of left by right
      Since:
        1.0

    - #### public static void downto(Number self, Number to, @ClosureParams(FirstParam.class)
      Closure closure)

      Iterates from this number down to the given number, inclusive, decrementing by one each time.

      Parameters:
        `self` - a Number
        `to` - another Number to go down to
        `closure` - the closure to call
      Since:
        1.0

    - #### public static void downto(long self, Number to, @ClosureParams(FirstParam.class)
      Closure closure)

      Iterates from this number down to the given number, inclusive, decrementing by one each time.

      Parameters:
        `self` - a long
        `to` - the end number
        `closure` - the code to execute for each number
      Since:
        1.0

    - #### public static void downto(Long self, Number to, @ClosureParams(FirstParam.class)
      Closure closure)

      Iterates from this number down to the given number, inclusive, decrementing by one each time.

      Parameters:
        `self` - a Long
        `to` - the end number
        `closure` - the code to execute for each number
      Since:
        1.0

    - #### public static void downto(float self, Number to, @ClosureParams(FirstParam.class)
      Closure closure)

      Iterates from this number down to the given number, inclusive, decrementing by one each time.

      Parameters:
        `self` - a float
        `to` - the end number
        `closure` - the code to execute for each number
      Since:
        1.0

    - #### public static void downto(Float self, Number to, @ClosureParams(FirstParam.class)
      Closure closure)

      Iterates from this number down to the given number, inclusive, decrementing by one each time.

      Parameters:
        `self` - a Float
        `to` - the end number
        `closure` - the code to execute for each number
      Since:
        1.0

    - #### public static void downto(double self, Number to, @ClosureParams(FirstParam.class)
      Closure closure)

      Iterates from this number down to the given number, inclusive, decrementing by one each time.

      Parameters:
        `self` - a double
        `to` - the end number
        `closure` - the code to execute for each number
      Since:
        1.0

    - #### public static void downto(Double self, Number to, @ClosureParams(FirstParam.class)
      Closure closure)

      Iterates from this number down to the given number, inclusive, decrementing by one each time.

      Parameters:
        `self` - a Double
        `to` - the end number
        `closure` - the code to execute for each number
      Since:
        1.0

    - #### public static void downto(BigInteger self, Number to, @ClosureParams(FirstParam.class)
      Closure closure)

      Iterates from this number down to the given number, inclusive, decrementing by one each time.

      Parameters:
        `self` - a BigInteger
        `to` - the end number
        `closure` - the code to execute for each number
      Since:
        1.0

    - #### public static void downto(BigDecimal self, Number to, @ClosureParams(FirstParam.class)
      Closure closure)

      Iterates from this number down to the given number, inclusive, decrementing by one each time. Each number is passed to the closure. Example:

           10.5.downto(0) {
             println it
           }

      Prints numbers 10.5, 9.5 ... to 0.5.
      Parameters:
        `self` - a BigDecimal
        `to` - the end number
        `closure` - the code to execute for each number
      Since:
        1.0

    - #### <T> public static List<T> drain(Queue<T> self)

      Drain the queue of elements, returning them as a list.

           def letters = new PriorityQueue(String.CASE_INSENSITIVE_ORDER)
           letters.addAll(['Z', 'y', 'X', 'a', 'B', 'c'])
           assert letters.toList() == ['a', 'B', 'c', 'Z', 'X', 'y']
           assert letters.drain() == ['a', 'B', 'c', 'X', 'y', 'Z']
           assert letters.empty

      Parameters:
        `self` - a Queue
      Returns:
        a List of elements removed from the head of the queue
      Since:
        5.0.0

    - #### <T> public static SortedSet<T> drop(SortedSet<T> self, int num)

      Drops the given number of elements from the head of this List.

           def strings = [ 'a', 'b', 'c' ] as SortedSet
           assert strings.drop( 0 ) == [ 'a', 'b', 'c' ] as SortedSet
           assert strings.drop( 2 ) == [ 'c' ] as SortedSet
           assert strings.drop( 5 ) == [] as SortedSet

      Parameters:
        `self` - the original SortedSet
        `num` - the number of elements to drop from this Iterable
      Returns:
        a SortedSet consisting of all the elements of this Iterable minus the first `num` elements, or an empty list if it has less than `num` elements.
      Since:
        2.4.0

    - #### <T> public static List<T> drop(List<T> self, int num)

      Drops the given number of elements from the head of this List.

           def strings = [ 'a', 'b', 'c' ]
           assert strings.drop( 0 ) == [ 'a', 'b', 'c' ]
           assert strings.drop( 2 ) == [ 'c' ]
           assert strings.drop( 5 ) == []

      Parameters:
        `self` - the original List
        `num` - the number of elements to drop from this Iterable
      Returns:
        a List consisting of all the elements of this Iterable minus the first `num` elements, or an empty list if it has less than `num` elements.
      Since:
        1.8.1

    - #### <T> public static Collection<T> drop(Iterable<T> self, int num)

      Drops the given number of elements from the head of this Iterable.

           def strings = [ 'a', 'b', 'c' ]
           assert strings.drop( 0 ) == [ 'a', 'b', 'c' ]
           assert strings.drop( 2 ) == [ 'c' ]
           assert strings.drop( 5 ) == []

           class AbcIterable implements Iterable {
               Iterator iterator() { "abc".iterator() }
           }
           def abc = new AbcIterable()
           assert abc.drop(0) == ['a', 'b', 'c']
           assert abc.drop(1) == ['b', 'c']
           assert abc.drop(3) == []
           assert abc.drop(5) == []

      Parameters:
        `self` - the original Iterable
        `num` - the number of elements to drop from this Iterable
      Returns:
        a Collection consisting of all the elements of this Iterable minus the first `num` elements, or an empty list if it has less than `num` elements.
      Since:
        1.8.7

    - #### <K, V> public static Map<K, V> drop(Map<K, V> self, int num)

      Drops the given number of key/value pairs from the head of this map if they are available.

           def strings = [ 'a':10, 'b':20, 'c':30 ]
           assert strings.drop( 0 ) == [ 'a':10, 'b':20, 'c':30 ]
           assert strings.drop( 2 ) == [ 'c':30 ]
           assert strings.drop( 5 ) == [:]

      If the map instance does not have ordered keys, then this function could drop a random `num` entries. Groovy by default uses LinkedHashMap, so this shouldn't be an issue in the main.
      Parameters:
        `self` - the original map
        `num` - the number of elements to drop from this map
      Returns:
        a map consisting of all key/value pairs of this map except the first `num` ones, or else the empty map, if this map has less than `num` elements.
      Since:
        1.8.1

    - #### <T> public static Iterator<T> drop(Iterator<T> self, int num)

      Drops the given number of elements from the head of this iterator if they are available. The original iterator is stepped along by `num` elements.

           def iteratorCompare( Iterator a, List b ) {
               a.collect { it } == b
           }
           def iter = [ 1, 2, 3, 4, 5 ].listIterator()
           assert iteratorCompare( iter.drop( 0 ), [ 1, 2, 3, 4, 5 ] )
           iter = [ 1, 2, 3, 4, 5 ].listIterator()
           assert iteratorCompare( iter.drop( 2 ), [ 3, 4, 5 ] )
           iter = [ 1, 2, 3, 4, 5 ].listIterator()
           assert iteratorCompare( iter.drop( 5 ), [] )

      Parameters:
        `self` - the original iterator
        `num` - the number of elements to drop from this iterator
      Returns:
        The iterator stepped along by `num` elements if they exist.
      Since:
        1.8.1

    - #### <T> @Deprecated(since = "5.0.0")
      public static T[] drop(T[] self, int num)

    - #### <T> public static SortedSet<T> dropRight(SortedSet<T> self, int num)

      Drops the given number of elements from the tail of this SortedSet.

           def strings = [ 'a', 'b', 'c' ] as SortedSet
           assert strings.dropRight( 0 ) == [ 'a', 'b', 'c' ] as SortedSet
           assert strings.dropRight( 2 ) == [ 'a' ] as SortedSet
           assert strings.dropRight( 5 ) == [] as SortedSet

      Parameters:
        `self` - the original SortedSet
        `num` - the number of elements to drop from this SortedSet
      Returns:
        a List consisting of all the elements of this SortedSet minus the last `num` elements, or an empty SortedSet if it has less than `num` elements.
      Since:
        2.4.0

    - #### <T> public static List<T> dropRight(List<T> self, int num)

      Drops the given number of elements from the tail of this List.

           def strings = [ 'a', 'b', 'c' ]
           assert strings.dropRight( 0 ) == [ 'a', 'b', 'c' ]
           assert strings.dropRight( 2 ) == [ 'a' ]
           assert strings.dropRight( 5 ) == []

      Parameters:
        `self` - the original List
        `num` - the number of elements to drop from this List
      Returns:
        a List consisting of all the elements of this List minus the last `num` elements, or an empty List if it has less than `num` elements.
      Since:
        2.4.0

    - #### <T> public static Collection<T> dropRight(Iterable<T> self, int num)

      Drops the given number of elements from the tail of this Iterable.

           def strings = [ 'a', 'b', 'c' ]
           assert strings.dropRight( 0 ) == [ 'a', 'b', 'c' ]
           assert strings.dropRight( 2 ) == [ 'a' ]
           assert strings.dropRight( 5 ) == []

           class AbcIterable implements Iterable {
               Iterator iterator() { "abc".iterator() }
           }
           def abc = new AbcIterable()
           assert abc.dropRight(0) == ['a', 'b', 'c']
           assert abc.dropRight(1) == ['a', 'b']
           assert abc.dropRight(3) == []
           assert abc.dropRight(5) == []

      Parameters:
        `self` - the original Iterable
        `num` - the number of elements to drop from this Iterable
      Returns:
        a Collection consisting of all the elements of this Iterable minus the last `num` elements, or an empty list if it has less than `num` elements.
      Since:
        2.4.0

    - #### <T> public static Iterator<T> dropRight(Iterator<T> self, int num)

      Drops the given number of elements from the tail of this Iterator.

           def getObliterator() { "obliter8".iterator() }
           assert obliterator.dropRight(-1).toList() == ['o', 'b', 'l', 'i', 't', 'e', 'r', '8']
           assert obliterator.dropRight(0).toList() == ['o', 'b', 'l', 'i', 't', 'e', 'r', '8']
           assert obliterator.dropRight(1).toList() == ['o', 'b', 'l', 'i', 't', 'e', 'r']
           assert obliterator.dropRight(4).toList() == ['o', 'b', 'l', 'i']
           assert obliterator.dropRight(7).toList() == ['o']
           assert obliterator.dropRight(8).toList() == []
           assert obliterator.dropRight(9).toList() == []

      Parameters:
        `self` - the original Iterator
        `num` - the number of elements to drop
      Returns:
        an Iterator consisting of all the elements of this Iterator minus the last `num` elements, or an empty Iterator if it has less than `num` elements.
      Since:
        2.4.0

    - #### <T> @Deprecated(since = "5.0.0")
      public static T[] dropRight(T[] self, int num)

    - #### <T> public static SortedSet<T> dropWhile(SortedSet<T> self, @ClosureParams(FirstParam.FirstGenericType.class)
      Closure condition)

      Returns a suffix of this SortedSet where elements are dropped from the front while the given Closure evaluates to true. Similar to dropWhile(Iterable, groovy.lang.Closure) except that it attempts to preserve the type of the original SortedSet.

           def nums = [ 1, 2, 3 ] as SortedSet
           assert nums.dropWhile{ it < 4 } == [] as SortedSet
           assert nums.dropWhile{ it < 2 } == [ 2, 3 ] as SortedSet
           assert nums.dropWhile{ it != 3 } == [ 3 ] as SortedSet
           assert nums.dropWhile{ it == 0 } == [ 1, 2, 3 ] as SortedSet

      Parameters:
        `self` - the original SortedSet
        `condition` - the closure that must evaluate to true to continue dropping elements
      Returns:
        the shortest suffix of the given SortedSet such that the given closure condition evaluates to true for each element dropped from the front of the SortedSet
      Since:
        2.4.0

    - #### <T> public static List<T> dropWhile(List<T> self, @ClosureParams(FirstParam.FirstGenericType.class)
      Closure condition)

      Returns a suffix of this List where elements are dropped from the front while the given Closure evaluates to true. Similar to dropWhile(Iterable, groovy.lang.Closure) except that it attempts to preserve the type of the original list.

           def nums = [ 1, 3, 2 ]
           assert nums.dropWhile{ it < 4 } == []
           assert nums.dropWhile{ it < 3 } == [ 3, 2 ]
           assert nums.dropWhile{ it != 2 } == [ 2 ]
           assert nums.dropWhile{ it == 0 } == [ 1, 3, 2 ]

      Parameters:
        `self` - the original list
        `condition` - the closure that must evaluate to true to continue dropping elements
      Returns:
        the shortest suffix of the given List such that the given closure condition evaluates to true for each element dropped from the front of the List
      Since:
        1.8.7

    - #### <T> public static Collection<T> dropWhile(Iterable<T> self, @ClosureParams(FirstParam.FirstGenericType.class)
      Closure condition)

      Returns a suffix of this Iterable where elements are dropped from the front while the given closure evaluates to true.

           class HorseIterable implements Iterable {
               Iterator iterator() { "horse".iterator() }
           }
           def horse = new HorseIterable()
           assert horse.dropWhile{ it < 'r' } == ['r', 's', 'e']
           assert horse.dropWhile{ it <= 'r' } == ['s', 'e']

      Parameters:
        `self` - an Iterable
        `condition` - the closure that must evaluate to true to continue dropping elements
      Returns:
        a Collection containing the shortest suffix of the given Iterable such that the given closure condition evaluates to true for each element dropped from the front of the Iterable
      Since:
        1.8.7

    - #### <K, V> public static Map<K, V> dropWhile(Map<K, V> self, @ClosureParams(MapEntryOrKeyValue.class)
      Closure condition)

      Create a suffix of the given Map by dropping as many entries as possible from the front of the original Map such that calling the given closure condition evaluates to true when passed each of the dropped entries (or key/value pairs).

           def shopping = [milk:1, bread:2, chocolate:3]
           assert shopping.dropWhile{ it.key.size() < 6 } == [chocolate:3]
           assert shopping.dropWhile{ it.value % 2 } == [bread:2, chocolate:3]
           assert shopping.dropWhile{ k, v -> k.size() + v <= 7 } == [chocolate:3]

      If the map instance does not have ordered keys, then this function could appear to drop random entries. Groovy by default uses LinkedHashMap, so this shouldn't be an issue in the main.
      Parameters:
        `self` - a Map
        `condition` - a 1 (or 2) arg Closure that must evaluate to true for the entry (or key and value) to continue dropping elements
      Returns:
        the shortest suffix of the given Map such that the given closure condition evaluates to true for each element dropped from the front of the Map
      Since:
        1.8.7

    - #### <T> public static Iterator<T> dropWhile(Iterator<T> self, @ClosureParams(FirstParam.FirstGenericType.class)
      Closure<?> condition)

      Creates an Iterator that returns a suffix of the elements from an original Iterator. As many elements as possible are dropped from the front of the original Iterator such that calling the given closure condition evaluates to true when passed each of the dropped elements.

           def a = 0
           def iter = [ hasNext:{ a < 10 }, next:{ a++ } ] as Iterator
           assert [].iterator().dropWhile{ it < 3 }.toList() == []
           assert [1, 2, 3, 4, 5].iterator().dropWhile{ it < 3 }.toList() == [ 3, 4, 5 ]
           assert iter.dropWhile{ it < 5 }.toList() == [ 5, 6, 7, 8, 9 ]

      Parameters:
        `self` - the Iterator
        `condition` - the closure that must evaluate to true to continue dropping elements
      Returns:
        the shortest suffix of elements from the given Iterator such that the given closure condition evaluates to true for each element dropped from the front of the Iterator
      Since:
        1.8.7

    - #### <T> @Deprecated(since = "5.0.0")
      public static T[] dropWhile(T[] self, @ClosureParams(FirstParam.Component.class)
      Closure<?> condition)

    - #### public static String dump(Object self)

      Generates a detailed dump string of an object showing its class, hashCode and all accessible fields.

      Parameters:
        `self` - an object
      Returns:
        the dump representation
      Since:
        1.0

    - #### <T> public static T each(T self, @ClosureParams(value=FromString.class, options="?")
      Closure closure)

      Iterates through an aggregate type or data structure, passing each item to the given closure. Custom types may utilize this method by simply providing an "iterator()" method. The items returned from the resulting iterator will be passed to the closure.

           String result = ''
           ['a', 'b', 'c'].each{ result += it }
           assert result == 'abc'

      Parameters:
        `self` - the object over which we iterate
        `closure` - the closure applied on each element found
      Returns:
        the self Object
      Since:
        1.0

    - #### <T> public static Iterable<T> each(Iterable<T> self, @ClosureParams(FirstParam.FirstGenericType.class)
      Closure closure)

      Iterates through an Iterable, passing each item to the given closure.

      Parameters:
        `self` - the Iterable over which we iterate
        `closure` - the closure applied on each element found
      Returns:
        the self Iterable

    - #### <T> public static Iterator<T> each(Iterator<T> self, @ClosureParams(FirstParam.FirstGenericType.class)
      Closure closure)

      Iterates through an Iterator, passing each item to the given closure.

      Parameters:
        `self` - the Iterator over which we iterate
        `closure` - the closure applied on each element found
      Returns:
        the (now exhausted) self Iterator
      Since:
        2.4.0

    - #### <T> public static Collection<T> each(Collection<T> self, @ClosureParams(FirstParam.FirstGenericType.class)
      Closure closure)

      Iterates through a Collection, passing each item to the given closure.

      Parameters:
        `self` - the Collection over which we iterate
        `closure` - the closure applied on each element found
      Returns:
        the self Collection
      Since:
        2.4.0

    - #### <T> public static List<T> each(List<T> self, @ClosureParams(FirstParam.FirstGenericType.class)
      Closure closure)

      Iterates through a List, passing each item to the given closure.

      Parameters:
        `self` - the List over which we iterate
        `closure` - the closure applied on each element found
      Returns:
        the self List
      Since:
        2.4.0

    - #### <T> public static Set<T> each(Set<T> self, @ClosureParams(FirstParam.FirstGenericType.class)
      Closure closure)

      Iterates through a Set, passing each item to the given closure.

      Parameters:
        `self` - the Set over which we iterate
        `closure` - the closure applied on each element found
      Returns:
        the self Set
      Since:
        2.4.0

    - #### <T> public static SortedSet<T> each(SortedSet<T> self, @ClosureParams(FirstParam.FirstGenericType.class)
      Closure closure)

      Iterates through a SortedSet, passing each item to the given closure.

      Parameters:
        `self` - the SortedSet over which we iterate
        `closure` - the closure applied on each element found
      Returns:
        the self SortedSet
      Since:
        2.4.0

    - #### <K, V> public static Map<K, V> each(Map<K, V> self, @ClosureParams(MapEntryOrKeyValue.class)
      Closure<?> closure)

      Allows a Map to be iterated through using a closure. If the closure takes one parameter then it will be passed the Map.Entry otherwise if the closure takes two parameters then it will be passed the key and the value.

          def result = ""
           [a:1, b:3].each { key, value -> result += "$key$value" }
           assert result == "a1b3"

          def result = ""
           [a:1, b:3].each { entry -> result += entry }
           assert result == "a=1b=3"

      In general, the order in which the map contents are processed cannot be guaranteed. In practise, specialized forms of Map, e.g. a TreeMap will have its contents processed according to the natural ordering of the map.
      Parameters:
        `self` - the map over which we iterate
        `closure` - the 1 or 2 arg closure applied on each entry of the map
      Returns:
        returns the self parameter
      Since:
        1.5.0

    - #### <T> @Deprecated(since = "5.0.0")
      public static T[] each(T[] self, @ClosureParams(FirstParam.Component.class)
      Closure closure)

    - #### @Deprecated(since = "5.0.0")
      public static void eachByte(byte[] self, @ClosureParams(FirstParam.Component.class)
      Closure closure)

    - #### @Deprecated(since = "5.0.0")
      public static void eachByte(Byte[] self, @ClosureParams(FirstParam.Component.class)
      Closure closure)

    - #### @SuppressWarnings("unchecked")
      public static void eachCombination(Iterable self, Closure<?> function)

      Applies a function on each combination of the input lists.

      Example usage:

          [[2, 3],[4, 5, 6]].eachCombination { println "Found $it" }

      Parameters:
        `self` - a Collection of lists
        `function` - a closure to be called on each combination
      See Also:
        GroovyCollections.combinations
      Since:
        2.2.0

    - #### <T> public static Iterator<List<T>> eachPermutation(Iterable<T> self, Closure closure)

      Iterates over all permutations of a collection, running a closure for each iteration.

      Example usage:

          def permutations = []
           [1, 2, 3].eachPermutation{ permutations << it }
           assert permutations == [[1, 2, 3], [1, 3, 2], [2, 1, 3], [2, 3, 1], [3, 1, 2], [3, 2, 1]]

      Parameters:
        `self` - the Collection of items
        `closure` - the closure to call for each permutation
      Returns:
        the permutations from the list
      Since:
        1.7.0

    - #### <T> public static T eachWithIndex(T self, @ClosureParams(value=FromString.class, options="?,Integer")
      Closure closure)

      Iterates through an aggregate type or data structure, passing each item and the item's index (a counter starting at zero) to the given closure.

           String result = ''
           ['a', 'b', 'c'].eachWithIndex{ letter, index -> result += "$index:$letter" }
           assert result == '0:a1:b2:c'

      Parameters:
        `self` - an Object
        `closure` - a Closure to operate on each item
      Returns:
        the self Object
      Since:
        1.0

    - #### <T> public static Iterable<T> eachWithIndex(Iterable<T> self, @ClosureParams(value=FromString.class, options="T,Integer")
      Closure closure)

      Iterates through an iterable type, passing each item and the item's index (a counter starting at zero) to the given closure.

      Parameters:
        `self` - an Iterable
        `closure` - a Closure to operate on each item
      Returns:
        the self Iterable
      Since:
        2.3.0

    - #### <T> public static Iterator<T> eachWithIndex(Iterator<T> self, @ClosureParams(value=FromString.class, options="T,Integer")
      Closure closure)

      Iterates through an iterator type, passing each item and the item's index (a counter starting at zero) to the given closure.

      Parameters:
        `self` - an Iterator
        `closure` - a Closure to operate on each item
      Returns:
        the (now exhausted) self Iterator
      Since:
        2.3.0

    - #### <T> public static Collection<T> eachWithIndex(Collection<T> self, @ClosureParams(value=FromString.class, options="T,Integer")
      Closure closure)

      Iterates through a Collection, passing each item and the item's index (a counter starting at zero) to the given closure.

      Parameters:
        `self` - a Collection
        `closure` - a Closure to operate on each item
      Returns:
        the self Collection
      Since:
        2.4.0

    - #### <T> public static List<T> eachWithIndex(List<T> self, @ClosureParams(value=FromString.class, options="T,Integer")
      Closure closure)

      Iterates through a List, passing each item and the item's index (a counter starting at zero) to the given closure.

      Parameters:
        `self` - a List
        `closure` - a Closure to operate on each item
      Returns:
        the self List
      Since:
        2.4.0

    - #### <T> public static Set<T> eachWithIndex(Set<T> self, @ClosureParams(value=FromString.class, options="T,Integer")
      Closure closure)

      Iterates through a Set, passing each item and the item's index (a counter starting at zero) to the given closure.

      Parameters:
        `self` - a Set
        `closure` - a Closure to operate on each item
      Returns:
        the self Set
      Since:
        2.4.0

    - #### <T> public static SortedSet<T> eachWithIndex(SortedSet<T> self, @ClosureParams(value=FromString.class, options="T,Integer")
      Closure closure)

      Iterates through a SortedSet, passing each item and the item's index (a counter starting at zero) to the given closure.

      Parameters:
        `self` - a SortedSet
        `closure` - a Closure to operate on each item
      Returns:
        the self SortedSet
      Since:
        2.4.0

    - #### <K, V> public static Map<K, V> eachWithIndex(Map<K, V> self, @ClosureParams(value=MapEntryOrKeyValue.class, options="index=true")
      Closure<?> closure)

      Allows a Map to be iterated through using a closure. If the closure takes two parameters then it will be passed the Map.Entry and the item's index (a counter starting at zero) otherwise if the closure takes three parameters then it will be passed the key, the value, and the index.

          def result = ""
           [a:1, b:3].eachWithIndex { key, value, index -> result += "$index($key$value)" }
           assert result == "0(a1)1(b3)"

          def result = ""
           [a:1, b:3].eachWithIndex { entry, index -> result += "$index($entry)" }
           assert result == "0(a=1)1(b=3)"

      Parameters:
        `self` - the map over which we iterate
        `closure` - a 2 or 3 arg Closure to operate on each item
      Returns:
        the self Object
      Since:
        1.5.0

    - #### <T> @Deprecated(since = "5.0.0")
      public static T[] eachWithIndex(T[] self, @ClosureParams(value=FromString.class, options="T,Integer")
      Closure closure)

    - #### public static boolean equals(List left, Object[] right)

      Determines if the contents of this list are equal to the contents of the given array in the same order. This returns `false` if either collection is `null`.

          assert [1, "a"].equals( [ 1, "a" ] as Object[] )

      Parameters:
        `left` - a List
        `right` - the Object[] being compared to
      Returns:
        true if the contents of both collections are equal
      Since:
        1.5.0

    - #### public static boolean equals(List left, List right)

      Compare the contents of two Lists. Order matters. If numbers exist in the Lists, then they are compared as numbers, for example 2 == 2L. If both lists are `null`, the result is true; otherwise if either list is `null`, the result is `false`.

          assert ["a", 2].equals(["a", 2])
           assert ![2, "a"].equals("a", 2)
           assert [2.0, "a"].equals(2L, "a") // number comparison at work

      Parameters:
        `left` - a List
        `right` - the List being compared to
      Returns:
        boolean `true` if the contents of both lists are identical, `false` otherwise.
      Since:
        1.0

    - #### <T> public static boolean equals(Set<T> self, Set<T> other)

      Compare the contents of two Sets for equality using Groovy's coercion rules.

      Returns `true` if the two sets have the same size, and every member of the specified set is contained in this set (or equivalently, every member of this set is contained in the specified set). If numbers exist in the sets, then they are compared as numbers, for example 2 == 2L. If both sets are `null`, the result is true; otherwise if either set is `null`, the result is `false`. Example usage:

           Set s1 = ["a", 2]
           def s2 = [2, 'a'] as Set
           Set s3 = [3, 'a']
           def s4 = [2.0, 'a'] as Set
           def s5 = [2L, 'a'] as Set
           assert s1.equals(s2)
           assert !s1.equals(s3)
           assert s1.equals(s4)
           assert s1.equals(s5)

      Parameters:
        `self` - a Set
        `other` - the Set being compared to
      Returns:
        `true` if the contents of both sets are identical
      Since:
        1.8.0

    - #### public static boolean equals(Map self, Map other)

      Compares two Maps treating coerced numerical values as identical.

      Example usage:

          assert [a:2, b:3] == [a:2L, b:3.0]

      Parameters:
        `self` - this Map
        `other` - the Map being compared to
      Returns:
        `true` if the contents of both maps are identical
      Since:
        1.8.0

    - #### @Deprecated(since = "5.0.0")
      public static boolean equals(int[] left, int[] right)

    - #### @Deprecated(since = "5.0.0")
      public static boolean equals(Object[] left, List right)

    - #### public static boolean equalsIgnoreZeroSign(Float number, Object other)

      Compares this object against the specified object returning the same result as Float.equals but returning true if this object and the specified object are both zero and negative zero respectively or vice versa.

      Since:
        3.0.8

    - #### public static boolean equalsIgnoreZeroSign(Double number, Object other)

      Compares this object against the specified object returning the same result as Double.equals but returning true if this object and the specified object are both zero and negative zero respectively or vice versa.

      Since:
        3.0.8

    - #### public static boolean every(Object self, Closure predicate)

      Used to determine if the given predicate closure is valid (i.e. returns `true` for all items in this data structure). A simple example for a list:

          def list = [3,4,5]
           def greaterThanTwo = list.every { it > 2 }

      Parameters:
        `self` - the object over which we iterate
        `predicate` - the closure predicate used for matching
      Returns:
        true if every iteration of the object matches the closure predicate
      Since:
        1.0

    - #### <T> public static boolean every(Iterator<T> self, @ClosureParams(FirstParam.FirstGenericType.class)
      Closure predicate)

      Used to determine if the given predicate closure is valid (i.e. returns `true` for all items in this iterator). A simple example for a list:

          def list = [3,4,5]
           def greaterThanTwo = list.iterator().every { it > 2 }

      Parameters:
        `self` - the iterator over which we iterate
        `predicate` - the closure predicate used for matching
      Returns:
        true if every iteration of the object matches the closure predicate
      Since:
        2.3.0

    - #### <T> public static boolean every(Iterable<T> self, @ClosureParams(FirstParam.FirstGenericType.class)
      Closure predicate)

      Used to determine if the given predicate closure is valid (i.e. returns `true` for all items in this iterable). A simple example for a list:

          def list = [3,4,5]
           def greaterThanTwo = list.every { it > 2 }

      Parameters:
        `self` - the iterable over which we iterate
        `predicate` - the closure predicate used for matching
      Returns:
        true if every iteration of the object matches the closure predicate
      Since:
        2.3.0

    - #### <K, V> public static boolean every(Map<K, V> self, @ClosureParams(value = MapEntryOrKeyValue.class)
      Closure predicate)

      Iterates over the entries of a map, and checks whether a predicate is valid for all entries. If the closure takes one parameter then it will be passed the Map.Entry otherwise if the closure takes two parameters then it will be passed the key and the value.

          def map = [a:1, b:2.0, c:2L]
           assert !map.every { key, value -> value instanceof Integer }
           assert map.every { entry -> entry.value instanceof Number }

      Parameters:
        `self` - the map over which we iterate
        `predicate` - the 1 or 2 arg Closure predicate used for matching
      Returns:
        true if every entry of the map matches the closure predicate
      Since:
        1.5.0

    - #### public static boolean every(Object self)

      Iterates over every element of a collection, and checks whether all elements are `true` according to the Groovy Truth. Equivalent to `self.every({element `->` element})`

           assert [true, true].every()
           assert [1, 1].every()
           assert ![1, 0].every()

      Parameters:
        `self` - the object over which we iterate
      Returns:
        true if every item in the collection matches satisfies Groovy truth
      Since:
        1.5.0

    - #### <T> @Deprecated(since = "5.0.0")
      public static boolean every(T[] self, @ClosureParams(FirstParam.Component.class)
      Closure predicate)

    - #### public static Object find(Object self, Closure closure)

      Finds the first value matching the closure condition.

           def numbers = [1, 2, 3]
           def result = numbers.find { it > 1}
           assert result == 2

      Parameters:
        `self` - an Object with an iterator returning its values
        `closure` - a closure condition
      Returns:
        the first Object found or null if none was found
      Since:
        1.0

    - #### public static Object find(Object self)

      Finds the first item matching the IDENTITY Closure (i.e. matching Groovy truth).

      Example:

           def items = [null, 0, 0.0, false, '', [], 42, 43]
           assert items.find() == 42

      Parameters:
        `self` - an Object with an Iterator returning its values
      Returns:
        the first Object found or null if none was found
      Since:
        1.8.1
      See Also:
        Closure.IDENTITY

    - #### <T> public static T find(Collection<T> self, @ClosureParams(FirstParam.FirstGenericType.class)
      Closure closure)

      Finds the first value matching the closure condition. Example:

          def list = [1,2,3]
           assert 2 == list.find { it > 1 }

      Parameters:
        `self` - a Collection
        `closure` - a closure condition
      Returns:
        the first Object found, in the order of the collections iterator, or null if no element matches
      Since:
        1.0

    - #### <T> public static T find(Collection<T> self)

      Finds the first item matching the IDENTITY Closure (i.e. matching Groovy truth).

      Example:

           def items = [null, 0, 0.0, false, '', [], 42, 43]
           assert items.find() == 42

      Parameters:
        `self` - a Collection
      Returns:
        the first Object found or null if none was found
      Since:
        1.8.1
      See Also:
        Closure.IDENTITY

    - #### <K, V> public static Map.Entry<K, V> find(Map<K, V> self, @ClosureParams(MapEntryOrKeyValue.class)
      Closure<?> closure)

      Finds the first entry matching the closure condition. If the closure takes two parameters, the entry key and value are passed. If the closure takes one parameter, the Map.Entry object is passed.

          assert [a:1, b:3].find { it.value == 3 }.key == "b"

      Parameters:
        `self` - a Map
        `closure` - a 1 or 2 arg Closure condition
      Returns:
        the first Object found
      Since:
        1.0

    - #### <T> @Deprecated(since = "5.0.0")
      public static T find(T[] self, @ClosureParams(FirstParam.Component.class)
      Closure condition)

    - #### <K, V> public static Map<K, V> findAll(Map<K, V> self, @ClosureParams(MapEntryOrKeyValue.class)
      Closure closure)

      Finds all entries matching the closure condition. If the closure takes one parameter then it will be passed the Map.Entry. Otherwise if the closure should take two parameters, which will be the key and the value.

      If the `self` map is one of TreeMap, LinkedHashMap, Hashtable or Properties, the returned Map will preserve that type, otherwise a HashMap will be returned.

      Example usage:

           def result = [a:1, b:2, c:4, d:5].findAll { it.value % 2 == 0 }
           assert result.every { it instanceof Map.Entry }
           assert result*.key == ["b", "c"]
           assert result*.value == [2, 4]

      Parameters:
        `self` - a Map
        `closure` - a 1 or 2 arg Closure condition applying on the entries
      Returns:
        a new subMap
      Since:
        1.0

    - #### <T> public static Set<T> findAll(Set<T> self, @ClosureParams(FirstParam.FirstGenericType.class)
      Closure closure)

      Finds all values matching the closure condition.

          assert ([2,4] as Set) == ([1,2,3,4] as Set).findAll { it % 2 == 0 }

      Parameters:
        `self` - a Set
        `closure` - a closure condition
      Returns:
        a Set of matching values
      Since:
        2.4.0

    - #### <T> public static List<T> findAll(List<T> self, @ClosureParams(FirstParam.FirstGenericType.class)
      Closure closure)

      Finds all values matching the closure condition.

          assert [2,4] == [1,2,3,4].findAll { it % 2 == 0 }

      Parameters:
        `self` - a List
        `closure` - a closure condition
      Returns:
        a List of matching values
      Since:
        2.4.0

    - #### <T> public static Collection<T> findAll(Collection<T> self, @ClosureParams(FirstParam.FirstGenericType.class)
      Closure closure)

      Finds all values matching the closure condition.

          assert [2,4] == [1,2,3,4].findAll { it % 2 == 0 }

      Parameters:
        `self` - a Collection
        `closure` - a closure condition
      Returns:
        a Collection of matching values
      Since:
        1.5.6

    - #### <T> public static Set<T> findAll(Set<T> self)

      Finds the items matching the IDENTITY Closure (i.e. matching Groovy truth).

      Example:

           def items = [1, 2, 0, false, true, '', 'foo', [], [4, 5], null] as Set
           assert items.findAll() == [1, 2, true, 'foo', [4, 5]] as Set

      Parameters:
        `self` - a Set
      Returns:
        a Set of the truthy values
      Since:
        2.4.0
      See Also:
        Closure.IDENTITY

    - #### <T> public static List<T> findAll(List<T> self)

      Finds the items matching the IDENTITY Closure (i.e. matching Groovy truth).

      Example:

           def items = [1, 2, 0, false, true, '', 'foo', [], [4, 5], null]
           assert items.findAll() == [1, 2, true, 'foo', [4, 5]]

      Parameters:
        `self` - a List
      Returns:
        a List of the truthy values
      Since:
        2.4.0
      See Also:
        Closure.IDENTITY

    - #### <T> public static Collection<T> findAll(Collection<T> self)

      Finds the items matching the IDENTITY Closure (i.e. matching Groovy truth).

      Example:

           def items = [1, 2, 0, false, true, '', 'foo', [], [4, 5], null]
           assert items.findAll() == [1, 2, true, 'foo', [4, 5]]

      Parameters:
        `self` - a Collection
      Returns:
        a Collection of the truthy values
      Since:
        1.8.1
      See Also:
        Closure.IDENTITY

    - #### @SuppressWarnings("unchecked")
      public static List findAll(Object self, Closure closure)

      Finds all items matching the closure condition.

      Parameters:
        `self` - an Object with an Iterator returning its values
        `closure` - a closure condition
      Returns:
        a List of the values found
      Since:
        1.6.0

    - #### public static List findAll(Object self)

      Finds all items matching the IDENTITY Closure (i.e. matching Groovy truth).

      Example:

           def items = [1, 2, 0, false, true, '', 'foo', [], [4, 5], null]
           assert items.findAll() == [1, 2, true, 'foo', [4, 5]]

      Parameters:
        `self` - an Object with an Iterator returning its values
      Returns:
        a List of the truthy values
      Since:
        1.8.1
      See Also:
        Closure.IDENTITY

    - #### <T> @Deprecated(since = "5.0.0")
      public static List<T> findAll(T[] self)

    - #### <T> @Deprecated(since = "5.0.0")
      public static List<T> findAll(T[] self, @ClosureParams(FirstParam.Component.class)
      Closure condition)

    - #### @Deprecated
      public static Collection findAll$$bridge(Object self)

    - #### <T> @Deprecated
      public static Collection<T> findAll$$bridge(T[] self)

    - #### @Deprecated
      public static Collection findAll$$bridge(Object self, Closure closure)

    - #### <T> @Deprecated
      public static Collection<T> findAll$$bridge(T[] self, @ClosureParams(FirstParam.Component.class)
      Closure condition)

    - #### public static int findIndexOf(Object self, Closure condition)

      Iterates over the elements of an aggregate of items and returns the index of the first item that matches the condition specified in the closure.

      Parameters:
        `self` - the iteration object over which to iterate
        `condition` - the matching condition
      Returns:
        an integer that is the index of the first matched object or -1 if no match was found
      Since:
        1.0

    - #### public static int findIndexOf(Object self, int startIndex, Closure condition)

      Iterates over the elements of an aggregate of items, starting from a specified startIndex, and returns the index of the first item that matches the condition specified in the closure. Example (aggregate is `ChronoUnit` enum values):

           import java.time.temporal.ChronoUnit
           def nameStartsWithM = { it.name().startsWith('M') }
           def first  = ChronoUnit.findIndexOf(nameStartsWithM)
           def second = ChronoUnit.findIndexOf(first + 1, nameStartsWithM)
           def third  = ChronoUnit.findIndexOf(second + 1, nameStartsWithM)
           Set units  = [first, second, third]
           assert !units.contains(-1) // should have found 3 of MICROS, MILLIS, MINUTES, MONTHS, ...
           assert units.size() == 3 // just check size so as not to rely on order

      Parameters:
        `self` - the iteration object over which to iterate
        `startIndex` - start matching from this index
        `condition` - the matching condition
      Returns:
        an integer that is the index of the first matched object or -1 if no match was found
      Since:
        1.5.0

    - #### <T> public static int findIndexOf(Iterator<T> self, @ClosureParams(FirstParam.FirstGenericType.class)
      Closure condition)

      Iterates over the elements of an Iterator and returns the index of the first item that satisfies the condition specified by the closure.

      Parameters:
        `self` - an Iterator
        `condition` - the matching condition
      Returns:
        an integer that is the index of the first matched object or -1 if no match was found
      Since:
        2.5.0

    - #### <T> public static int findIndexOf(Iterator<T> self, int startIndex, @ClosureParams(FirstParam.FirstGenericType.class)
      Closure condition)

      Iterates over the elements of an Iterator, starting from a specified startIndex, and returns the index of the first item that satisfies the condition specified by the closure.

      Parameters:
        `self` - an Iterator
        `startIndex` - start matching from this index
        `condition` - the matching condition
      Returns:
        an integer that is the index of the first matched object or -1 if no match was found
      Since:
        2.5.0

    - #### <T> public static int findIndexOf(Iterable<T> self, @ClosureParams(FirstParam.FirstGenericType.class)
      Closure condition)

      Iterates over the elements of an Iterable and returns the index of the first item that satisfies the condition specified by the closure.

      Parameters:
        `self` - an Iterable
        `condition` - the matching condition
      Returns:
        an integer that is the index of the first matched object or -1 if no match was found
      Since:
        2.5.0

    - #### <T> public static int findIndexOf(Iterable<T> self, int startIndex, @ClosureParams(FirstParam.FirstGenericType.class)
      Closure condition)

      Iterates over the elements of an Iterable, starting from a specified startIndex, and returns the index of the first item that satisfies the condition specified by the closure.

      Parameters:
        `self` - an Iterable
        `startIndex` - start matching from this index
        `condition` - the matching condition
      Returns:
        an integer that is the index of the first matched object or -1 if no match was found
      Since:
        2.5.0

    - #### <T> @Deprecated(since = "5.0.0")
      public static int findIndexOf(T[] self, @ClosureParams(FirstParam.Component.class)
      Closure condition)

    - #### <T> @Deprecated(since = "5.0.0")
      public static int findIndexOf(T[] self, int startIndex, @ClosureParams(FirstParam.Component.class)
      Closure condition)

    - #### public static List<Number> findIndexValues(Object self, Closure condition)

      Iterates over the elements of an aggregate of items and returns the index values of the items that match the condition specified in the closure.

      Parameters:
        `self` - the iteration object over which to iterate
        `condition` - the matching condition
      Returns:
        a list of numbers corresponding to the index values of all matched objects
      Since:
        1.5.2

    - #### public static List<Number> findIndexValues(Object self, Number startIndex, Closure condition)

      Iterates over the elements of an aggregate of items, starting from a specified startIndex, and returns the index values of the items that match the condition specified in the closure.

      Parameters:
        `self` - the iteration object over which to iterate
        `startIndex` - start matching from this index
        `condition` - the matching condition
      Returns:
        a list of numbers corresponding to the index values of all matched objects
      Since:
        1.5.2

    - #### <T> public static List<Number> findIndexValues(Iterable<T> self, @ClosureParams(FirstParam.FirstGenericType.class)
      Closure condition)

      Iterates over the elements of an Iterable and returns the index values of the items that match the condition specified in the closure.

      Parameters:
        `self` - an Iterable
        `condition` - the matching condition
      Returns:
        a list of numbers corresponding to the index values of all matched objects
      Since:
        2.5.0

    - #### <T> public static List<Number> findIndexValues(Iterable<T> self, Number startIndex, @ClosureParams(FirstParam.FirstGenericType.class)
      Closure condition)

      Iterates over the elements of an Iterable, starting from a specified startIndex, and returns the index values of the items that match the condition specified in the closure.

      Parameters:
        `self` - an Iterable
        `startIndex` - start matching from this index
        `condition` - the matching condition
      Returns:
        a list of numbers corresponding to the index values of all matched objects
      Since:
        2.5.0

    - #### <T> public static Iterator<Number> findIndexValues(@groovy.lang.DelegatesTo.Target
      Iterator<T> self, @DelegatesTo(genericTypeIndex = 0)
      @ClosureParams(FirstParam.FirstGenericType.class)
      Closure<?> transform)

      Returns an iterator of transformed values from the source iterator using the `transform` closure.

           def letters = ('a'..'z').iterator()
           def vowels = 'aeiou'.toSet()
           assert letters.findIndexValues{ vowels.contains(it) }.toList() == [0, 4, 8, 14, 20]

      Parameters:
        `self` - an Iterator
        `transform` - the closure used to transform each element
      Returns:
        an Iterator for the transformed values
      Since:
        5.0.0

    - #### <T> public static Iterator<Number> findIndexValues(@groovy.lang.DelegatesTo.Target
      Iterator<T> self, Number startIndex, @DelegatesTo(genericTypeIndex = 0)
      @ClosureParams(FirstParam.FirstGenericType.class)
      Closure<?> transform)

      Returns an iterator of transformed values from the source iterator using the `transform` closure and starting with index `startIndex`.

           def letters = ('a'..'z')
           def vowels = 'aeiou'.toSet()
           assert letters.iterator().findIndexValues(0){ vowels.contains(it) }.toList() == [0, 4, 8, 14, 20]
           assert letters.iterator().findIndexValues(1){ vowels.contains(it) }.toList() == [4, 8, 14, 20]

      Parameters:
        `self` - an Iterator
        `startIndex` - start matching from this index
        `transform` - the closure used to transform each element
      Returns:
        an Iterator for the transformed values
      Since:
        5.0.0

    - #### <T> @Deprecated(since = "5.0.0")
      public static List<Number> findIndexValues(T[] self, @ClosureParams(FirstParam.Component.class)
      Closure condition)

    - #### <T> @Deprecated(since = "5.0.0")
      public static List<Number> findIndexValues(T[] self, Number startIndex, @ClosureParams(FirstParam.Component.class)
      Closure condition)

    - #### <T> @Deprecated
      public static List<Number> findIndexValues$$bridge(Iterator<T> self, @ClosureParams(FirstParam.FirstGenericType.class)
      Closure condition)

      Iterates over the elements of an Iterator and returns the index values of the items that match the condition specified in the closure.

      deprecated:
        @since 2.5.0
      Parameters:
        `self` - an Iterator
        `condition` - the matching condition
      Returns:
        a list of numbers corresponding to the index values of all matched objects

    - #### <T> @Deprecated
      public static List<Number> findIndexValues$$bridge(Iterator<T> self, Number startIndex, @ClosureParams(FirstParam.FirstGenericType.class)
      Closure condition)

      Iterates over the elements of an Iterator, starting from a specified startIndex, and returns the index values of the items that match the condition specified in the closure.

      deprecated:
        @since 2.5.0
      Parameters:
        `self` - an Iterator
        `startIndex` - start matching from this index
        `condition` - the matching condition
      Returns:
        a list of numbers corresponding to the index values of all matched objects

    - #### public static int findLastIndexOf(Object self, Closure condition)

      Iterates over the elements of an aggregate of items and returns the index of the last item that matches the condition specified in the closure. Example (aggregate is `ChronoUnit` enum values):

           import java.time.temporal.ChronoUnit
           def nameStartsWithM = { it.name().startsWith('M') }
           def first = ChronoUnit.findIndexOf(nameStartsWithM)
           def last  = ChronoUnit.findLastIndexOf(nameStartsWithM)
           // should have found 2 unique index values for MICROS, MILLIS, MINUTES, MONTHS, ...
           assert first != -1 && last != -1 && first != last

      Parameters:
        `self` - the iteration object over which to iterate
        `condition` - the matching condition
      Returns:
        an integer that is the index of the last matched object or -1 if no match was found
      Since:
        1.5.2

    - #### public static int findLastIndexOf(Object self, int startIndex, Closure condition)

      Iterates over the elements of an aggregate of items, starting from a specified startIndex, and returns the index of the last item that matches the condition specified in the closure.

      Parameters:
        `self` - the iteration object over which to iterate
        `startIndex` - start matching from this index
        `condition` - the matching condition
      Returns:
        an integer that is the index of the last matched object or -1 if no match was found
      Since:
        1.5.2

    - #### <T> public static int findLastIndexOf(Iterator<T> self, @ClosureParams(FirstParam.FirstGenericType.class)
      Closure condition)

      Iterates over the elements of an Iterator and returns the index of the last item that matches the condition specified in the closure.

      Parameters:
        `self` - an Iterator
        `condition` - the matching condition
      Returns:
        an integer that is the index of the last matched object or -1 if no match was found
      Since:
        2.5.0

    - #### <T> public static int findLastIndexOf(Iterator<T> self, int startIndex, @ClosureParams(FirstParam.FirstGenericType.class)
      Closure condition)

      Iterates over the elements of an Iterator, starting from a specified startIndex, and returns the index of the last item that matches the condition specified in the closure.

      Parameters:
        `self` - an Iterator
        `startIndex` - start matching from this index
        `condition` - the matching condition
      Returns:
        an integer that is the index of the last matched object or -1 if no match was found
      Since:
        2.5.0

    - #### <T> public static int findLastIndexOf(Iterable<T> self, @ClosureParams(FirstParam.FirstGenericType.class)
      Closure condition)

      Iterates over the elements of an Iterable and returns the index of the last item that matches the condition specified in the closure.

      Parameters:
        `self` - an Iterable
        `condition` - the matching condition
      Returns:
        an integer that is the index of the last matched object or -1 if no match was found
      Since:
        2.5.0

    - #### <T> public static int findLastIndexOf(Iterable<T> self, int startIndex, @ClosureParams(FirstParam.FirstGenericType.class)
      Closure condition)

      Iterates over the elements of an Iterable, starting from a specified startIndex, and returns the index of the last item that matches the condition specified in the closure.

      Parameters:
        `self` - an Iterable
        `startIndex` - start matching from this index
        `condition` - the matching condition
      Returns:
        an integer that is the index of the last matched object or -1 if no match was found
      Since:
        2.5.0

    - #### <T> @Deprecated(since = "5.0.0")
      public static int findLastIndexOf(T[] self, @ClosureParams(FirstParam.Component.class)
      Closure condition)

    - #### <T> @Deprecated(since = "5.0.0")
      public static int findLastIndexOf(T[] self, int startIndex, @ClosureParams(FirstParam.Component.class)
      Closure condition)

    - #### public static Object findResult(Object self, Closure condition)

      Treats the object as iterable, iterating through the values it represents and returns the first non-null result obtained from calling the closure, otherwise returns null.

           int[] numbers = [1, 2, 3]
           assert numbers.findResult { if(it > 1) return it } == 2
           assert numbers.findResult { if(it > 4) return it } == null

      Parameters:
        `self` - an Object with an iterator returning its values
        `condition` - a closure that returns a non-null value to indicate that processing should stop and the value should be returned
      Returns:
        the first non-null result of the closure
      Since:
        1.7.5

    - #### public static Object findResult(Object self)

      Treats the object as iterable, iterating through the values it represents and returns the first non-null value, otherwise returns null.

           class Foo {
               List items
               Iterator iterator() {
                   items.iterator()
               }
           }
           assert new Foo(items: [null, 2, 4]).findResult() == 2
           assert new Foo(items: [null, null]).findResult() == null

      Parameters:
        `self` - an Object with an iterator returning its values
      Returns:
        the first non-null result of the closure
      Since:
        4.0.9

    - #### public static Object findResult(Object self, Object defaultResult, Closure condition)

      Treats the object as iterable, iterating through the values it represents and returns the first non-null result obtained from calling the closure, otherwise returns the defaultResult.

           int[] numbers = [1, 2, 3]
           assert numbers.findResult(5) { if(it > 1) return it } == 2
           assert numbers.findResult(5) { if(it > 4) return it } == 5

      Parameters:
        `self` - an Object with an iterator returning its values
        `defaultResult` - an Object that should be returned if all closure results are null
        `condition` - a closure that returns a non-null value to indicate that processing should stop and the value should be returned
      Returns:
        the first non-null result of the closure, otherwise the default value
      Since:
        1.7.5

    - #### public static Object findResult(Object self, Object defaultResult)

      Treats the object as iterable, iterating through the values it represents and returns the first non-null result, otherwise returns the defaultResult.

           class Foo {
               List items
               Iterator iterator() {
                   items.iterator()
               }
           }
           assert new Foo(items: [null, 2, 4]).findResult(5) == 2
           assert new Foo(items: [null, null]).findResult(5) == 5

      Parameters:
        `self` - an Object with an iterator returning its values
        `defaultResult` - an Object that should be returned if all elements are null
      Returns:
        the first non-null element, otherwise the default value
      Since:
        4.0.9

    - #### <S, T, U extends T, V extends T> public static T findResult(Iterator<S> self, U defaultResult, @ClosureParams(FirstParam.FirstGenericType.class)
      Closure<V> condition)

      Iterates through the Iterator calling the given closure condition for each item but stopping once the first non-null result is found and returning that result. If all are null, the defaultResult is returned.

      Examples:

           def iter = [1,2,3].iterator()
           assert "Found 2" == iter.findResult("default") { it > 1 ? "Found $it" : null }
           assert "default" == iter.findResult("default") { it > 3 ? "Found $it" : null }

      Parameters:
        `self` - an Iterator
        `defaultResult` - an Object that should be returned if all closure results are null
        `condition` - a closure that returns a non-null value to indicate that processing should stop and the value should be returned
      Returns:
        the first non-null result from calling the closure, or the defaultValue
      Since:
        2.5.0

    - #### <T, U extends T, V extends T> public static T findResult(Iterator<U> self, V defaultResult)

      Iterates through the Iterator stopping once the first non-null result is found and returning that result. If all are null, the defaultResult is returned.

      Examples:

           assert [null, 1, 2].iterator().findResult('default') == 1
           assert [null, null].findResult('default') == 'default'

      Parameters:
        `self` - an Iterator
        `defaultResult` - an Object that should be returned if all elements are null
      Returns:
        the first non-null result from the iterator, or the defaultValue
      Since:
        4.0.9

    - #### <T, U> public static T findResult(Iterator<U> self, @ClosureParams(FirstParam.FirstGenericType.class)
      Closure<T> condition)

      Iterates through the Iterator calling the given closure condition for each item but stopping once the first non-null result is found and returning that result. If all results are null, null is returned.

      Parameters:
        `self` - an Iterator
        `condition` - a closure that returns a non-null value to indicate that processing should stop and the value should be returned
      Returns:
        the first non-null result from calling the closure, or null
      Since:
        2.5.0

    - #### <T> public static T findResult(Iterator<T> self)

      Iterates through the Iterator stopping once the first non-null result is found and returning that result. If all results are null, null is returned.

      Parameters:
        `self` - an Iterator
      Returns:
        the first non-null result from the iterator, or null
      Since:
        4.0.9

    - #### <S, T, U extends T, V extends T> public static T findResult(Iterable<S> self, U defaultResult, @ClosureParams(FirstParam.FirstGenericType.class)
      Closure<V> condition)

      Iterates through the Iterable calling the given closure condition for each item but stopping once the first non-null result is found and returning that result. If all are null, the defaultResult is returned.

      Examples:

           def list = [1,2,3]
           assert "Found 2" == list.findResult("default") { it > 1 ? "Found $it" : null }
           assert "default" == list.findResult("default") { it > 3 ? "Found $it" : null }

      Parameters:
        `self` - an Iterable
        `defaultResult` - an Object that should be returned if all closure results are null
        `condition` - a closure that returns a non-null value to indicate that processing should stop and the value should be returned
      Returns:
        the first non-null result from calling the closure, or the defaultValue
      Since:
        2.5.0

    - #### <T, U extends T, V extends T> public static T findResult(Iterable<U> self, V defaultResult)

      Iterates through the Iterable calling the given closure condition for each item but stopping once the first non-null result is found and returning that result. If all are null, the defaultResult is returned.

      Examples:

           assert [null, 1, 2].findResult('default') == 1
           assert [null, null].findResult('default') == 'default'

      Parameters:
        `self` - an Iterable
        `defaultResult` - an Object that should be returned if all elements in the iterable are null
      Returns:
        the first non-null element from the iterable, or the defaultValue
      Since:
        4.0.9

    - #### <T, U> public static T findResult(Iterable<U> self, @ClosureParams(FirstParam.FirstGenericType.class)
      Closure<T> condition)

      Iterates through the Iterable calling the given closure condition for each item but stopping once the first non-null result is found and returning that result. If all results are null, null is returned.

      Parameters:
        `self` - an Iterable
        `condition` - a closure that returns a non-null value to indicate that processing should stop and the value should be returned
      Returns:
        the first non-null result from calling the closure, or null
      Since:
        2.5.0

    - #### <T> public static T findResult(Iterable<T> self)

      Iterates through the Iterable stopping once the first non-null result is found and returning that result. If all results are null, null is returned.

      Parameters:
        `self` - an Iterable
      Returns:
        the first non-null element from the iterable, or null
      Since:
        4.0.9

    - #### <T, K, V> public static T findResult(Map<K, V> self, @ClosureParams(MapEntryOrKeyValue.class)
      Closure<T> condition)

      Returns the first non-null closure result found by passing each map entry to the closure, otherwise null is returned. If the closure takes two parameters, the entry key and value are passed. If the closure takes one parameter, the Map.Entry object is passed.

           assert "Found b:3" == [a:1, b:3].findResult { if (it.value == 3) return "Found ${it.key}:${it.value}" }
           assert null == [a:1, b:3].findResult { if (it.value == 9) return "Found ${it.key}:${it.value}" }
           assert "Found a:1" == [a:1, b:3].findResult { k, v -> if (k.size() + v == 2) return "Found $k:$v" }

      Parameters:
        `self` - a Map
        `condition` - a 1 or 2 arg Closure that returns a non-null value when processing should stop and a value should be returned
      Returns:
        the first non-null result collected by calling the closure, or null if no such result was found
      Since:
        1.7.5

    - #### <T, U extends T, V extends T, A, B> public static T findResult(Map<A, B> self, U defaultResult, @ClosureParams(MapEntryOrKeyValue.class)
      Closure<V> condition)

      Returns the first non-null closure result found by passing each map entry to the closure, otherwise the defaultResult is returned. If the closure takes two parameters, the entry key and value are passed. If the closure takes one parameter, the Map.Entry object is passed.

           assert "Found b:3" == [a:1, b:3].findResult("default") { if (it.value == 3) return "Found ${it.key}:${it.value}" }
           assert "default" == [a:1, b:3].findResult("default") { if (it.value == 9) return "Found ${it.key}:${it.value}" }
           assert "Found a:1" == [a:1, b:3].findResult("default") { k, v -> if (k.size() + v == 2) return "Found $k:$v" }

      Parameters:
        `self` - a Map
        `defaultResult` - an Object that should be returned if all closure results are null
        `condition` - a 1 or 2 arg Closure that returns a non-null value when processing should stop and a value should be returned
      Returns:
        the first non-null result collected by calling the closure, or the defaultResult if no such result was found
      Since:
        1.7.5

    - #### <T> @Deprecated(since = "5.0.0")
      public static T findResult(T[] self)

    - #### <T, U extends T, V extends T> @Deprecated(since = "5.0.0")
      public static T findResult(U[] self, V defaultResult)

    - #### <S, T> @Deprecated(since = "5.0.0")
      public static T findResult(S[] self, @ClosureParams(FirstParam.Component.class)
      Closure<T> condition)

    - #### <S, T, U extends T, V extends T> @Deprecated(since = "5.0.0")
      public static T findResult(S[] self, U defaultResult, @ClosureParams(FirstParam.Component.class)
      Closure<V> condition)

    - #### <T, U> public static Collection<T> findResults(Iterable<U> self, @ClosureParams(FirstParam.FirstGenericType.class)
      Closure<T> filteringTransform)

      Iterates through the Iterable transforming items using the supplied closure and collecting any non-null results.

      Example:

           def list = [1,2,3]
           def result = list.findResults { it > 1 ? "Found $it" : null }
           assert result == ["Found 2", "Found 3"]

      Parameters:
        `self` - an Iterable
        `filteringTransform` - a Closure that should return either a non-null transformed value or null for items which should be discarded
      Returns:
        the list of non-null transformed values
      Since:
        2.2.0

    - #### <T> public static Collection<T> findResults(Iterable<T> self)

      Iterates through the Iterable collecting any non-null results.

      Example:

           assert [1, null, 2, null, 3].findResults() == [1, 2, 3]

      Parameters:
        `self` - an Iterable
      Returns:
        the list of non-null values
      Since:
        4.0.9

    - #### <T, U> public static Collection<T> findResults(Iterator<U> self, @ClosureParams(FirstParam.FirstGenericType.class)
      Closure<T> filteringTransform)

      Iterates through the Iterator transforming items using the supplied closure and collecting any non-null results.

      Parameters:
        `self` - an Iterator
        `filteringTransform` - a Closure that should return either a non-null transformed value or null for items which should be discarded
      Returns:
        the list of non-null transformed values
      Since:
        2.5.0

    - #### <T> public static Collection<T> findResults(Iterator<T> self)

      Iterates through the Iterator collecting any non-null results.

      Parameters:
        `self` - an Iterator
      Returns:
        the list of non-null values
      Since:
        4.0.9

    - #### <T, K, V> public static Collection<T> findResults(Map<K, V> self, @ClosureParams(MapEntryOrKeyValue.class)
      Closure<T> filteringTransform)

      Iterates through the map transforming items using the supplied closure and collecting any non-null results. If the closure takes two parameters, the entry key and value are passed. If the closure takes one parameter, the Map.Entry object is passed.

      Example:

           def map = [a:1, b:2, hi:2, cat:3, dog:2]
           def result = map.findResults { k, v -> k.size() == v ? "Found $k:$v" : null }
           assert result == ["Found a:1", "Found hi:2", "Found cat:3"]

      Parameters:
        `self` - a Map
        `filteringTransform` - a 1 or 2 arg Closure that should return either a non-null transformed value or null for items which should be discarded
      Returns:
        the list of non-null transformed values
      Since:
        1.8.1

    - #### <T> @Deprecated(since = "5.0.0")
      public static Collection<T> findResults(T[] self)

    - #### <T, U> @Deprecated(since = "5.0.0")
      public static Collection<T> findResults(U[] self, @ClosureParams(FirstParam.Component.class)
      Closure<T> filteringTransform)

    - #### <T> public static Iterator<T> findingAll(@groovy.lang.DelegatesTo.Target
      Iterator<T> self, @DelegatesTo(genericTypeIndex = 0)
      @ClosureParams(FirstParam.FirstGenericType.class)
      Closure<?> transform)

      Lazily finds all items matching the closure condition.

           def letters = Iterators.iterate('A', String::next).take(26).plus(Iterators.iterate('a', String::next).take(26))
           assert letters.findingAll{ it.toUpperCase() < 'D' }.toList() == ['A', 'B', 'C', 'a', 'b', 'c']

      Parameters:
        `self` - a source Iterator
        `transform` - the closure used to select elements
      Returns:
        an Iterator returning the selected elements
      Since:
        5.0.0

    - #### <T, U> public static Iterator<T> findingResults(@groovy.lang.DelegatesTo.Target
      Iterator<U> self, @DelegatesTo(genericTypeIndex = 0)
      @ClosureParams(FirstParam.FirstGenericType.class)
      Closure<T> filteringTransform)

      Iterates through the Iterator transforming items using the supplied closure and finding any non-null results.

      Example:

           def vowels = [a:1, e:5, i:9, o:15, u:21]
           assert Iterators.iterate('a', n -> ++n).findingResults{ vowels[it] }.take(3).toList() == [1, 5, 9]

      Parameters:
        `self` - an Iterator
        `filteringTransform` - a Closure that should return either a non-null transformed value or null for items which should be discarded
      Returns:
        an iterator for the non-null transformed values
      Since:
        5.0.0

    - #### <T> public static T first(List<T> self)

      Returns the first item from the List.

           def list = [3, 4, 2]
           assert list.first() == 3
           // check original is unaltered
           assert list == [3, 4, 2]

      throws:
        NoSuchElementException if you try to access first() for an empty List
      Parameters:
        `self` - a List
      Returns:
        the first item from the List
      Since:
        1.5.5

    - #### <T> public static T first(Iterable<T> self)

      Returns the first item from the Iterable.

           def set = [3, 4, 2] as LinkedHashSet
           assert set.first() == 3
           // check original is unaltered
           assert set == [3, 4, 2] as Set

      The first element returned by the Iterable's iterator is returned. If the Iterable doesn't guarantee a defined order it may appear like a random element is returned.
      throws:
        NoSuchElementException if you try to access first() for an empty Iterable
      Parameters:
        `self` - an Iterable
      Returns:
        the first item from the Iterable
      Since:
        1.8.7

    - #### <T> @Deprecated(since = "5.0.0")
      public static T first(T[] self)

    - #### <T, E> public static Collection<T> flatten(Collection<E> self)

      Flatten a Collection. This Collection and any nested arrays or collections have their contents (recursively) added to the new collection.

          assert [1,2,3,4,5] == [1,[2,3],[[4]],[],5].flatten()

      Parameters:
        `self` - a Collection to flatten
      Returns:
        a flattened Collection
      Since:
        1.6.0

    - #### <T, E> public static Collection<T> flatten(Iterable<E> self)

      Flatten an Iterable. This Iterable and any nested arrays or collections have their contents (recursively) added to the new collection.

          assert [1,2,3,4,5] == [1,[2,3],[[4]],[],5].flatten()

      Parameters:
        `self` - an Iterable to flatten
      Returns:
        a flattened Collection
      Since:
        1.6.0

    - #### <T, E> public static Collection<T> flatten(Iterable<E> self, boolean flattenOptionals)

      Flatten an Iterable. This Iterable and any nested arrays or collections have their contents (recursively) added to the new collection. If flattenOptionals is true, the non-empty optionals are also flattened.

      Example:

           var items = [1..2, [3, [4]], Optional.of(5), Optional.empty()]
           assert items.flatten() == [1, 2, 3, 4, 5]
           // boolean param determines whether to flatten optionals (false for legacy behavior)
           assert items.flatten(true) == [1, 2, 3, 4, 5]
           assert items.flatten(false) == [1, 2, 3, 4, Optional.of(5), Optional.empty()]

      Parameters:
        `self` - an Iterable to flatten
        `flattenOptionals` - whether to treat an Optional as a container to flatten
      Returns:
        a flattened Collection
      Since:
        5.0.0

    - #### <T, E> public static Iterator<T> flatten(Iterator<E> self)

      Flatten an Iterator. This Iterator and any nested arrays, iterators or collections have their contents (recursively) added to the elements of the new iterator. Non-empty optionals are also flattened.

      Example:

           var items = [1..2, [3, [4]], Optional.of(5)]
           assert items.iterator().flatten().toList() == [1, 2, 3, 4, 5]

      Parameters:
        `self` - an Iterator to flatten
      Returns:
        an iterator of the flattened elements
      Since:
        5.0.0

    - #### <T, E> public static Iterator<T> flatten(Iterator<E> self, boolean flattenOptionals)

      Flatten an Iterator. This Iterator and any nested arrays, iterators or collections have their contents (recursively) added to the elements of the new iterator. If flattenOptionals is true, the non-empty optionals are also flattened.

      Example:

           var items = [1..2, [3, [4]], Optional.of(5), Optional.empty()]
           assert items.iterator().flatten(true).toList() == [1, 2, 3, 4, 5]
           assert items.iterator().flatten(false).toList() == [1, 2, 3, 4, Optional.of(5), Optional.empty()]

      Parameters:
        `self` - an Iterator to flatten
        `flattenOptionals` - whether to treat an Optional as a container to flatten
      Returns:
        an iterator of the flattened elements
      Since:
        5.0.0

    - #### <T, E> public static List<T> flatten(List<E> self)

      Flatten a List. This List and any nested arrays or collections have their contents (recursively) added to the new List.

          assert [1,2,3,4,5] == [1,[2,3],[[4]],[],5].flatten()

      Parameters:
        `self` - a List to flatten
      Returns:
        a flattened List
      Since:
        2.4.0

    - #### <T, E> public static Set<T> flatten(Set<E> self)

      Flatten a Set. This Set and any nested arrays or collections have their contents (recursively) added to the new Set.

          assert [1,2,3,4,5] as Set == ([1,[2,3],[[4]],[],5] as Set).flatten()

      Parameters:
        `self` - a Set to flatten
      Returns:
        a flattened Set
      Since:
        2.4.0

    - #### <T, E> public static SortedSet<T> flatten(SortedSet<E> self)

      Flatten a SortedSet. This SortedSet and any nested arrays or collections have their contents (recursively) added to the new SortedSet.

           Set nested = [[0,1],[2],3,[4],5]
           SortedSet sorted = new TreeSet({ a, b -> (a instanceof List ? a[0] : a) <=> (b instanceof List ? b[0] : b) } as Comparator)
           sorted.addAll(nested)
           assert [0,1,2,3,4,5] as SortedSet == sorted.flatten()

      Parameters:
        `self` - a SortedSet to flatten
      Returns:
        a flattened SortedSet
      Since:
        2.4.0

    - #### <T, E> public static Collection<T> flatten(Iterable<E> self, @ClosureParams(value=FromString.class, options="?")
      Closure<?> flattenUsing)

      Flatten an Iterable. This Iterable and any nested arrays, collections, or optionals have their contents (recursively) added to a new collection. Non-Array, non-Collection, non-Optional objects are leaf nodes. The flattenUsing transform can be used to modify leaf nodes. If a leaf node represents some other kind of collective type, the supplied closure should yield the contained items; otherwise, the closure should just return the (optionally modified) leaf.

      Example:

           // some examples just transforming the leaf
           var items = [1..2, [3, [4]]]
           assert items.flatten(n -> n + 5) == 6..9
           assert items.flatten{ 'x' * it } == ['x', 'xx', 'xxx', 'xxxx']

           // Here our String is a "container" of day, month, year parts
           var dates = ['01/02/99', '12/12/23']
           assert dates.flatten{ it.split('/') } == [['01', '02', '99'], ['12', '12', '23']]
           assert dates.flatten{ it.split('/').toList() } == ['01', '02', '99', '12', '12', '23']

           // some examples with Maps
           assert [a:1, b:2].entrySet().flatten{ "$it.key$it.value" } == ['a1', 'b2'] as Set
           assert [[a:1], [b:2]].flatten{ it.keySet() + it.values() } == ['a', 1, 'b', 2]

      Parameters:
        `self` - an Iterable
        `flattenUsing` - a closure to determine how to flatten non-Array, non-Collection elements
      Returns:
        a flattened Collection
      See Also:
        flattenMany(Iterable, Closure)
        collectNested(Iterable, Closure)
      Since:
        1.6.0

    - #### <T, E> public static Collection<T> flatten(Iterable<E> self, boolean flattenOptionals, @ClosureParams(value=FromString.class, options="?")
      Closure<?> flattenUsing)

      Flatten an Iterable. This Iterable and any nested arrays, collections, and potentially Optional elements have their contents (recursively) added to a new collection. Non-container elements are leaf elements. If flattenOptionals is false, Optionals are treated as leaf elements, otherwise they are considered as containers to flatten. The flattenUsing transform can be used to modify leaf nodes. If a leaf node represents some other kind of collective type, the supplied closure should yield the contained item or items; otherwise, the closure should just return the (optionally modified) leaf.

           var items = ['a'..'b', ['c'], Optional.of('d'), Optional.empty()]
           var unknown = { it instanceof Optional ? it.orElse('Unknown') : it.toUpperCase() }

           // by default Optionals are flattened so the ternary in the
           // 'unknown' closure will never see the optional
           assert items.flatten(unknown) == ['A', 'B', 'C', 'D']
           assert items.flatten(true, unknown) == ['A', 'B', 'C', 'D']

           // disable optional flattening and you can provide custom flattening
           assert items.flatten(false, unknown) == ['A', 'B', 'C', 'd', 'Unknown']

      Parameters:
        `self` - an Iterable
        `flattenOptionals` - whether to treat an Optional as a container to flatten or a leaf
        `flattenUsing` - a closure to determine how to flatten leaf elements
      Returns:
        a flattened Collection
      Since:
        5.0.0

    - #### <T, E> @SuppressWarnings("unchecked")
      public static Collection<T> flatten(Optional<E> self)

      Flatten an Optional. This yields a collection containing the Optional value if the Optional is present, or an empty collection otherwise.

      Example:

           assert Optional.of(1).flatten() == [1]
           assert Optional.empty().flatten() == []

      Parameters:
        `self` - an Optional
      Returns:
        a flattened Optional
      Since:
        5.0.0

    - #### <T, E> public static Iterator<T> flatten(Iterator<E> self, Closure<?> flattenUsing)

      Flatten an Iterator. This Iterator and any nested arrays, iterators, collections, and potentially Optional elements have their contents (recursively) added to the elements for a new iterator. Non-container elements are leaf elements.

      Example:

           assert [1..2, [3, [4]]].iterator().flatten(n -> n + 5).toList() == 6..9

      Parameters:
        `self` - an Iterable
        `flattenUsing` - a closure to determine how to flatten leaf elements
      Returns:
        an iterator of the flattened items
      See Also:
        flatten(Iterable, Closure)
      Since:
        5.0.0

    - #### <T, E> public static Iterator<T> flatten(Iterator<E> self, boolean flattenOptionals, Closure<?> flattenUsing)

      Flatten an Iterator. This Iterator and any nested arrays, iterators, collections, and potentially Optional elements have their contents (recursively) added to the elements for a new iterator. Non-container elements are leaf elements.

      Parameters:
        `self` - an Iterable
        `flattenOptionals` - whether to treat an Optional as a container to flatten or a leaf
        `flattenUsing` - a closure to determine how to flatten leaf elements
      Returns:
        an iterator of the flattened items
      See Also:
        flatten(Iterable, boolean, Closure)
      Since:
        5.0.0

    - #### @Deprecated(since = "5.0.0")
      public static Collection flatten(boolean[] self)

    - #### @Deprecated(since = "5.0.0")
      public static Collection flatten(byte[] self)

    - #### @Deprecated(since = "5.0.0")
      public static Collection flatten(char[] self)

    - #### @Deprecated(since = "5.0.0")
      public static Collection flatten(short[] self)

    - #### @Deprecated(since = "5.0.0")
      public static Collection flatten(int[] self)

    - #### @Deprecated(since = "5.0.0")
      public static Collection flatten(long[] self)

    - #### @Deprecated(since = "5.0.0")
      public static Collection flatten(float[] self)

    - #### @Deprecated(since = "5.0.0")
      public static Collection flatten(double[] self)

    - #### @Deprecated(since = "5.0.0")
      public static Collection flatten(Object[] self)

    - #### <T> public static Collection<T> flattenMany(Iterable<?> self, Closure<?> transform)

      Flatten an Iterable. This Iterable and any nested arrays, collections or optionals have their contents (recursively) added to a new collection. A transform is applied to any leaf nodes before further flattening.

           var items = ['1', '2', 'foo', '3', 'bar']
           var toInt = s -> s.number ? Optional.of(s.toInteger()) : Optional.empty()
           assert items.flattenMany(toInt) == [1, 2, 3]
           assert items.flattenMany(String::toList) == ['1', '2', 'f', 'o', 'o', '3', 'b', 'a', 'r']
           assert items.flattenMany{ it.split(/[aeiou]/) } == ['1', '2', 'f', '3', 'b', 'r']

           assert ['01/02/99', '12/12/23'].flattenMany{ it.split('/') } == ['01', '02', '99', '12', '12', '23']

      The `flattenMany` method is somewhat similar to the `collectMany` method. While `collectMany` works on the basis that the transform closure returns a collection, `flattenMany` can return a collection, array, optional or modified element. You should use `flattenMany` if you need the extra functionality it offers. Consider using `collectMany` if you return only collections in the transform, since you will have better type inference in static typing scenarios.
      Parameters:
        `self` - an Iterable
        `transform` - a transform applied to any leaf elements
      Returns:
        a flattened Collection
      See Also:
        collectMany(Iterable, Closure)
      Since:
        5.0.0

    - #### <T, E> public static Iterator<T> flattenMany(Iterator<E> self, boolean flattenOptionals, Closure<?> flattenUsing)

      Flatten the elements from an Iterator. This iterator and any nested arrays, collections, iterators, or optionals have their contents (recursively) added to the elements for the resulting iterator. A transform is applied to any leaf nodes before further flattening.

      Parameters:
        `self` - an Iterable
        `flattenOptionals` - whether non-present Optional values are removed
        `flattenUsing` - a transform applied to any leaf elements
      Returns:
        a flattened Collection
      See Also:
        flattenMany(Iterable, Closure)
      Since:
        5.0.0

    - #### <K, V> public static V get(Map<K, V> map, K key, V defaultValue)

      Looks up an item in a Map for the given key and returns the corresponding value. If there is no entry for the given key return instead the default value and also add the key and default value to the map.

           def map=[:]
           map.get("a", []) << 5
           assert map == [a:[5]]

      For a method which doesn't mutate the map, consider instead using Map.getOrDefault or consider using Groovy's MapWithDefault often instantiated using withDefault(Map, Closure) or with more options withDefault(Map, boolean, boolean, Closure).
      Parameters:
        `map` - a Map
        `key` - the key to look up the value
        `defaultValue` - the value to return and add to the map for this key if there is no entry for the given key
      Returns:
        the value of the given key or the default value, added to the map if the key did not exist
      Since:
        1.0

    - #### public static Object getAt(Object self, String property)

      Allows the subscript operator to be used to lookup dynamic property values. `bean[somePropertyNameExpression]`. The normal property notation of groovy is neater and more concise but only works with compile-time known property names.

      Parameters:
        `self` - the object to act upon
        `property` - the property name of interest
      Returns:
        the property value
      Since:
        1.0

    - #### <T> public static List<T> getAt(List<T> self, Range range)

      Support the range subscript operator for a List.

          def list = [1, "a", 4.5, true]
           assert list[1..2] == ["a", 4.5]

      Parameters:
        `self` - a List
        `range` - a Range indicating the items to get
      Returns:
        a new list instance based on range borders
      Since:
        1.0

    - #### <T> @SuppressWarnings("unchecked")
      public static List<T> getAt(ListWithDefault<T> self, Collection indices)

      Select a List of items from an eager or lazy List using a Collection to identify the indices to be selected.

          def list = [].withDefault { 42 }
           assert list[1,0,2] == [42, 42, 42]

      Parameters:
        `self` - a ListWithDefault
        `indices` - a Collection of indices
      Returns:
        a new eager or lazy list of the values at the given indices

    - #### <T> public static List<T> getAt(ListWithDefault<T> self, Range range)

      Support the range subscript operator for an eager or lazy List.

          def list = [].withDefault { 42 }
           assert list[1..2] == [null, 42]

      Parameters:
        `self` - a ListWithDefault
        `range` - a Range indicating the items to get
      Returns:
        a new eager or lazy list instance based on range borders

    - #### <T> public static List<T> getAt(ListWithDefault<T> self, EmptyRange range)

      Support the range subscript operator for an eager or lazy List.

           def list = [true, 1, 3.4].withDefault{ 42 }
           assert list[0..<0] == []

      Parameters:
        `self` - a ListWithDefault
        `range` - a Range indicating the items to get
      Returns:
        a new list instance based on range borders

    - #### <T> public static List<T> getAt(List<T> self, EmptyRange range)

      Support the range subscript operator for a List.

           def list = [true, 1, 3.4]
           assert list[0..<0] == []

      Parameters:
        `self` - a List
        `range` - a Range indicating the items to get
      Returns:
        a new list instance based on range borders
      Since:
        1.0

    - #### <T> @SuppressWarnings("unchecked")
      public static List<T> getAt(List<T> self, Collection indices)

      Select a List of items from a List using a Collection to identify the indices to be selected.

          def list = [true, 1, 3.4, false]
           assert list[1,0,2] == [1, true, 3.4]

      Parameters:
        `self` - a List
        `indices` - a Collection of indices
      Returns:
        a new list of the values at the given indices
      Since:
        1.0

    - #### <T> public static T getAt(List<T> self, int idx)

      Support the subscript operator for a List.

          def list = [2, "a", 5.3]
           assert list[1] == "a"

      Parameters:
        `self` - a List
        `idx` - an index
      Returns:
        the value at the given index
      Since:
        1.0

    - #### <T> public static T getAt(List<T> self, Number idx)

      Support subscript operator for list access.

    - #### <T> public static T getAt(Iterator<T> self, int idx)

      Support the subscript operator for an Iterator. The iterator will be partially exhausted up until the idx entry after returning if a +ve or 0 idx is used, or fully exhausted if a -ve idx is used or no corresponding entry was found. Typical usage:

           def iter = [2, "a", 5.3].iterator()
           assert iter[1] == "a"

      A more elaborate example:

           def items = [2, "a", 5.3]
           def iter = items.iterator()
           assert iter[-1] == 5.3
           // iter exhausted, so reset
           iter = items.iterator()
           assert iter[1] == "a"
           // iter partially exhausted so now idx starts after "a"
           assert iter[0] == 5.3

      Parameters:
        `self` - an Iterator
        `idx` - an index value (-self.size() <= idx < self.size())
      Returns:
        the value at the given index (after normalisation) or null if no corresponding value was found
      Since:
        1.7.2

    - #### <T> public static T getAt(Iterable<T> self, int idx)

      Support the subscript operator for an Iterable. Typical usage:

           // custom Iterable example:
           class MyIterable implements Iterable {
             Iterator iterator() { [1, 2, 3].iterator() }
           }
           def myIterable = new MyIterable()
           assert myIterable[1] == 2

           // Set example:
           def set = [1,2,3] as LinkedHashSet
           assert set[1] == 2

      Parameters:
        `self` - an Iterable
        `idx` - an index value (-self.size() <= idx < self.size()) but using -ve index values will be inefficient
      Returns:
        the value at the given index (after normalisation) or null if no corresponding value was found
      Since:
        2.1.0

    - #### <K, V> public static V getAt(Map<K, V> self, Object key)

      Support the subscript operator for a Map.

          def map = [1:10]
           assert map[1] == 10

      Parameters:
        `self` - a Map
        `key` - an Object as a key for the map
      Returns:
        the value corresponding to the given key
      Since:
        1.0

    - #### public static boolean getAt(BitSet self, int index)

      Support the subscript operator for a Bitset

      Parameters:
        `self` - a BitSet
        `index` - index to retrieve
      Returns:
        value of the bit at the given index
      See Also:
        BitSet
      Since:
        1.5.0

    - #### public static BitSet getAt(BitSet self, IntRange range)

      Support retrieving a subset of a BitSet using a Range

      Parameters:
        `self` - a BitSet
        `range` - a Range defining the desired subset
      Returns:
        a new BitSet that represents the requested subset
      See Also:
        BitSet
        IntRange
      Since:
        1.5.0

    - #### public static List getAt(Collection coll, String property)

      Support the subscript operator for Collection.

           assert [String, Long, Integer] == ["a",5L,2]["class"]

      Parameters:
        `coll` - a Collection
        `property` - a String
      Returns:
        a List
      Since:
        1.0

    - #### @Deprecated(since = "5.0.0")
      public static List<Boolean> getAt(boolean[] self, Range range)

    - #### @Deprecated(since = "5.0.0")
      public static List<Byte> getAt(byte[] self, Range range)

    - #### @Deprecated(since = "5.0.0")
      public static List<Character> getAt(char[] self, Range range)

    - #### @Deprecated(since = "5.0.0")
      public static List<Short> getAt(short[] self, Range range)

    - #### @Deprecated(since = "5.0.0")
      public static List<Integer> getAt(int[] self, Range range)

    - #### @Deprecated(since = "5.0.0")
      public static List<Long> getAt(long[] self, Range range)

    - #### @Deprecated(since = "5.0.0")
      public static List<Float> getAt(float[] self, Range range)

    - #### @Deprecated(since = "5.0.0")
      public static List<Double> getAt(double[] self, Range range)

    - #### <T> @Deprecated(since = "5.0.0")
      public static List<T> getAt(T[] self, Range range)

    - #### @Deprecated(since = "5.0.0")
      public static List<Boolean> getAt(boolean[] self, IntRange range)

    - #### @Deprecated(since = "5.0.0")
      public static List<Byte> getAt(byte[] self, IntRange range)

    - #### @Deprecated(since = "5.0.0")
      public static List<Character> getAt(char[] self, IntRange range)

    - #### @Deprecated(since = "5.0.0")
      public static List<Short> getAt(short[] self, IntRange range)

    - #### @Deprecated(since = "5.0.0")
      public static List<Integer> getAt(int[] self, IntRange range)

    - #### @Deprecated(since = "5.0.0")
      public static List<Long> getAt(long[] self, IntRange range)

    - #### @Deprecated(since = "5.0.0")
      public static List<Float> getAt(float[] self, IntRange range)

    - #### @Deprecated(since = "5.0.0")
      public static List<Double> getAt(double[] self, IntRange range)

    - #### <T> @Deprecated(since = "5.0.0")
      public static List<T> getAt(T[] self, IntRange range)

    - #### @Deprecated(since = "5.0.0")
      public static List<Boolean> getAt(boolean[] self, ObjectRange range)

    - #### @Deprecated(since = "5.0.0")
      public static List<Byte> getAt(byte[] self, ObjectRange range)

    - #### @Deprecated(since = "5.0.0")
      public static List<Character> getAt(char[] self, ObjectRange range)

    - #### @Deprecated(since = "5.0.0")
      public static List<Short> getAt(short[] self, ObjectRange range)

    - #### @Deprecated(since = "5.0.0")
      public static List<Integer> getAt(int[] self, ObjectRange range)

    - #### @Deprecated(since = "5.0.0")
      public static List<Long> getAt(long[] self, ObjectRange range)

    - #### @Deprecated(since = "5.0.0")
      public static List<Float> getAt(float[] self, ObjectRange range)

    - #### @Deprecated(since = "5.0.0")
      public static List<Double> getAt(double[] self, ObjectRange range)

    - #### <T> @Deprecated(since = "5.0.0")
      public static List<T> getAt(T[] self, ObjectRange range)

    - #### <T> @Deprecated(since = "5.0.0")
      public static List<T> getAt(T[] self, EmptyRange range)

    - #### @Deprecated(since = "5.0.0")
      public static List<Boolean> getAt(boolean[] self, Collection indices)

    - #### @Deprecated(since = "5.0.0")
      public static List<Byte> getAt(byte[] self, Collection indices)

    - #### @Deprecated(since = "5.0.0")
      public static List<Character> getAt(char[] self, Collection indices)

    - #### @Deprecated(since = "5.0.0")
      public static List<Short> getAt(short[] self, Collection indices)

    - #### @Deprecated(since = "5.0.0")
      public static List<Integer> getAt(int[] self, Collection indices)

    - #### @Deprecated(since = "5.0.0")
      public static List<Long> getAt(long[] self, Collection indices)

    - #### @Deprecated(since = "5.0.0")
      public static List<Float> getAt(float[] self, Collection indices)

    - #### @Deprecated(since = "5.0.0")
      public static List<Double> getAt(double[] self, Collection indices)

    - #### <T> @Deprecated(since = "5.0.0")
      public static List<T> getAt(T[] self, Collection indices)

    - #### public static Groovydoc getGroovydoc(AnnotatedElement holder)

      Gets runtime groovydoc.

      Since:
        3.0.0

    - #### public static IntRange getIndices(Collection self)

      Returns indices of the collection.

      Example:

           assert 0..2 == [5, 6, 7].indices

      Parameters:
        `self` - a collection
      Returns:
        an index range
      Since:
        2.4.0

    - #### @Deprecated(since = "5.0.0")
      public static IntRange getIndices(boolean[] self)

    - #### @Deprecated(since = "5.0.0")
      public static IntRange getIndices(byte[] self)

    - #### @Deprecated(since = "5.0.0")
      public static IntRange getIndices(char[] self)

    - #### @Deprecated(since = "5.0.0")
      public static IntRange getIndices(short[] self)

    - #### @Deprecated(since = "5.0.0")
      public static IntRange getIndices(int[] self)

    - #### @Deprecated(since = "5.0.0")
      public static IntRange getIndices(long[] self)

    - #### @Deprecated(since = "5.0.0")
      public static IntRange getIndices(float[] self)

    - #### @Deprecated(since = "5.0.0")
      public static IntRange getIndices(double[] self)

    - #### <T> @Deprecated(since = "5.0.0")
      public static IntRange getIndices(T[] self)

    - #### public static URL getLocation(Class self)

      Gets the url of the jar file/source file containing the specified class.

      Parameters:
        `self` - the class
      Returns:
        the url of the jar, `null` if the specified class is from JDK
      Since:
        2.5.0

    - #### public static MetaClass getMetaClass(Class c)

      Adds a "metaClass" property to all class objects so you can use the syntax `String.metaClass.myMethod = { println "foo" }`

      Parameters:
        `c` - The java.lang.Class instance
      Returns:
        An MetaClass instance
      Since:
        1.5.0

    - #### public static MetaClass getMetaClass(Object obj)

      Obtains a MetaClass for an object either from the registry or in the case of a GroovyObject from the object itself.

      Parameters:
        `obj` - The object in question
      Returns:
        The MetaClass
      Since:
        1.5.0

    - #### public static MetaClass getMetaClass(GroovyObject obj)

      Obtains a MetaClass for an object either from the registry or in the case of a GroovyObject from the object itself.

      Parameters:
        `obj` - The object in question
      Returns:
        The MetaClass
      Since:
        1.6.0

    - #### public static List<PropertyValue> getMetaPropertyValues(Object self)

      Retrieves the list of MetaProperty objects for 'self' and wraps it in a list of PropertyValue objects that additionally provide the value for each property of 'self'.

      Parameters:
        `self` - the receiver object
      Returns:
        list of PropertyValue objects
      See Also:
        Expando.getMetaPropertyValues
      Since:
        1.0

    - #### public static Map<String, Object> getProperties(Object self)

      Convenience method that calls getMetaPropertyValues(java.lang.Object)(self) and provides the data in form of simple key/value pairs, i.e. without type() information.

      Parameters:
        `self` - the receiver object
      Returns:
        meta properties as Map of key/value pairs
      Since:
        1.0

    - #### public static ClassLoader getRootLoader(ClassLoader self)

      Iterates through the classloader parents until it finds a loader with a class named "org.codehaus.groovy.tools.RootLoader". If there is no such class `null` will be returned. The name is used for comparison because a direct comparison using == may fail as the class may be loaded through different classloaders.

      Parameters:
        `self` - a ClassLoader
      Returns:
        the rootLoader for the ClassLoader
      See Also:
        RootLoader
      Since:
        1.5.0

    - #### @SuppressWarnings("unchecked")
      public static Collection grep(Object self, Object filter)

      Iterates over the collection of items which this Object represents and returns each item that matches the given filter - calling the `isCase(java.lang.Object, java.lang.Object)` method used by switch statements. This method can be used with different kinds of filters like regular expressions, classes, ranges etc. Example:

           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 ]

      Parameters:
        `self` - the object over which we iterate
        `filter` - the filter to perform on the object (using the isCase(java.lang.Object, java.lang.Object) method)
      Returns:
        a collection of objects which match the filter
      Since:
        1.5.6

    - #### <T> public static Collection<T> grep(Collection<T> self, Object filter)

      Iterates over the collection of items and returns each item that matches the given filter - calling the `isCase(java.lang.Object, java.lang.Object)` method used by switch statements. method can be used with different kinds of filters like regular expressions, classes, ranges etc. Example:

           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 ]

      Parameters:
        `self` - a collection
        `filter` - the filter to perform on each element of the collection (using the isCase(java.lang.Object, java.lang.Object) method)
      Returns:
        a collection of objects which match the filter
      Since:
        2.0

    - #### <T> public static List<T> grep(List<T> self, Object filter)

      Iterates over the collection of items and returns each item that matches the given filter - calling the `isCase(java.lang.Object, java.lang.Object)` method used by switch statements. This method can be used with different kinds of filters like regular expressions, classes, ranges etc. Example:

           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 ]

      Parameters:
        `self` - a List
        `filter` - the filter to perform on each element of the collection (using the isCase(java.lang.Object, java.lang.Object) method)
      Returns:
        a List of objects which match the filter
      Since:
        2.4.0

    - #### <T> public static Set<T> grep(Set<T> self, Object filter)

      Iterates over the collection of items and returns each item that matches the given filter - calling the `isCase(java.lang.Object, java.lang.Object)` method used by switch statements. This method can be used with different kinds of filters like regular expressions, classes, ranges etc. Example:

           def set = ['a', 'b', 'aa', 'bc', 3, 4.5] as Set
           assert set.grep( ~/a+/ )  == ['a', 'aa'] as Set
           assert set.grep( ~/../ )  == ['aa', 'bc'] as Set
           assert set.grep( Number ) == [ 3, 4.5 ] as Set
           assert set.grep{ it.toString().size() == 1 } == [ 'a', 'b', 3 ] as Set

      Parameters:
        `self` - a Set
        `filter` - the filter to perform on each element of the collection (using the isCase(java.lang.Object, java.lang.Object) method)
      Returns:
        a Set of objects which match the filter
      Since:
        2.4.0

    - #### public static Collection grep(Object self)

      Iterates over the collection of items which this Object represents and returns each item that matches using the IDENTITY Closure as a filter - effectively returning all elements which satisfy Groovy truth.

      Example:

           def items = [1, 2, 0, false, true, '', 'foo', [], [4, 5], null]
           assert items.grep() == [1, 2, true, 'foo', [4, 5]]

      Parameters:
        `self` - the object over which we iterate
      Returns:
        a collection of objects which match the filter
      Since:
        1.8.1
      See Also:
        Closure.IDENTITY

    - #### <T> public static Collection<T> grep(Collection<T> self)

      Iterates over the collection returning each element that matches using the IDENTITY Closure as a filter - effectively returning all elements which satisfy Groovy truth.

      Example:

           def items = [1, 2, 0, false, true, '', 'foo', [], [4, 5], null]
           assert items.grep() == [1, 2, true, 'foo', [4, 5]]

      Parameters:
        `self` - a Collection
      Returns:
        a collection of elements satisfy Groovy truth
      See Also:
        Closure.IDENTITY
      Since:
        2.0

    - #### <T> public static List<T> grep(List<T> self)

      Iterates over the collection returning each element that matches using the IDENTITY Closure as a filter - effectively returning all elements which satisfy Groovy truth.

      Example:

           def items = [1, 2, 0, false, true, '', 'foo', [], [4, 5], null]
           assert items.grep() == [1, 2, true, 'foo', [4, 5]]

      Parameters:
        `self` - a List
      Returns:
        a List of elements satisfy Groovy truth
      See Also:
        Closure.IDENTITY
      Since:
        2.4.0

    - #### <T> public static Set<T> grep(Set<T> self)

      Iterates over the collection returning each element that matches using the IDENTITY Closure as a filter - effectively returning all elements which satisfy Groovy truth.

      Example:

           def items = [1, 2, 0, false, true, '', 'foo', [], [4, 5], null] as Set
           assert items.grep() == [1, 2, true, 'foo', [4, 5]] as Set

      Parameters:
        `self` - a Set
      Returns:
        a Set of elements satisfy Groovy truth
      See Also:
        Closure.IDENTITY
      Since:
        2.4.0

    - #### <T> @Deprecated(since = "5.0.0")
      public static Collection<T> grep(T[] self)

    - #### <T> @Deprecated(since = "5.0.0")
      public static Collection<T> grep(T[] self, Object filter)

    - #### <K, T> protected static void groupAnswer(Map<K, List<T>> answer, T element, K value)

      Groups the current element according to the value

      Parameters:
        `answer` - the map containing the results
        `element` - the element to be placed
        `value` - the value according to which the element will be placed
      Since:
        1.5.0

    - #### <K, T> public static Map<K, List<T>> groupBy(Iterable<T> self, @ClosureParams(FirstParam.FirstGenericType.class)
      Closure<K> closure)

      Sorts all Iterable members into groups determined by the supplied mapping closure. The closure should return the key that this item should be grouped by. The returned LinkedHashMap will have an entry for each distinct key returned from the closure, with each value being a list of items for that group.

      Example usage:

           assert [0:[2,4,6], 1:[1,3,5]] == [1,2,3,4,5,6].groupBy { it % 2 }

      Parameters:
        `self` - a collection to group
        `closure` - a closure mapping entries on keys
      Returns:
        a new Map grouped by keys
      Since:
        2.2.0

    - #### public static Map groupBy(Iterable self, Object closures)

      Sorts all Iterable members into (sub)groups determined by the supplied mapping closures. Each closure should return the key that this item should be grouped by. The returned LinkedHashMap will have an entry for each distinct 'key path' returned from the closures, with each value being a list of items for that 'group path'. Example usage:

          def result = [1,2,3,4,5,6].groupBy({ it % 2 }, { it < 4 })
           assert result == [1:[(true):[1, 3], (false):[5]], 0:[(true):[2], (false):[4, 6]]]

      Another example:

          def sql = groovy.sql.Sql.newInstance(/* ... */)
           def data = sql.rows("SELECT * FROM a_table").groupBy({ it.column1 }, { it.column2 }, { it.column3 })
           if (data.val1.val2.val3) {
               // there exists a record where:
               //   a_table.column1 == val1
               //   a_table.column2 == val2, and
               //   a_table.column3 == val3
           } else {
               // there is no such record
           }

      If an empty array of closures is supplied the IDENTITY Closure will be used.
      Parameters:
        `self` - a collection to group
        `closures` - an array of closures, each mapping entries on keys
      Returns:
        a new Map grouped by keys on each criterion
      Since:
        2.2.0
      See Also:
        Closure.IDENTITY

    - #### public static Map groupBy(Iterable self, List<Closure> closures)

      Sorts all Iterable members into (sub)groups determined by the supplied mapping closures. Each closure should return the key that this item should be grouped by. The returned LinkedHashMap will have an entry for each distinct 'key path' returned from the closures, with each value being a list of items for that 'group path'. Example usage:

           def result = [1,2,3,4,5,6].groupBy([{ it % 2 }, { it < 4 }])
           assert result == [1:[(true):[1, 3], (false):[5]], 0:[(true):[2], (false):[4, 6]]]

      Another example:

           def sql = groovy.sql.Sql.newInstance(/* ... */)
           def data = sql.rows("SELECT * FROM a_table").groupBy([{ it.column1 }, { it.column2 }, { it.column3 }])
           if (data.val1.val2.val3) {
               // there exists a record where:
               //   a_table.column1 == val1
               //   a_table.column2 == val2, and
               //   a_table.column3 == val3
           } else {
               // there is no such record
           }

      If an empty list of closures is supplied the IDENTITY Closure will be used.
      Parameters:
        `self` - a collection to group
        `closures` - a list of closures, each mapping entries on keys
      Returns:
        a new Map grouped by keys on each criterion
      Since:
        2.2.0
      See Also:
        Closure.IDENTITY

    - #### <G, K, V> public static Map<G, Map<K, V>> groupBy(Map<K, V> self, @ClosureParams(MapEntryOrKeyValue.class)
      Closure<G> closure)

      Groups the members of a map into sub maps determined by the supplied mapping closure. The closure will be passed a Map.Entry or key and value (depending on the number of parameters the closure accepts) and should return the key that each item should be grouped under. The resulting map will have an entry for each 'group' key returned by the closure, with values being the map members from the original map that belong to each group. (If instead of a map, you want a list of map entries use {code}groupEntriesBy{code}.)

      If the `self` map is one of TreeMap, Hashtable or Properties, the returned Map will preserve that type, otherwise a LinkedHashMap will be returned.

          def result = [a:1,b:2,c:3,d:4,e:5,f:6].groupBy { it.value % 2 }
           assert result == [0:[b:2, d:4, f:6], 1:[a:1, c:3, e:5]]

      Parameters:
        `self` - a map to group
        `closure` - a closure mapping entries on keys
      Returns:
        a new Map grouped by keys
      Since:
        1.0

    - #### public static Map<Object, Map> groupBy(Map self, Object closures)

      Groups the members of a map into sub maps determined by the supplied mapping closures. Each closure will be passed a Map.Entry or key and value (depending on the number of parameters the closure accepts) and should return the key that each item should be grouped under. The resulting map will have an entry for each 'group path' returned by all closures, with values being the map members from the original map that belong to each such 'group path'. If the `self` map is one of TreeMap, Hashtable, or Properties, the returned Map will preserve that type, otherwise a LinkedHashMap will be returned.

          def result = [a:1,b:2,c:3,d:4,e:5,f:6].groupBy({ it.value % 2 }, { it.key.next() })
           assert result == [1:[b:[a:1], d:[c:3], f:[e:5]], 0:[c:[b:2], e:[d:4], g:[f:6]]]

      If an empty array of closures is supplied the IDENTITY Closure will be used.
      Parameters:
        `self` - a map to group
        `closures` - an array of closures that map entries on keys
      Returns:
        a new map grouped by keys on each criterion
      Since:
        1.8.1
      See Also:
        Closure.IDENTITY

    - #### public static Map<Object, Map> groupBy(Map self, List<Closure> closures)

      Groups the members of a map into sub maps determined by the supplied mapping closures. Each closure will be passed a Map.Entry or key and value (depending on the number of parameters the closure accepts) and should return the key that each item should be grouped under. The resulting map will have an entry for each 'group path' returned by all closures, with values being the map members from the original map that belong to each such 'group path'. If the `self` map is one of TreeMap, Hashtable, or Properties, the returned Map will preserve that type, otherwise a LinkedHashMap will be returned.

          def result = [a:1,b:2,c:3,d:4,e:5,f:6].groupBy([{ it.value % 2 }, { it.key.next() }])
           assert result == [1:[b:[a:1], d:[c:3], f:[e:5]], 0:[c:[b:2], e:[d:4], g:[f:6]]]

      If an empty list of closures is supplied the IDENTITY Closure will be used.
      Parameters:
        `self` - a map to group
        `closures` - a list of closures that map entries on keys
      Returns:
        a new map grouped by keys on each criterion
      Since:
        1.8.1
      See Also:
        Closure.IDENTITY

    - #### <K, T> @Deprecated(since = "5.0.0")
      public static Map<K, List<T>> groupBy(T[] self, @ClosureParams(FirstParam.Component.class)
      Closure<K> closure)

    - #### @Deprecated(since = "5.0.0")
      public static Map groupBy(Object[] self, Object closures)

    - #### @Deprecated(since = "5.0.0")
      public static Map groupBy(Object[] self, List<Closure> closures)

    - #### <G, K, V> public static Map<G, List<Map.Entry<K, V>>> groupEntriesBy(Map<K, V> self, @ClosureParams(MapEntryOrKeyValue.class)
      Closure<G> closure)

      Groups all map entries into groups determined by the supplied mapping closure. The closure will be passed a Map.Entry or key and value (depending on the number of parameters the closure accepts) and should return the key that each item should be grouped under. The resulting map will have an entry for each 'group' key returned by the closure, with values being the list of map entries that belong to each group. (If instead of a list of map entries, you want an actual map use {code}groupBy{code}.)

          def result = [a:1,b:2,c:3,d:4,e:5,f:6].groupEntriesBy { it.value % 2 }
           assert result[0]*.key == ["b", "d", "f"]
           assert result[1]*.value == [1, 3, 5]

      Parameters:
        `self` - a map to group
        `closure` - a 1 or 2 arg Closure mapping entries on keys
      Returns:
        a new Map grouped by keys
      Since:
        1.5.2

    - #### @Override
      public boolean hasNext()

    - #### public static MetaProperty hasProperty(Object self, String name)

      Returns true of the implementing MetaClass has a property of the given name

      Note that this method will only return true for realised properties and does not take into account implementation of getProperty or propertyMissing

      Parameters:
        `self` - The object to inspect
        `name` - The name of the property of interest
      Returns:
        The found MetaProperty or null if it doesn't exist
      See Also:
        MetaObjectProtocol.hasProperty
      Since:
        1.6.1

    - #### <T> public static T head(Iterable<T> self)

      Returns the first item from the Iterable.

           def set = [3, 4, 2] as LinkedHashSet
           assert set.head() == 3
           // check original is unaltered
           assert set == [3, 4, 2] as Set

      The first element returned by the Iterable's iterator is returned. If the Iterable doesn't guarantee a defined order it may appear like a random element is returned.
      throws:
        NoSuchElementException if you try to access head() for an empty iterable
      Parameters:
        `self` - an Iterable
      Returns:
        the first item from the Iterable
      Since:
        2.4.0

    - #### <T> public static T head(List<T> self)

      Returns the first item from the List.

          def list = [3, 4, 2]
           assert list.head() == 3
           assert list == [3, 4, 2]

      throws:
        NoSuchElementException if you try to access head() for an empty List
      Parameters:
        `self` - a List
      Returns:
        the first item from the List
      Since:
        1.5.5

    - #### <T> @Deprecated(since = "5.0.0")
      public static T head(T[] self)

    - #### <T, U> public static T identity(@groovy.lang.DelegatesTo.Target
      U self, @DelegatesTo(strategy=Closure.DELEGATE_FIRST)
      @ClosureParams(FirstParam.class)
      Closure<T> closure)

      Allows the closure to be called for the object reference self.

      Parameters:
        `self` - the object to have a closure act upon
        `closure` - the closure to call on the object
      Returns:
        result of calling the closure
      See Also:
        with(Object, Closure)
      Since:
        1.0

    - #### public static Boolean implies(Boolean left, Boolean right)

      Logical implication of two boolean operands.

      Since:
        1.8.3

    - #### <E> public static Map<Integer, E> indexed(Iterable<E> self)

      Zips an Iterable with indices in (index, value) order.

      Example usage:

           assert [0: "a", 1: "b"] == ["a", "b"].indexed()
           assert ["0: a", "1: b"] == ["a", "b"].indexed().collect { idx, str -> "$idx: $str" }

      Parameters:
        `self` - an Iterable
      Returns:
        a zipped map with indices
      See Also:
        withIndex(Iterable)
      Since:
        2.4.0

    - #### <E> public static Map<Integer, E> indexed(Iterable<E> self, int offset)

      Zips an Iterable with indices in (index, value) order.

      Example usage:

           assert [5: "a", 6: "b"] == ["a", "b"].indexed(5)
           assert ["1: a", "2: b"] == ["a", "b"].indexed(1).collect { idx, str -> "$idx: $str" }

      Parameters:
        `self` - an Iterable
        `offset` - an index to start from
      Returns:
        a Map (since the keys/indices are unique) containing the elements from the iterable zipped with indices
      See Also:
        withIndex(Iterable, int)
      Since:
        2.4.0

    - #### <E> public static Iterator<Tuple2<Integer, E>> indexed(Iterator<E> self)

      Zips an iterator with indices in (index, value) order.

      Example usage:

           assert [[0, "a"], [1, "b"]] == ["a", "b"].iterator().indexed().collect{ tuple -> [tuple.first, tuple.second] }
           assert ["0: a", "1: b"] == ["a", "b"].iterator().indexed().collect { idx, str -> "$idx: $str" }.toList()

      Parameters:
        `self` - an iterator
      Returns:
        a zipped iterator with indices
      See Also:
        withIndex(Iterator)
      Since:
        2.4.0

    - #### <E> public static Iterator<Tuple2<Integer, E>> indexed(Iterator<E> self, int offset)

      Zips an iterator with indices in (index, value) order.

      Example usage:

           assert [[5, "a"], [6, "b"]] == ["a", "b"].iterator().indexed(5).toList()
           assert ["a: 1", "b: 2"] == ["a", "b"].iterator().indexed(1).collect { idx, str -> "$str: $idx" }.toList()

      Parameters:
        `self` - an iterator
        `offset` - an index to start from
      Returns:
        a zipped iterator with indices
      See Also:
        withIndex(Iterator, int)
      Since:
        2.4.0

    - #### @Deprecated(since = "5.0.0")
      public static Map<Integer, Integer> indexed(int[] self)

    - #### @Deprecated(since = "5.0.0")
      public static Map<Integer, Long> indexed(long[] self)

    - #### @Deprecated(since = "5.0.0")
      public static Map<Integer, Double> indexed(double[] self)

    - #### @Deprecated(since = "5.0.0")
      public static Map<Integer, Integer> indexed(int[] self, int offset)

    - #### @Deprecated(since = "5.0.0")
      public static Map<Integer, Long> indexed(long[] self, int offset)

    - #### @Deprecated(since = "5.0.0")
      public static Map<Integer, Double> indexed(double[] self, int offset)

    - #### <T> public static Collection<T> init(Iterable<T> self)

      Returns the items from the Iterable excluding the last item. Leaves the original Iterable unchanged.

           def list = [3, 4, 2]
           assert list.init() == [3, 4]
           assert list == [3, 4, 2]

      throws:
        NoSuchElementException if you try to access init() for an empty Iterable
      Parameters:
        `self` - an Iterable
      Returns:
        a Collection without its last element
      Since:
        2.4.0

    - #### <T> public static List<T> init(List<T> self)

      Returns the items from the List excluding the last item. Leaves the original List unchanged.

           def list = [3, 4, 2]
           assert list.init() == [3, 4]
           assert list == [3, 4, 2]

      throws:
        NoSuchElementException if you try to access init() for an empty List
      Parameters:
        `self` - a List
      Returns:
        a List without its last element
      Since:
        2.4.0

    - #### <T> public static SortedSet<T> init(SortedSet<T> self)

      Returns the items from the SortedSet excluding the last item. Leaves the original SortedSet unchanged.

           def sortedSet = [3, 4, 2] as SortedSet
           assert sortedSet.init() == [2, 3] as SortedSet
           assert sortedSet == [3, 4, 2] as SortedSet

      throws:
        NoSuchElementException if you try to access init() for an empty SortedSet
      Parameters:
        `self` - a SortedSet
      Returns:
        a SortedSet without its last element
      Since:
        2.4.0

    - #### <T> public static Iterator<T> init(Iterator<T> self)

      Returns an Iterator containing all the items from this iterator except the last one.

           def iter = [3, 4, 2].listIterator()
           def result = iter.init()
           assert result.toList() == [3, 4]

      throws:
        NoSuchElementException if you try to access init() for an exhausted/empty Iterator
      Parameters:
        `self` - an Iterator
      Returns:
        an Iterator without the last element from the original Iterator
      Since:
        2.4.0

    - #### <T> @Deprecated(since = "5.0.0")
      public static T[] init(T[] self)

    - #### <T> public static List<List<T>> inits(Iterable<T> self)

      Calculates the init values of this Iterable: the first value will be this list of all items from the iterable and the final one will be an empty list, with the intervening values the results of successive applications of init on the items.

           assert [1, 2, 3, 4].inits() == [[1, 2, 3, 4], [1, 2, 3], [1, 2], [1], []]

      Parameters:
        `self` - an Iterable
      Returns:
        a List of the init values from the given Iterable
      Since:
        2.5.0

    - #### <T, V extends T> public static T inject(Object self, @ClosureParams(value=FromString.class,options="T,?")
      Closure<V> closure)

      Iterates through the given object, passing the first two elements to the closure. The result is passed back (injected) to the closure along with the third element and so on until all elements have been consumed.

      throws:
        NoSuchElementException if the iterator is empty
      Parameters:
        `self` - an object
        `closure` - a closure
      Returns:
        the result of the last closure call
      See Also:
        inject(Object, Object, Closure)
      Since:
        1.8.7

    - #### <E extends T, T, V extends T> public static T inject(Iterable<E> self, @ClosureParams(value=FromString.class,options="T,E")
      Closure<V> closure)

      Iterates through the given object, passing the first two elements to the closure. The result is passed back (injected) to the closure along with the third element and so on until all elements have been consumed.

           def items = [1, 2, 3, 4]
           def value = items.inject { acc, val -> acc * val }
           assert value == 1 * 2 * 3 * 4

           items = [['a','b'], ['b','c'], ['d','b']]
           value = items.inject { acc, val -> acc.intersect(val) }
           assert value == ['b']

           items = ['j', 'o', 'i', 'n'] as Set
           value = items.inject(String.&plus)
           assert value == 'join'

      throws:
        NoSuchElementException if the iterator is empty
      Parameters:
        `self` - an iterable
        `closure` - a closure
      Returns:
        the result of the last closure call
      See Also:
        inject(Iterable, Object, Closure)
      Since:
        5.0.0

    - #### <T, U extends T, V extends T> public static T inject(Object self, U initialValue, @ClosureParams(value=FromString.class,options="T,?")
      Closure<V> closure)

      Iterates through the given object, passing in the initial value to the closure along with the first item. The result is passed back (injected) into the closure along with the second item. The new result is injected back into the closure along with the third item and so on until further iteration is not possible.

      Also known as `foldLeft` or `reduce` in functional parlance.

      Parameters:
        `self` - an object
        `initialValue` - some initial value
        `closure` - a closure
      Returns:
        the result of the last closure call
      See Also:
        inject(Iterator, Object, Closure)
      Since:
        1.5.0

    - #### <E, T, U extends T, V extends T> public static T inject(Iterable<E> self, U initialValue, @ClosureParams(value=FromString.class,options="T,E")
      Closure<V> closure)

      Iterates through the given object, passing in the initial value to the 2-arg closure along with the first item. The result is passed back (injected) into the closure along with the second item. The new result is injected back into the closure along with the third item and so on until further iteration is not possible.

      Also known as `foldLeft` or `reduce` in functional parlance. Examples:

           assert 1*1*2*3*4 == [1,2,3,4].inject(1) { acc, val -> acc * val }

           assert 0+1+2+3+4 == [1,2,3,4].inject(0) { acc, val -> acc + val }

           assert 'The quick brown fox' ==
               ['quick', 'brown', 'fox'].inject('The') { acc, val -> acc + ' ' + val }

           assert 'bat' ==
               ['rat', 'bat', 'cat'].inject('zzz') { min, next -> next < min ? next : min }

           def max = { a, b -> [a, b].max() }
           def animals = ['bat', 'rat', 'cat']
           assert 'rat' == animals.inject('aaa', max)

      Visual representation of the last example above:

              initVal  animals[0]
                 v        v
           max('aaa',   'bat')  =>  'bat'  animals[1]
                                      v       v
                                max('bat',  'rat')  =>  'rat'  animals[2]
                                                          v       v
                                                    max('rat',  'cat')  =>  'rat'

      Parameters:
        `self` - an iterable
        `initialValue` - some initial value
        `closure` - a closure
      Returns:
        the result of the last closure call
      Since:
        5.0.0

    - #### <E, T, U extends T, V extends T> public static T inject(Iterator<E> self, U initialValue, @ClosureParams(value=FromString.class,options="T,E")
      Closure<V> closure)

      Iterates through the given iterator, passing in the initial value to the closure along with the first item. The result is passed back (injected) into the closure along with the second item. The new result is injected back into the closure along with the third item and so on until further iteration is not possible.

      Also known as `foldLeft` or `reduce` in functional parlance.

      Parameters:
        `self` - an iterator
        `initialValue` - some initial value
        `closure` - a closure
      Returns:
        the result of the last closure call
      Since:
        1.5.0

    - #### <K, V, T, U extends T, W extends T> public static T inject(Map<K, V> self, U initialValue, @ClosureParams(value=FromString.class,options={"T,Map.Entry","T,K,V"})
      Closure<W> closure)

      Iterates through the given map, passing in the initial value to the 2-arg Closure along with the first item (or 3-arg Closure along with the first key and value). The result is passed back (injected) into the closure along with the second item. The new result is injected back into the closure along with the third item and so on until further iteration is not possible.

      Also known as `foldLeft` or `reduce` in functional parlance. Examples:

           def map = [a:1, b:2, c:3]
           assert map.inject([]) { list, k, v ->
             list + [k] * v
           } == ['a', 'b', 'b', 'c', 'c', 'c']

      Parameters:
        `self` - a map
        `initialValue` - some initial value
        `closure` - a 2 or 3 arg Closure
      Returns:
        the result of the last closure call
      Since:
        1.8.1

    - #### <E extends T, T, V extends T> @Deprecated(since = "5.0.0")
      public static T inject(E[] self, @ClosureParams(value=FromString.class,options="T,E")
      Closure<V> closure)

    - #### <E extends T, T, V extends T> @Deprecated(since = "5.0.0")
      public static T inject(Collection<E> self, @ClosureParams(value=FromString.class,options="T,E")
      Closure<V> closure)

    - #### <E, T, U extends T, V extends T> @Deprecated(since = "5.0.0")
      public static T inject(E[] self, U initialValue, @ClosureParams(value=FromString.class,options="T,E")
      Closure<V> closure)

    - #### <E, T, U extends T, V extends T> @Deprecated(since = "5.0.0")
      public static T inject(Collection<E> self, U initialValue, @ClosureParams(value=FromString.class,options="T,E")
      Closure<V> closure)

    - #### <E, T, U extends T, V extends T> public static List<T> injectAll(Iterable<E> self, U initialValue, @ClosureParams(value=FromString.class,options="T,E")
      Closure<V> closure)

      Iterates through the given iterable, injecting values as per `inject` but returns the list of all calculated values instead of just the final result.

      Also known as prefix sum or scan in functional parlance. Example:

           assert (1..3).injectAll(''){ carry, next -> carry + next } == ['1', '12', '123']
           var runningAvg = [1.0, 2.0, 3.0].injectAll([0.0, 0, null]){ accum, next ->
               var total = accum[0] + next
               var count = accum[1] + 1
               [total, count, total/count]
           }
           assert runningAvg*.get(2) == [1.0, 1.5, 2.0]

      Parameters:
        `self` - an iterator
        `initialValue` - some initial value
        `closure` - a closure
      Returns:
        the list of all calculated values
      Since:
        5.0.0

    - #### <E extends T, T, V extends T> public static List<T> injectAll(Iterable<E> self, @ClosureParams(value=FromString.class,options="T,E")
      Closure<V> closure)

      Iterates through the given iterable, injecting values as per `inject` but returns the list of all calculated values instead of just the final result.

      Example:

           assert (1..5).injectAll { carry, next -> carry + next } == [3, 6, 10, 15]
           assert (1..5).injectAll(Integer::plus) == [3, 6, 10, 15]

      See Also:
        injectAll(Iterable, Closure)
      Since:
        5.0.0

    - #### <E, T, U extends T, V extends T> public static Iterator<T> injectAll(Iterator<E> self, U initialValue, @ClosureParams(value=FromString.class,options="T,E")
      Closure<V> closure)

      Iterates through the given iterator, injecting values as per `inject` but returns the list of all calculated values instead of just the final result.

      Example:

           assert (1..3)
               .iterator()
               .injectAll(''){ carry, next -> carry + next }
               .toList() == ['1', '12', '123']

      See Also:
        injectAll(Iterable, Object, Closure)
      Since:
        5.0.0

    - #### <E, T, V extends T> public static Iterator<T> injectAll(Iterator<E> self, @ClosureParams(value=FromString.class,options="T,E")
      Closure<V> closure)

      Iterates through the given iterator, injecting values as per `inject` but returns the list of all calculated values instead of just the final result.

      Example:

           assert (1..5).iterator().injectAll(Integer::plus).toList() == [3, 6, 10, 15]

      Since:
        5.0.0

    - #### <K, V, T, U extends T, W extends T> public static List<T> injectAll(Map<K, V> self, U initialValue, @ClosureParams(value=FromString.class,options={"T,Map.Entry","T,K,V"})
      Closure<W> closure)

      Iterates through the given map, passing in the initial value to the 2-arg Closure along with the first item (or 3-arg Closure along with the first key and value) and then similarly for other map entries. The results are collected in a list. Examples:

           def map = [a:1, b:2, c:3]
           assert map.injectAll('') { carry, k, v ->
               carry + k * v
           } == ['a', 'abb', 'abbccc']

      Parameters:
        `self` - a map
        `initialValue` - some initial value
        `closure` - a 2 or 3 arg Closure
      Returns:
        the accumulated results from each closure call
      Since:
        5.0.0

    - #### public static String inspect(Object self)

      Inspects returns the String that matches what would be typed into a terminal to create this object.

      Parameters:
        `self` - any Object
      Returns:
        a String that matches what would be typed into a terminal to create this object. e.g. [1, 'hello'].inspect() `->` [1, 'hello']
      Since:
        1.0

    - #### public static Number intdiv(Character left, Number right)

      Integer Divide a Character by a Number. The ordinal value of the Character is used in the division (the ordinal value is the unicode value which for simple character sets is the ASCII value).

      Parameters:
        `left` - a Character
        `right` - a Number
      Returns:
        a Number (an Integer) resulting from the integer division operation
      Since:
        1.0

    - #### public static Number intdiv(Number left, Character right)

      Integer Divide a Number by a Character. The ordinal value of the Character is used in the division (the ordinal value is the unicode value which for simple character sets is the ASCII value).

      Parameters:
        `left` - a Number
        `right` - a Character
      Returns:
        a Number (an Integer) resulting from the integer division operation
      Since:
        1.0

    - #### public static Number intdiv(Character left, Character right)

      Integer Divide two Characters. The ordinal values of the Characters are used in the division (the ordinal value is the unicode value which for simple character sets is the ASCII value).

      Parameters:
        `left` - a Character
        `right` - another Character
      Returns:
        a Number (an Integer) resulting from the integer division operation
      Since:
        1.0

    - #### public static Number intdiv(Number left, Number right)

      Integer Divide two Numbers.

      Parameters:
        `left` - a Number
        `right` - another Number
      Returns:
        a Number (an Integer) resulting from the integer division operation
      Since:
        1.0

    - #### <T, U extends T, V extends T> public static List<T> interleave(Iterable<U> self, Iterable<V> other)

      The elements from two Iterables interleaved. If the iterables are of different sizes, the result will have the same size as the shorter one.

      Example:

           def abc = 'A'..'C'
           def nums = 1..2
           assert ['A', 1, 'B', 2] == abc.interleave(nums)
           assert [1, 'A', 2, 'B'] == nums.interleave(abc)

      Parameters:
        `self` - an Iterable
        `other` - another Iterable
      Returns:
        a list of all the pairs from self and other interleaved
      Since:
        5.0.0

    - #### <T, U extends T, V extends T> public static List<T> interleave(Iterable<U> self, Iterable<V> other, boolean includeRemainder)

      The elements from two Iterables interleaved. If the sources are of different sizes, and `includeRemainder` is true, the extra elements from the longer source will be appended after interleaving.

      Example:

           def items = (1..4)
           def other = [10, 20]
           assert [1, 10, 2, 20, 3, 4] == items.interleave(other, true)

      When `includeRemainder` is false, this is equivalent to `zip` then `collectMany`.

      Parameters:
        `self` - an Iterable
        `other` - another Iterable
      Returns:
        a list of all the pairs from self and other interleaved
      See Also:
        for zipping more than two lists
      Since:
        5.0.0

    - #### <T, U extends T, V extends T> public static Iterator<T> interleave(Iterator<U> self, Iterator<V> other)

      An iterator of the elements from two Iterators interleaved. If the sources are of different sizes, the result will have twice the size of the shorter one.

      Example:

           def items = (1..4).iterator()
           def other = [10, 20].iterator()
           assert [1, 10, 2, 20] == items.interleave(other).toList()

      Parameters:
        `self` - an Iterator
        `other` - another Iterator
      Returns:
        an iterator of all the pairs from self and other
      Since:
        5.0.0

    - #### <T, U extends T, V extends T> public static Iterator<T> interleave(Iterator<U> self, Iterator<V> other, boolean includeRemainder)

      An iterator of the elements from two Iterators interleaved. If the sources are of different sizes, and `includeRemainder` is true, the extra elements from the longer source will be appended after interleaving.

      Example:

           def items = (1..4).iterator()
           def other = [10, 20].iterator()
           assert [1, 10, 2, 20, 3, 4] == items.interleave(other, true).toList()

      When `includeRemainder` is false, this is equivalent to `zip` then `collectMany`.

      Parameters:
        `self` - an Iterator
        `other` - an Iterable
        `includeRemainder` - whether to process extra elements if the operands are of different sizes
      Returns:
        an iterator of all the pairs from self and other
      Since:
        5.0.0

    - #### <T> public static Collection<T> intersect(Collection<T> left, Collection<T> right)

      Create a Collection composed of the intersection of both collections. Any elements that exist in both collections are added to the resultant collection. For collections of custom objects; the objects should implement java.lang.Comparable

          assert [4,5] == [1,2,3,4,5].intersect([4,5,6,7,8])

      By default, Groovy uses a NumberAwareComparator when determining if an element exists in both collections.
      Parameters:
        `left` - a Collection
        `right` - a Collection
      Returns:
        a Collection as an intersection of both collections
      See Also:
        intersect(Collection, Collection, Comparator)
      Since:
        1.5.6

    - #### <T> public static Collection<T> intersect(Collection<T> left, Collection<T> right, Comparator<? super T> comparator)

      Create a Collection composed of the intersection of both collections. Any elements that exist in both collections are added to the resultant collection. For collections of custom objects; the objects should implement java.lang.Comparable

           assert [3,4] == [1,2,3,4].intersect([3,4,5,6], Comparator.naturalOrder())
           assert [2,4] == [1,2,3,4].intersect([4,8,12,16,20], (x, y) -> x * x <=> y)

           def one = ['a', 'B', 'c', 'd']
           def two = ['b', 'C', 'd', 'e']
           def compareIgnoreCase = { a, b -> a.toLowerCase() <=> b.toLowerCase() }
           assert one.intersect(two) == ['d']
           assert two.intersect(one) == ['d']
           assert one.intersect(two, compareIgnoreCase) == ['B', 'c', 'd']
           assert two.intersect(one, compareIgnoreCase) == ['b', 'C', 'd']

      Parameters:
        `left` - a Collection
        `right` - a Collection
        `comparator` - a Comparator
      Returns:
        a Collection as an intersection of both collections
      Since:
        2.5.0

    - #### <T> public static Collection<T> intersect(Iterable<T> left, Iterable<T> right)

      Create a Collection composed of the intersection of both iterables. Any elements that exist in both iterables are added to the resultant collection. For iterables of custom objects; the objects should implement java.lang.Comparable

           assert [4,5] == [1,2,3,4,5].intersect([4,5,6,7,8])

      By default, Groovy uses a NumberAwareComparator when determining if an element exists in both collections.
      Parameters:
        `left` - an Iterable
        `right` - an Iterable
      Returns:
        a Collection as an intersection of both iterables
      See Also:
        intersect(Iterable, Iterable, Comparator)
      Since:
        2.4.0

    - #### <T> public static Collection<T> intersect(Iterable<T> left, Iterable<T> right, Comparator<? super T> comparator)

      Create a Collection composed of the intersection of both iterables. Any elements that exist in both iterables are added to the resultant collection. For iterables of custom objects; the objects should implement java.lang.Comparable

           assert [3,4] == [1,2,3,4].intersect([3,4,5,6], Comparator.naturalOrder())

      Parameters:
        `left` - an Iterable
        `right` - an Iterable
        `comparator` - a Comparator
      Returns:
        a Collection as an intersection of both iterables
      Since:
        2.5.0

    - #### <T> public static Collection<T> intersect(Iterable<T> left, Iterable<T> right, @ClosureParams(value=FromString.class, options={"T","T,T"})
      Closure condition)

      Create a Collection composed of the intersection of both iterables. Elements from teh first iterable which also occur (according to the comparator closure) in the second iterable are added to the result. If the closure takes a single parameter, the argument passed will be each element, and the closure should return a value used for comparison (either using Comparable.compareTo or Object.equals). If the closure takes two parameters, two items from the Iterator will be passed as arguments, and the closure should return an int value (with 0 indicating the items are deemed equal).

           def one = ['a', 'B', 'c', 'd']
           def two = ['b', 'C', 'd', 'e']
           def compareIgnoreCase = { it.toLowerCase() }
           assert one.intersect(two, compareIgnoreCase) == ['B', 'c', 'd']
           assert two.intersect(one, compareIgnoreCase) == ['b', 'C', 'd']

      Parameters:
        `left` - an Iterable
        `right` - an Iterable
        `condition` - a Closure used to determine unique items
      Returns:
        a Collection as an intersection of both iterables
      Since:
        4.0.0

    - #### <T> public static List<T> intersect(List<T> left, Iterable<T> right)

      Create a List composed of the intersection of a List and an Iterable. Any elements that exist in both iterables are added to the resultant collection.

           assert [4,5] == [1,2,3,4,5].intersect([4,5,6,7,8])

      By default, Groovy uses a NumberAwareComparator when determining if an element exists in both collections.
      Parameters:
        `left` - a List
        `right` - an Iterable
      Returns:
        a List as an intersection of a List and an Iterable
      See Also:
        intersect(List, Iterable, Comparator)
      Since:
        2.4.0

    - #### <T> public static List<T> intersect(List<T> left, Iterable<T> right, Comparator<? super T> comparator)

      Create a List composed of the intersection of a List and an Iterable. Any elements that exist in both iterables are added to the resultant collection.

           assert [3,4] == [1,2,3,4].intersect([3,4,5,6])

      Parameters:
        `left` - a List
        `right` - an Iterable
        `comparator` - a Comparator
      Returns:
        a List as an intersection of a List and an Iterable
      Since:
        2.5.0

    - #### <T> public static Set<T> intersect(Set<T> left, Iterable<T> right)

      Create a Set composed of the intersection of a Set and an Iterable. Any elements that exist in both iterables are added to the resultant collection.

           assert [4,5] as Set == ([1,2,3,4,5] as Set).intersect([4,5,6,7,8])

      By default, Groovy uses a NumberAwareComparator when determining if an element exists in both collections.
      Parameters:
        `left` - a Set
        `right` - an Iterable
      Returns:
        a Set as an intersection of a Set and an Iterable
      See Also:
        intersect(Set, Iterable, Comparator)
      Since:
        2.4.0

    - #### <T> public static Set<T> intersect(Set<T> left, Iterable<T> right, Comparator<? super T> comparator)

      Create a Set composed of the intersection of a Set and an Iterable. Any elements that exist in both iterables are added to the resultant collection.

           assert [3,4] as Set == ([1,2,3,4] as Set).intersect([3,4,5,6], Comparator.naturalOrder())

      Parameters:
        `left` - a Set
        `right` - an Iterable
        `comparator` - a Comparator
      Returns:
        a Set as an intersection of a Set and an Iterable
      Since:
        2.5.0

    - #### <T> public static SortedSet<T> intersect(SortedSet<T> left, Iterable<T> right)

      Create a SortedSet composed of the intersection of a SortedSet and an Iterable. Any elements that exist in both iterables are added to the resultant collection.

           assert [4,5] as SortedSet == ([1,2,3,4,5] as SortedSet).intersect([4,5,6,7,8])

      By default, Groovy uses a NumberAwareComparator when determining if an element exists in both collections.
      Parameters:
        `left` - a SortedSet
        `right` - an Iterable
      Returns:
        a Set as an intersection of a SortedSet and an Iterable
      See Also:
        intersect(SortedSet, Iterable, Comparator)
      Since:
        2.4.0

    - #### <T> public static SortedSet<T> intersect(SortedSet<T> left, Iterable<T> right, Comparator<? super T> comparator)

      Create a SortedSet composed of the intersection of a SortedSet and an Iterable. Any elements that exist in both iterables are added to the resultant collection.

           assert [4,5] as SortedSet == ([1,2,3,4,5] as SortedSet).intersect([4,5,6,7,8])

      Parameters:
        `left` - a SortedSet
        `right` - an Iterable
        `comparator` - a Comparator
      Returns:
        a Set as an intersection of a SortedSet and an Iterable
      Since:
        2.5.0

    - #### <K, V> public static Map<K, V> intersect(Map<K, V> left, Map<K, V> right)

      Create a Map composed of the intersection of both maps. Any entries that exist in both maps are added to the resultant map.

          assert [4:4,5:5] == [1:1,2:2,3:3,4:4,5:5].intersect([4:4,5:5,6:6,7:7,8:8])

          assert [1: 1, 2: 2, 3: 3, 4: 4].intersect( [1: 1.0, 2: 2, 5: 5] ) == [1:1, 2:2]

      Parameters:
        `left` - a map
        `right` - a map
      Returns:
        a Map as an intersection of both maps
      Since:
        1.7.4

    - #### public static Object invokeMethod(Object object, String method, Object arguments)

      Provide a dynamic method invocation method which can be overloaded in classes to implement dynamic proxies easily.

      Parameters:
        `object` - any Object
        `method` - the name of the method to call
        `arguments` - the arguments to use
      Returns:
        the result of the method call
      Since:
        1.0

    - #### public static boolean is(Object self, Object other)

      Identity check. Since == is overridden in Groovy with the meaning of equality we need some fallback to check for object identity. Invoke using the 'is' method, like so: `def same = this.is(that)`

      Parameters:
        `self` - an object
        `other` - an object to compare identity with
      Returns:
        true if self and other are both references to the same instance, false otherwise
      Since:
        1.0

    - #### public static Boolean isAtLeast(BigDecimal left, BigDecimal right)

      Compare a BigDecimal to another. A fluent api style alias for `compareTo`.

      Parameters:
        `left` - a BigDecimal
        `right` - a BigDecimal
      Returns:
        true if left is equal to or bigger than right
      Since:
        3.0.1

    - #### public static Boolean isAtLeast(BigDecimal left, String right)

      Compare a BigDecimal to a String representing a number. A fluent api style alias for `compareTo`.

      Parameters:
        `left` - a BigDecimal
        `right` - a String representing a number
      Returns:
        true if left is equal to or bigger than the value represented by right
      Since:
        3.0.1

    - #### public static boolean isCase(Object caseValue, Object switchValue)

      Method for overloading the behavior of the 'case' method in switch statements. The default implementation handles arrays types but otherwise simply delegates to Object#equals, but this may be overridden for other types. In this example:

           switch( a ) {
             case b: //some code
           }

      "some code" is called when `b.isCase( a )` returns `true`.
      Parameters:
        `caseValue` - the case value
        `switchValue` - the switch value
      Returns:
        true if the switchValue is deemed to be equal to the caseValue
      Since:
        1.0

    - #### @SuppressWarnings("unchecked")
      public static boolean isCase(Class caseValue, Object switchValue)

      Special 'case' implementation for Class, which allows testing whether some switch value is assignable from the given case class. If the switch value is an object, `isCase` will return true if the switch value is assignment compatible with the class (case value), i.e. is an `instanceof` the class, for example:

           def someList = []
           switch (someList) {
             case List:
               assert true : 'is a list'
               break
             case Map:
               assert false : 'is not a Map'
               break
             default:
               assert false : 'should never get here'
               break
           }

      If the switch value is a class, `isCase` will return true if the switch value is assignable from the given class (case value), i.e. the case class is the same as, or a superclass, or a super-interface of the switch class, for example:

           switch (ArrayList) {
             case List:
               assert true : 'is a list'
               break
             case Map:
               assert false : 'is not a Map'
               break
             default:
               assert false : 'should never get here'
               break
           }

      Parameters:
        `caseValue` - the case value
        `switchValue` - the switch value
      Returns:
        true if the switchValue is deemed to be assignable from the given class
      Since:
        1.0

    - #### public static boolean isCase(Collection caseValue, Object switchValue)

      Special 'case' implementation for collections which tests if the 'switch' operand is contained in any of the 'case' values. For example:

          switch( 3 ) {
             case [1,3,5]:
               assert true
               break
             default:
               assert false
           }

      Parameters:
        `caseValue` - the case value
        `switchValue` - the switch value
      Returns:
        true if the caseValue is deemed to contain the switchValue
      See Also:
        Collection.contains
      Since:
        1.0

    - #### public static boolean isCase(Iterable caseValue, Object switchValue)

      Special 'case' implementation for iterables which tests if the 'switch' operand is contained in any of the 'case' values. For example:

          Iterable it = {[1,3,5].iterator()}
           switch( 3 ) {
             case it:
               assert true
               break
             default:
               assert false
           }

           // GROOVY-7919
           assert 1 in it
           assert 2 !in it

      Parameters:
        `caseValue` - the case value
        `switchValue` - the switch value
      Returns:
        true if the caseValue is deemed to contain the switchValue
      See Also:
        contains(Iterable,Object)
      Since:
        5.0.0

    - #### public static boolean isCase(Map caseValue, Object switchValue)

      Special 'case' implementation for maps which tests if the 'switch' operand exists in the key set. For example:

          switch( 'foo' ) {
             case [foo:true, bar:false]:
               assert true
               break
             default:
               assert false
           }

      Parameters:
        `caseValue` - the case value
        `switchValue` - the switch value
      Returns:
        the groovy truth value from caseValue corresponding to the switchValue key
      Since:
        1.7.6

    - #### public static boolean isCase(Number caseValue, Number switchValue)

      Special 'case' implementation for all numbers, which delegates to the `compareTo()` method for comparing numbers of different types.

      Parameters:
        `caseValue` - the case value
        `switchValue` - the switch value
      Returns:
        true if the numbers are deemed equal
      Since:
        1.5.0

    - #### public static boolean isDigit(Character self)

      Determines if a character is a digit. Synonym for 'Character.isDigit(this)'.

      Parameters:
        `self` - a Character
      Returns:
        true if the character is a digit
      See Also:
        Character.isDigit
      Since:
        1.5.7

    - #### public static boolean isEmpty(Iterable self)

      Check whether an `Iterable` has elements

           def items = [1]
           def iterable = { [ hasNext:{ !items.isEmpty() }, next:{ items.pop() } ] as Iterator } as Iterable
           assert !iterable.isEmpty()
           iterable.iterator().next()
           assert iterable.isEmpty()

      Parameters:
        `self` - an Iterable
      Returns:
        true if the iterable has no elements, false otherwise
      Since:
        2.5.0

    - #### public static boolean isLetter(Character self)

      Determines if a character is a letter. Synonym for 'Character.isLetter(this)'.

      Parameters:
        `self` - a Character
      Returns:
        true if the character is a letter
      See Also:
        Character.isLetter
      Since:
        1.5.7

    - #### public static boolean isLetterOrDigit(Character self)

      Determines if a character is a letter or digit. Synonym for 'Character.isLetterOrDigit(this)'.

      Parameters:
        `self` - a Character
      Returns:
        true if the character is a letter or digit
      See Also:
        Character.isLetterOrDigit
      Since:
        1.5.7

    - #### public static boolean isLowerCase(Character self)

      Determines if a Character is lowercase. Synonym for 'Character.isLowerCase(this)'.

      Parameters:
        `self` - a Character
      Returns:
        true if the character is lowercase
      See Also:
        Character.isLowerCase
      Since:
        1.5.7

    - #### public static boolean isNotCase(Number caseValue, Number switchValue)

      Since:
        4.0.0

    - #### public static boolean isNotCase(Object caseValue, Object switchValue)

      Since:
        4.0.0

    - #### public static boolean isNotCase(Class<?> caseValue, Object switchValue)

      Since:
        4.0.0

    - #### public static boolean isNotCase(Closure<?> caseValue, Object switchValue)

      Since:
        4.0.0

    - #### public static boolean isNotCase(Collection<?> caseValue, Object switchValue)

      Since:
        4.0.0

    - #### public static boolean isNotCase(Map<?, ?> caseValue, Object switchValue)

      Since:
        4.0.0

    - #### public static boolean isUpperCase(Character self)

      Determines if a Character is uppercase. Synonym for 'Character.isUpperCase(this)'.

      Parameters:
        `self` - a Character
      Returns:
        true if the character is uppercase
      See Also:
        Character.isUpperCase
      Since:
        1.5.7

    - #### public static boolean isWhitespace(Character self)

      Determines if a character is a whitespace character. Synonym for 'Character.isWhitespace(this)'.

      Parameters:
        `self` - a Character
      Returns:
        true if the character is a whitespace character
      See Also:
        Character.isWhitespace
      Since:
        1.5.7

    - #### public static Iterator iterator(Object self)

      Creates an Iterator for the given Object by converting it to a Collection.

      Parameters:
        `self` - an object
      Returns:
        an Iterator for the given Object
      See Also:
        DefaultTypeTransformation.asCollection
      Since:
        1.0

    - #### <T> public static Iterator<T> iterator(Iterator<T> self)

      Supports 'duck-typing' when trying to get an Iterator for each element of a Collection, some of which may already be an Iterator.

      Parameters:
        `self` - an Iterator object
      Returns:
        the Iterator itself
      Since:
        1.5.0

    - #### <T> public static Iterator<T> iterator(Enumeration<T> self)

      Allows an Enumeration to behave like an Iterable. Note that the Iterator.remove method is unsupported since the underlying Enumeration doesn't provide a mechanism for removing items.

      Parameters:
        `self` - an Enumeration object
      Returns:
        an Iterator for the given Enumeration
      Since:
        1.0

    - #### <K, V> public static Iterator<Map.Entry<K, V>> iterator(Map<K, V> self)

      Returns an Iterator for the given Map's entry set.

      Since:
        5.0.0

    - #### <T> @Deprecated(since = "5.0.0")
      public static Iterator<T> iterator(T[] self)

    - #### public static String join(Iterator<?> self)

      Concatenates the `toString()` representation of each item from the Iterator. The iterator will be exhausted of elements.

      Parameters:
        `self` - an Iterator of objects
      Returns:
        the joined String
      Since:
        5.0.0

    - #### public static String join(Iterable<?> self)

      Concatenates the `toString()` representation of each item from the Iterable.

          assert [1,2,3].join() == "123"

      Parameters:
        `self` - an Iterable of objects
      Returns:
        the joined String
      Since:
        5.0.0

    - #### public static String join(Iterator<?> self, String separator)

      Concatenates the `toString()` representation of each item from the Iterator, with the given String as a separator between each item. The iterator will become exhausted of elements after producing the resulting conjoined value.

      Parameters:
        `self` - an Iterator of objects
        `separator` - a String separator
      Returns:
        the joined String
      Since:
        1.5.5

    - #### public static String join(Iterable<?> self, String separator)

      Concatenates the `toString()` representation of each item from the Iterable, with the given String as a separator between each item.

          assert [1,2,3].join(", ") == "1, 2, 3"

      Parameters:
        `self` - an Iterable of objects
        `separator` - a String separator
      Returns:
        the joined String
      Since:
        1.0

    - #### @Deprecated(since = "5.0.0")
      public static String join(boolean[] self, String separator)

    - #### @Deprecated(since = "5.0.0")
      public static String join(byte[] self, String separator)

    - #### @Deprecated(since = "5.0.0")
      public static String join(char[] self, String separator)

    - #### @Deprecated(since = "5.0.0")
      public static String join(short[] self, String separator)

    - #### @Deprecated(since = "5.0.0")
      public static String join(int[] self, String separator)

    - #### @Deprecated(since = "5.0.0")
      public static String join(long[] self, String separator)

    - #### @Deprecated(since = "5.0.0")
      public static String join(float[] self, String separator)

    - #### @Deprecated(since = "5.0.0")
      public static String join(double[] self, String separator)

    - #### <T> @Deprecated(since = "5.0.0")
      public static String join(T[] self, String separator)

    - #### <T> public static T last(List<T> self)

      Returns the last item from the List.

           def list = [3, 4, 2]
           assert list.last() == 2
           // check original is unaltered
           assert list == [3, 4, 2]

      throws:
        NoSuchElementException if you try to access last() for an empty List
      Parameters:
        `self` - a List
      Returns:
        the last item from the List
      Since:
        1.5.5

    - #### <T> public static T last(Deque<T> self)

      An optimized version of last(List).

      Since:
        2.5.15

    - #### <T> public static T last(Iterable<T> self)

      Returns the last item from the Iterable.

           def set = [3, 4, 2] as LinkedHashSet
           assert set.last() == 2
           // check original unaltered
           assert set == [3, 4, 2] as Set

      The last element returned by the Iterable's iterator is returned. If the Iterable doesn't guarantee a defined order it may appear like a random element is returned.
      throws:
        NoSuchElementException if you try to access last() for an empty Iterable
      Parameters:
        `self` - an Iterable
      Returns:
        the last item from the Iterable
      Since:
        1.8.7

    - #### <T> @Deprecated(since = "5.0.0")
      public static T last(T[] self)

    - #### <T> public static Collection<T> leftShift(Collection<T> self, T value)

      Overloads the left shift operator to provide an easy way to append objects to a Collection.

          def list = [1,2]
           list << 3
           assert list == [1,2,3]

      Parameters:
        `self` - a Collection
        `value` - an Object to be added to the collection.
      Returns:
        same collection, after the value was added to it.
      Since:
        1.0

    - #### <T> public static List<T> leftShift(List<T> self, T value)

      Overloads the left shift operator to provide an easy way to append objects to a List.

          def list = [1,2]
           list << 3
           assert list == [1,2,3]

      Parameters:
        `self` - a List
        `value` - an Object to be added to the List.
      Returns:
        same List, after the value was added to it.
      Since:
        2.4.0

    - #### <T> public static Set<T> leftShift(Set<T> self, T value)

      Overloads the left shift operator to provide an easy way to append objects to a Set.

          def set = [1,2] as Set
           set << 3
           assert set == [1,2,3] as Set

      Parameters:
        `self` - a Set
        `value` - an Object to be added to the Set.
      Returns:
        same Set, after the value was added to it.
      Since:
        2.4.0

    - #### <T> public static SortedSet<T> leftShift(SortedSet<T> self, T value)

      Overloads the left shift operator to provide an easy way to append objects to a SortedSet.

          def set = [1,2] as SortedSet
           set << 3
           assert set == [1,2,3] as SortedSet

      Parameters:
        `self` - a SortedSet
        `value` - an Object to be added to the SortedSet.
      Returns:
        same SortedSet, after the value was added to it.
      Since:
        2.4.0

    - #### <T> public static BlockingQueue<T> leftShift(BlockingQueue<T> self, T value)

      Overloads the left shift operator to provide an easy way to append objects to a BlockingQueue. In case of bounded queue the method will block till space in the queue become available

          def list = new java.util.concurrent.LinkedBlockingQueue ()
           list << 3 << 2 << 1
           assert list.iterator().collect{it} == [3,2,1]

      Parameters:
        `self` - a Collection
        `value` - an Object to be added to the collection.
      Returns:
        same collection, after the value was added to it.
      Since:
        1.7.1

    - #### <K, V> public static Map<K, V> leftShift(Map<K, V> self, Map.Entry<K, V> entry)

      Overloads the left shift operator to provide an easy way to append Map.Entry values to a Map.

      Parameters:
        `self` - a Map
        `entry` - a Map.Entry to be added to the Map.
      Returns:
        same map, after the value has been added to it.
      Since:
        1.6.0

    - #### <K, V> public static Map<K, V> leftShift(Map<K, V> self, Map<K, V> other)

      Overloads the left shift operator to provide an easy way to put one maps entries into another map. This allows the compact syntax `map1 << map2`; otherwise it's just a synonym for `putAll` though it returns the original map rather than being a `void` method. Example usage:

          def map = [a:1, b:2]
           map << [c:3, d:4]
           assert map == [a:1, b:2, c:3, d:4]

      Parameters:
        `self` - a Map
        `other` - another Map whose entries should be added to the original Map.
      Returns:
        same map, after the values have been added to it.
      Since:
        1.7.2

    - #### public static Number leftShift(Number self, Number operand)

      Implementation of the left shift operator for integral types. Non-integral Number types throw UnsupportedOperationException.

      Parameters:
        `self` - a Number object
        `operand` - the shift distance by which to left shift the number
      Returns:
        the resulting number
      Since:
        1.5.0

    - #### public static BitSet leftShift(BitSet self, Number operand)

      Implementation of the left shift operator for BitSets, returning a new BitSet and leaving the original unchanged. The `intValue()` is taken for the shift distance for non-integer operands.

      Parameters:
        `self` - a BitSet
        `operand` - the shift distance by which to shift the BitSet left
      Returns:
        the resulting BitSet
      Since:
        5.0.0

    - #### <T> public static T max(Iterable<T> self)

      Adds max() method to Iterable objects.

           assert 5 == [2,3,1,5,4].max()

      Parameters:
        `self` - an Iterable
      Returns:
        the maximum value
      See Also:
        max(Iterator)
      Since:
        2.2.0

    - #### <T> public static T max(Iterator<T> self)

      Adds max() method to Iterator objects. The iterator will become exhausted of elements after determining the maximum value.

      Parameters:
        `self` - an Iterator
      Returns:
        the maximum value
      Since:
        1.5.5

    - #### <T> public static T max(Iterable<T> self, Comparator<? super T> comparator)

      Selects the maximum value found in the Iterable using the given comparator.

           assert "hello" == ["hello","hi","hey"].max( { a, b -> a.length() <=> b.length() } as Comparator )

      Parameters:
        `self` - an Iterable
        `comparator` - a Comparator
      Returns:
        the maximum value or null for an empty Iterable
      See Also:
        max(Iterator, Comparator)
      Since:
        2.2.0

    - #### <T> public static T max(Iterator<T> self, Comparator<? super T> comparator)

      Selects the maximum value found from the Iterator using the given comparator.

      Parameters:
        `self` - an Iterator
        `comparator` - a Comparator
      Returns:
        the maximum value
      Since:
        1.5.5

    - #### <T> public static T max(Iterable<T> self, @ClosureParams(value=FromString.class, options={"T","T,T"})
      Closure closure)

      Selects the item in the iterable which when passed as a parameter to the supplied closure returns the maximum value. A null return value represents the least possible return value, so any item for which the supplied closure returns null, won't be selected (unless all items return null). If more than one item has the maximum value, an arbitrary choice is made between the items having the maximum value.

      If the closure has two parameters it is used like a traditional Comparator. I.e. it should compare its two parameters for order, returning a negative integer, zero, or a positive integer when the first parameter is less than, equal to, or greater than the second respectively. Otherwise, the Closure is assumed to take a single parameter and return a Comparable (typically an Integer) which is then used for further comparison.

          assert "hello" == ["hello","hi","hey"].max { it.length() }

          assert "hello" == ["hello","hi","hey"].max { a, b -> a.length() <=> b.length() }

           def pets = ['dog', 'elephant', 'anaconda']
           def longestName = pets.max{ it.size() } // one of 'elephant' or 'anaconda'
           assert longestName.size() == 8

      Parameters:
        `self` - an Iterable
        `closure` - a 1 or 2 arg Closure used to determine the correct ordering
      Returns:
        an item from the Iterable having the maximum value returned by calling the supplied closure with that item as parameter or null for an empty Iterable
      Since:
        2.2.0

    - #### <T> public static T max(Iterator<T> self, @ClosureParams(value=FromString.class, options={"T","T,T"})
      Closure closure)

      Selects the maximum value found from the Iterator using the closure to determine the correct ordering. The iterator will become exhausted of elements after this operation.

      If the closure has two parameters it is used like a traditional Comparator. I.e. it should compare its two parameters for order, returning a negative integer, zero, or a positive integer when the first parameter is less than, equal to, or greater than the second respectively. Otherwise, the Closure is assumed to take a single parameter and return a Comparable (typically an Integer) which is then used for further comparison.

      Parameters:
        `self` - an Iterator
        `closure` - a Closure used to determine the correct ordering
      Returns:
        the maximum value
      Since:
        1.5.5

    - #### <K, V> public static Map.Entry<K, V> max(Map<K, V> self, @ClosureParams(value=FromString.class, options={"Map.Entry", "Map.Entry,Map.Entry"})
      Closure closure)

      Selects an entry in the map having the maximum calculated value as determined by the supplied closure. If more than one entry has the maximum value, an arbitrary choice is made between the entries having the maximum value.

      If the closure has two parameters it is used like a traditional Comparator. I.e. it should compare its two parameters for order, returning a negative integer, zero, or a positive integer when the first parameter is less than, equal to, or greater than the second respectively. Otherwise, the Closure is assumed to take a single parameter and return a Comparable (typically an Integer) which is then used for further comparison. An example:

           def zoo = [monkeys:6, lions:5, tigers:7]
           def mostCommonEntry = zoo.max{ it.value }
           assert mostCommonEntry.value == 7
           def leastCommonEntry = zoo.max{ a, b -> b.value <=> a.value } // double negative!
           assert leastCommonEntry.value == 5

      Edge case for multiple max values:

           def zoo = [monkeys:6, lions:5, tigers:7]
           def lengthOfNamePlusNumber = { e -> e.key.size() + e.value }
           def ans = zoo.max(lengthOfNamePlusNumber) // one of [monkeys:6, tigers:7]
           assert lengthOfNamePlusNumber(ans) == 13

      Parameters:
        `self` - a Map
        `closure` - a 1 or 2 arg Closure used to determine the correct ordering
      Returns:
        the Map.Entry having the maximum value as determined by the closure
      Since:
        1.7.6

    - #### @Deprecated(since = "5.0.0")
      public static int max(int[] self)

    - #### @Deprecated(since = "5.0.0")
      public static long max(long[] self)

    - #### @Deprecated(since = "5.0.0")
      public static double max(double[] self)

    - #### <T> @Deprecated(since = "5.0.0")
      public static T max(T[] self)

    - #### <T> @Deprecated(since = "5.0.0")
      public static T max(T[] self, Comparator<? super T> comparator)

    - #### <T> @Deprecated(since = "5.0.0")
      public static T max(T[] self, @ClosureParams(value=FromString.class, options={"T","T,T"})
      Closure closure)

    - #### public static MetaClass metaClass(Class self, @ClosureParams(value=SimpleType.class, options="java.lang.Object")
      @DelegatesTo(type="groovy.lang.ExpandoMetaClass.DefiningClosure", strategy=Closure.DELEGATE_ONLY)
      Closure closure)

      Sets/updates the metaclass for a given class to a closure.

      throws:
        GroovyRuntimeException if the metaclass can't be set for this class
      Parameters:
        `self` - the class whose metaclass we wish to update
        `closure` - the closure representing the new metaclass
      Returns:
        the new metaclass value
      Since:
        1.6.0

    - #### public static MetaClass metaClass(Object self, @ClosureParams(value=SimpleType.class, options="java.lang.Object")
      @DelegatesTo(type="groovy.lang.ExpandoMetaClass.DefiningClosure", strategy=Closure.DELEGATE_ONLY)
      Closure closure)

      Sets/updates the metaclass for a given object to a closure.

      throws:
        GroovyRuntimeException if the metaclass can't be set for this object
      Parameters:
        `self` - the object whose metaclass we wish to update
        `closure` - the closure representing the new metaclass
      Returns:
        the new metaclass value
      Since:
        1.6.0

    - #### <T> public static T min(Iterable<T> self)

      Adds min() method to Collection objects.

          assert 2 == [4,2,5].min()

      Parameters:
        `self` - a Collection
      Returns:
        the minimum value
      See Also:
        min(Iterator)
      Since:
        1.0

    - #### <T> public static T min(Iterator<T> self)

      Adds min() method to Iterator objects. The iterator will become exhausted of elements after determining the minimum value.

      Parameters:
        `self` - an Iterator
      Returns:
        the minimum value
      See Also:
        min(Iterable)
      Since:
        1.5.5

    - #### <T> public static T min(Iterable<T> self, Comparator<? super T> comparator)

      Selects the minimum value found in the Iterable using the given comparator.

          assert "hi" == ["hello","hi","hey"].min( { a, b -> a.length() <=> b.length() } as Comparator )

      Parameters:
        `self` - an Iterable
        `comparator` - a Comparator
      Returns:
        the minimum value or null for an empty Iterable
      See Also:
        min(Iterator, java.util.Comparator)
      Since:
        2.2.0

    - #### <T> public static T min(Iterator<T> self, Comparator<? super T> comparator)

      Selects the minimum value found from the Iterator using the given comparator.

      Parameters:
        `self` - an Iterator
        `comparator` - a Comparator
      Returns:
        the minimum value
      Since:
        1.5.5

    - #### <T> public static T min(Iterable<T> self, @ClosureParams(value=FromString.class, options={"T","T,T"})
      Closure closure)

      Selects the item in the iterable which when passed as a parameter to the supplied closure returns the minimum value. A null return value represents the least possible return value. If more than one item has the minimum value, an arbitrary choice is made between the items having the minimum value.

      If the closure has two parameters it is used like a traditional Comparator. I.e. it should compare its two parameters for order, returning a negative integer, zero, or a positive integer when the first parameter is less than, equal to, or greater than the second respectively. Otherwise, the Closure is assumed to take a single parameter and return a Comparable (typically an Integer) which is then used for further comparison.

           assert "hi" == ["hello","hi","hey"].min { it.length() }

           def lastDigit = { a, b -> a % 10 <=> b % 10 }
           assert [19, 55, 91].min(lastDigit) == 91

           def pets = ['dog', 'cat', 'anaconda']
           def shortestName = pets.min{ it.size() } // one of 'dog' or 'cat'
           assert shortestName.size() == 3

      Parameters:
        `self` - an Iterable
        `closure` - a 1 or 2 arg Closure used to determine the correct ordering
      Returns:
        an item from the Iterable having the minimum value returned by calling the supplied closure with that item as parameter or null for an empty Iterable
      See Also:
        min(Iterator)
      Since:
        1.0

    - #### <T> public static T min(Iterator<T> self, @ClosureParams(value=FromString.class, options={"T","T,T"})
      Closure closure)

      Selects the minimum value found from the Iterator using the closure to determine the correct ordering. The iterator will become exhausted of elements after this operation.

      If the closure has two parameters it is used like a traditional Comparator. I.e. it should compare its two parameters for order, returning a negative integer, zero, or a positive integer when the first parameter is less than, equal to, or greater than the second respectively. Otherwise, the Closure is assumed to take a single parameter and return a Comparable (typically an Integer) which is then used for further comparison.

      Parameters:
        `self` - an Iterator
        `closure` - a Closure used to determine the correct ordering
      Returns:
        the minimum value
      Since:
        1.5.5

    - #### <K, V> public static Map.Entry<K, V> min(Map<K, V> self, @ClosureParams(value=FromString.class, options={"Map.Entry", "Map.Entry,Map.Entry"})
      Closure closure)

      Selects an entry in the map having the minimum calculated value as determined by the supplied closure. If more than one entry has the minimum value, an arbitrary choice is made between the entries having the minimum value.

      If the closure has two parameters it is used like a traditional Comparator. I.e. it should compare its two parameters for order, returning a negative integer, zero, or a positive integer when the first parameter is less than, equal to, or greater than the second respectively. Otherwise, the Closure is assumed to take a single parameter and return a Comparable (typically an Integer) which is then used for further comparison.

           def zoo = [monkeys:6, lions:5, tigers:7]
           def leastCommonEntry = zoo.min{ it.value }
           assert leastCommonEntry.value == 5
           def mostCommonEntry = zoo.min{ a, b -> b.value <=> a.value } // double negative!
           assert mostCommonEntry.value == 7

      Edge case for multiple min values:

           def zoo = [monkeys:6, lions:5, tigers:7]
           def lastCharOfName = { e -> e.key[-1] }
           def ans = zoo.min(lastCharOfName) // some random entry
           assert lastCharOfName(ans) == 's'

      Parameters:
        `self` - a Map
        `closure` - a 1 or 2 arg Closure used to determine the correct ordering
      Returns:
        the Map.Entry having the minimum value as determined by the closure
      Since:
        1.7.6

    - #### @Deprecated(since = "5.0.0")
      public static int min(int[] self)

    - #### @Deprecated(since = "5.0.0")
      public static long min(long[] self)

    - #### @Deprecated(since = "5.0.0")
      public static double min(double[] self)

    - #### <T> @Deprecated(since = "5.0.0")
      public static T min(T[] self)

    - #### <T> @Deprecated(since = "5.0.0")
      public static T min(T[] self, Comparator<? super T> comparator)

    - #### <T> @Deprecated(since = "5.0.0")
      public static T min(T[] self, @ClosureParams(value=FromString.class, options={"T","T,T"})
      Closure closure)

    - #### <T> @SuppressWarnings("unchecked")
      public static Set<T> minus(Set<T> self, Collection<?> removeMe)

      Create a Set composed of the elements of the first Set minus the elements of the given Collection.

      Parameters:
        `self` - a Set object
        `removeMe` - the items to remove from the Set
      Returns:
        the resulting Set
      Since:
        1.5.0

    - #### <T> public static Set<T> minus(Set<T> self, Iterable<?> removeMe)

      Create a Set composed of the elements of the first Set minus the elements from the given Iterable.

      Parameters:
        `self` - a Set object
        `removeMe` - the items to remove from the Set
      Returns:
        the resulting Set
      Since:
        1.8.7

    - #### <T> @SuppressWarnings("unchecked")
      public static Set<T> minus(Set<T> self, Object removeMe)

      Create a Set composed of the elements of the first Set minus the given element.

      Parameters:
        `self` - a Set object
        `removeMe` - the element to remove from the Set
      Returns:
        the resulting Set
      Since:
        1.5.0

    - #### <T> public static SortedSet<T> minus(SortedSet<T> self, Collection<?> removeMe)

      Create a SortedSet composed of the elements of the first SortedSet minus the elements of the given Collection.

      Parameters:
        `self` - a SortedSet object
        `removeMe` - the items to remove from the SortedSet
      Returns:
        the resulting SortedSet
      Since:
        2.4.0

    - #### <T> public static SortedSet<T> minus(SortedSet<T> self, Iterable<?> removeMe)

      Create a SortedSet composed of the elements of the first SortedSet minus the elements of the given Iterable.

      Parameters:
        `self` - a SortedSet object
        `removeMe` - the items to remove from the SortedSet
      Returns:
        the resulting SortedSet
      Since:
        2.4.0

    - #### <T> public static SortedSet<T> minus(SortedSet<T> self, Object removeMe)

      Create a SortedSet composed of the elements of the first SortedSet minus the given element.

      Parameters:
        `self` - a SortedSet object
        `removeMe` - the element to remove from the SortedSet
      Returns:
        the resulting SortedSet
      Since:
        2.4.0

    - #### <T> public static List<T> minus(List<T> self, Collection<?> removeMe)

      Create a List composed of the elements of the given List minus every occurrence of elements of the given Collection.

           def one = [1, "a", true, true, false, 5.3, null], two = [null, true, 5.3]
           def sub = one.asUnmodifiable() - two.asUnmodifiable()
           assert sub == [1, "a", false]

      Parameters:
        `self` - a List
        `removeMe` - a Collection of elements to remove
      Returns:
        a List with the given elements removed
      Since:
        1.0

    - #### <T> public static Collection<T> minus(Collection<T> self, Collection<?> removeMe)

      Create a new Collection composed of the elements of the first Collection minus every occurrence of elements of the given Collection.

          assert [1, "a", true, true, false, 5.3] - [true, 5.3] == [1, "a", false]

      Parameters:
        `self` - a Collection
        `removeMe` - a Collection of elements to remove
      Returns:
        a Collection with the given elements removed
      Since:
        2.4.0

    - #### <T> public static List<T> minus(List<T> self, Iterable<?> removeMe)

      Create a new List composed of the elements of the first List minus every occurrence of elements of the given Iterable.

          assert [1, "a", true, true, false, 5.3] - [true, 5.3] == [1, "a", false]

      Parameters:
        `self` - a List
        `removeMe` - an Iterable of elements to remove
      Returns:
        a new List with the given elements removed
      Since:
        1.8.7

    - #### <T> public static Collection<T> minus(Iterable<T> self, Iterable<?> removeMe)

      Create a new Collection composed of the elements of the first Iterable minus every occurrence of elements of the given Iterable.

           assert [1, "a", true, true, false, 5.3] - [true, 5.3] == [1, "a", false]

      Parameters:
        `self` - an Iterable
        `removeMe` - an Iterable of elements to remove
      Returns:
        a new Collection with the given elements removed
      Since:
        2.4.0

    - #### <T> public static Collection<T> minus(Iterable<T> self, Iterable<?> removeMe, @ClosureParams(value=FromString.class, options={"T","T,T"})
      Closure condition)

      Create a new Collection composed of the elements of the first Iterable minus every matching occurrence as determined by the condition closure of elements of the given Iterable.

           assert ['a', 'B', 'c', 'D', 'E'].minus(['b', 'C', 'D']) { it.toLowerCase() } == ['a', 'E']

      Parameters:
        `self` - an Iterable
        `removeMe` - an Iterable of elements to remove
        `condition` - a Closure used to determine unique items
      Returns:
        a new Collection with the given elements removed
      Since:
        4.0.0

    - #### <T> public static Collection<T> minus(Iterable<T> self, Iterable<?> removeMe, Comparator<? super T> comparator)

      Create a new Collection composed of the elements of the first Iterable minus every matching occurrence as determined by the condition comparator of elements of the given Iterable.

           List<String> one = ['a', 'B', 'c', 'D', 'E'], two = ['b', 'C', 'D']
           def sub = one.minus(two, Comparator.comparing(String::toLowerCase))
           assert sub == ['a', 'E']

      Parameters:
        `self` - an Iterable
        `removeMe` - an Iterable of elements to remove
        `comparator` - a Comparator
      Returns:
        a new Collection with the given elements removed
      Since:
        4.0.0

    - #### <T> public static List<T> minus(List<T> self, Object removeMe)

      Create a new List composed of the elements of the first List minus every occurrence of the given element to remove.

          assert ["a", 5, 5, true] - 5 == ["a", true]

      Parameters:
        `self` - a List object
        `removeMe` - an element to remove from the List
      Returns:
        the resulting List with the given element removed
      Since:
        1.0

    - #### <T> public static Collection<T> minus(Iterable<T> self, Object removeMe)

      Create a new Collection composed of the elements of the first Iterable minus every occurrence of the given element to remove.

          assert ["a", 5, 5, true] - 5 == ["a", true]

      Parameters:
        `self` - an Iterable object
        `removeMe` - an element to remove from the Iterable
      Returns:
        the resulting Collection with the given element removed
      Since:
        2.4.0

    - #### <K, V> public static Map<K, V> minus(Map<K, V> self, Map removeMe)

      Create a Map composed of the entries of the first map minus the entries of the given map.

      Parameters:
        `self` - a map object
        `removeMe` - the entries to remove from the map
      Returns:
        the resulting map
      Since:
        1.7.4

    - #### public static Number minus(Character left, Number right)

      Subtract a Number from a Character. The ordinal value of the Character is used in the subtraction (the ordinal value is the unicode value which for simple character sets is the ASCII value).

      Parameters:
        `left` - a Character
        `right` - a Number
      Returns:
        the Number corresponding to the subtraction of right from left
      Since:
        1.0

    - #### public static Number minus(Number left, Character right)

      Subtract a Character from a Number. The ordinal value of the Character is used in the subtraction (the ordinal value is the unicode value which for simple character sets is the ASCII value).

      Parameters:
        `left` - a Number
        `right` - a Character
      Returns:
        the Number corresponding to the subtraction of right from left
      Since:
        1.0

    - #### public static Number minus(Character left, Character right)

      Subtract one Character from another. The ordinal values of the Characters is used in the comparison (the ordinal value is the unicode value which for simple character sets is the ASCII value).

      Parameters:
        `left` - a Character
        `right` - a Character
      Returns:
        the Number corresponding to the subtraction of right from left
      Since:
        1.0

    - #### <T> @Deprecated(since = "5.0.0")
      public static T[] minus(T[] self, Iterable removeMe)

    - #### <T> @Deprecated(since = "5.0.0")
      public static T[] minus(T[] self, Object[] removeMe)

    - #### <T> @Deprecated(since = "5.0.0")
      public static T[] minus(T[] self, Object removeMe)

    - #### public static void mixin(MetaClass self, List<Class> categoryClasses)

      Extend object with category methods. All methods for given class and all super classes will be added to the object.

      Parameters:
        `self` - any Class
        `categoryClasses` - a category classes to use
      Since:
        1.6.0

    - #### public static void mixin(Class self, List<Class> categoryClasses)

      Extend class globally with category methods. All methods for given class and all super classes will be added to the class.

      Parameters:
        `self` - any Class
        `categoryClasses` - a category classes to use
      Since:
        1.6.0

    - #### public static void mixin(Class self, Class categoryClass)

      Extend class globally with category methods.

      Parameters:
        `self` - any Class
        `categoryClass` - a category class to use
      Since:
        1.6.0

    - #### public static void mixin(Class self, Class[] categoryClass)

      Extend class globally with category methods.

      Parameters:
        `self` - any Class
        `categoryClass` - a category class to use
      Since:
        1.6.0

    - #### public static void mixin(MetaClass self, Class categoryClass)

      Extend class globally with category methods.

      Parameters:
        `self` - any Class
        `categoryClass` - a category class to use
      Since:
        1.6.0

    - #### public static void mixin(MetaClass self, Class[] categoryClass)

      Extend class globally with category methods.

      Parameters:
        `self` - any Class
        `categoryClass` - a category class to use
      Since:
        1.6.0

    - #### public static Number mod(Number left, Number right)

      Performs a division modulus operation.

      Parameters:
        `left` - a Number
        `right` - another Number to mod
      Returns:
        the modulus result
      Since:
        1.0

    - #### <T> public static Collection<T> multiply(Iterable<T> self, Number factor)

      Create a Collection composed of the elements of this Iterable, repeated a certain number of times. Note that for non-primitive elements, multiple references to the same instance will be added.

          assert [1,2,3,1,2,3] == [1,2,3] * 2

      Note: if the Iterable happens to not support duplicates, e.g. a Set, then the method will effectively return a Collection with a single copy of the Iterable's items.
      Parameters:
        `self` - an Iterable
        `factor` - the number of times to append
      Returns:
        the multiplied Collection
      Since:
        2.4.0

    - #### <T> public static List<T> multiply(List<T> self, Number factor)

      Create a List composed of the elements of this Iterable, repeated a certain number of times. Note that for non-primitive elements, multiple references to the same instance will be added.

          assert [1,2,3,1,2,3] == [1,2,3] * 2

      Note: if the Iterable happens to not support duplicates, e.g. a Set, then the method will effectively return a Collection with a single copy of the Iterable's items.
      Parameters:
        `self` - a List
        `factor` - the number of times to append
      Returns:
        the multiplied List
      Since:
        2.4.0

    - #### public static Number multiply(Character left, Number right)

      Multiply a Character by a Number. The ordinal value of the Character is used in the multiplication (the ordinal value is the unicode value which for simple character sets is the ASCII value).

      Parameters:
        `left` - a Character
        `right` - a Number
      Returns:
        the Number corresponding to the multiplication of left by right
      Since:
        1.0

    - #### public static Number multiply(Number left, Character right)

      Multiply a Number by a Character. The ordinal value of the Character is used in the multiplication (the ordinal value is the unicode value which for simple character sets is the ASCII value).

      Parameters:
        `left` - a Number
        `right` - a Character
      Returns:
        the multiplication of left by right
      Since:
        1.0

    - #### public static Number multiply(Character left, Character right)

      Multiply two Characters. The ordinal values of the Characters are used in the multiplication (the ordinal value is the unicode value which for simple character sets is the ASCII value).

      Parameters:
        `left` - a Character
        `right` - another Character
      Returns:
        the Number corresponding to the multiplication of left by right
      Since:
        1.0

    - #### public static Number multiply(BigDecimal left, Double right)

      Multiply a BigDecimal and a Double. Note: This method was added to enforce the Groovy rule of BigDecimal*Double == Double. Without this method, the multiply(BigDecimal) method in BigDecimal would respond and return a BigDecimal instead. Since BigDecimal is preferred over Number, the Number*Number method is not chosen as in older versions of Groovy.

      Parameters:
        `left` - a BigDecimal
        `right` - a Double
      Returns:
        the multiplication of left by right
      Since:
        1.0

    - #### public static Number multiply(BigDecimal left, BigInteger right)

      Multiply a BigDecimal and a BigInteger. Note: This method was added to enforce the Groovy rule of BigDecimal*long == long. Without this method, the multiply(BigDecimal) method in BigDecimal would respond and return a BigDecimal instead. Since BigDecimal is preferred over Number, the Number*Number method is not chosen as in older versions of Groovy. BigInteger is the fallback for all integer types in Groovy

      Parameters:
        `left` - a BigDecimal
        `right` - a BigInteger
      Returns:
        the multiplication of left by right
      Since:
        1.0

    - #### <T> @SuppressWarnings("unchecked")
      public static T newInstance(Class<T> c)

      Convenience method to dynamically create a new instance of this class. Calls the default constructor.

      Parameters:
        `c` - a class
      Returns:
        a new instance of this class
      Since:
        1.0

    - #### <T> @SuppressWarnings("unchecked")
      public static T newInstance(Class<T> c, Object[] args)

      Helper to construct a new instance from the given arguments. The constructor is called based on the number and types in the args array. Use `newInstance(null)` or simply `newInstance()` for the default (no-arg) constructor.

      Parameters:
        `c` - a class
        `args` - the constructor arguments
      Returns:
        a new instance of this class.
      Since:
        1.0

    - #### @Override
      public T next()

    - #### public static Character next(Character self)

      Increment a Character by one.

      Parameters:
        `self` - a Character
      Returns:
        an incremented Character
      Since:
        1.5.7

    - #### public static Number next(Number self)

      Increment a Number by one.

      Parameters:
        `self` - a Number
      Returns:
        an incremented Number
      Since:
        1.0

    - #### public static int numberAwareCompareTo(Comparable self, Comparable other)

      Provides a method that compares two comparables using Groovy's default number aware comparator.

      Parameters:
        `self` - a Comparable
        `other` - another Comparable
      Returns:
        a -ve number, 0 or a +ve number according to Groovy's compareTo contract
      Since:
        1.6.0

    - #### public static Number or(Number left, Number right)

      Bitwise OR together two numbers.

      Parameters:
        `left` - a Number
        `right` - another Number to bitwise OR
      Returns:
        the bitwise OR of both Numbers
      Since:
        1.0

    - #### public static BitSet or(BitSet left, BitSet right)

      Bitwise OR together two BitSets. Called when the '|' operator is used between two bit sets.

      Parameters:
        `left` - a BitSet
        `right` - another BitSet to bitwise OR
      Returns:
        the bitwise OR of both BitSets
      Since:
        1.5.0

    - #### public static Boolean or(Boolean left, Boolean right)

      Logical disjunction of two boolean operators

      Parameters:
        `left` - left operator
        `right` - right operator
      Returns:
        result of logical disjunction
      Since:
        1.0

    - #### <T> public static Set<T> or(Set<T> left, Iterable<T> right)

      Create a Set as a union of a Set and an Iterable. Any elements that exist in either are added to the resultant Set.

      This operation will always create a new object for the result, while the operands remain unchanged.

           def a = [1,2,3,4] as Set
           def b = [3,4,5,6] as Set
           assert (a | b) == [1,2,3,4,5,6] as Set

      Parameters:
        `left` - the left Set
        `right` - the right Iterable
      Returns:
        the merged Set
      Since:
        5.0.0
      See Also:
        plus(Set, Iterable)

    - #### <T> public static SortedSet<T> or(SortedSet<T> left, Iterable<T> right)

      Create a SortedSet as a union of a SortedSet and an Iterable. Any elements that exist in either are added to the resultant SortedSet.

      This operation will always create a new object for the result, while the operands remain unchanged.

           def a = [1,2,3,4] as SortedSet
           def b = [3,4,5,6] as Set
           assert (a | b) == [1,2,3,4,5,6] as SortedSet

      Parameters:
        `left` - the left SortedSet
        `right` - the right Iterable
      Returns:
        the merged SortedSet
      Since:
        5.0.0
      See Also:
        plus(SortedSet, Iterable)

    - #### <T> public static int partitionPoint(List<T> self, IntRange range, Predicate<T> condition)

      Returns the index of the partition point according to the given predicate (the index of the first element of the second partition). The list is assumed to be partitioned according to the given predicate.

           def list = [7, 15, 3, 5, 4, 12, 6]
           assert list.partitionPoint(0..<list.size()) { it%2 != 0 } == 4

           def list = [1, 2, 3, 3, 4, 4, 5, 6, 7]
           // usage case as lower_bound(cpp), bisect_left(python)
           assert list.partitionPoint(0..<list.size()) { it < 4 } == 4
           // usage case as upper_bound(cpp), bisect_right(python)
           assert list.partitionPoint(0..<list.size()) { it <= 4 } == 6
           // for all match condition
           assert list.partitionPoint(0..<list.size()) { it <= 20 } == list.size()
           // for no match condition
           assert list.partitionPoint(0..<list.size()) { it <= 0 } == 0
           // for all match condition with range
           assert list.partitionPoint(0..<4) { it <= 20 } == 4
           // for no match condition with range
           assert list.partitionPoint(2..<list.size()) { it <= 0 } == 2

      Parameters:
        `self` - a groovy list
        `range` - the range [l,r] to find data match the condition
        `condition` - the matching condition
      Returns:
        an integer that is the index of the first element of the second partition
      Since:
        5.0.0

    - #### <T> public static int partitionPoint(List<T> self, Predicate<T> condition)

      Returns the index of the partition point according to the given predicate (the index of the first element of the second partition). The list is assumed to be partitioned according to the given predicate.

           def list = [7, 15, 3, 5, 4, 12, 6] // partitioned into odds then evens
           assert list.partitionPoint{ it%2 != 0 } == 4

           def list = [1, 2, 3, 3, 4, 4, 5, 6, 7]
           // usage case as lower_bound(cpp), bisect_left(python)
           assert list.partitionPoint{ it < 4 } == 4
           // usage case as upper_bound(cpp), bisect_right(python)
           assert list.partitionPoint{ it <= 4 } == 6
           // for all match condition
           assert list.partitionPoint{ it <= 100 } == list.size()
           // for no match condition
           assert list.partitionPoint{ it <= 0 } == 0
           // predicate of reverse logic examples:
           assert [7, 6, 5, 4, 4, 3, 3, 2, 1].partitionPoint{ it > 4 } == 3
           assert [7, 6, 5, 4, 4, 3, 3, 2, 1].partitionPoint{ it >= 4 } == 5

      Parameters:
        `self` - a groovy list
        `condition` - the matching condition
      Returns:
        an integer that is the index of the first element of the second partition
      Since:
        5.0.0

    - #### <T> public static Set<List<T>> permutations(Iterable<T> self)

      Finds all permutations of an iterable.

      Example usage:

          def result = [1, 2, 3].permutations()
           assert result == [[3, 2, 1], [3, 1, 2], [1, 3, 2], [2, 3, 1], [2, 1, 3], [1, 2, 3]] as Set

      Parameters:
        `self` - the Iterable of items
      Returns:
        the permutations from the list
      Since:
        1.7.0

    - #### <T, V> public static List<V> permutations(Iterable<T> self, Closure<V> function)

      Finds all permutations of an iterable, applies a function to each permutation and collects the result into a list.

      Example usage:

          Set result = [1, 2, 3].permutations { it.collect { v -> 2*v }}
           assert result == [[6, 4, 2], [6, 2, 4], [2, 6, 4], [4, 6, 2], [4, 2, 6], [2, 4, 6]] as Set

      Parameters:
        `self` - the Iterable of items
        `function` - the function to apply on each permutation
      Returns:
        the list of results of the application of the function on each permutation
      Since:
        2.2.0

    - #### <T> public static Collection<T> plus(Collection<T> left, Collection<T> right)

      Create a Collection as a union of two collections. If the left collection is a Set, then the returned collection will be a Set otherwise a List. This operation will always create a new object for the result, while the operands remain unchanged.

          assert [1,2,3,4] == [1,2] + [3,4]

      Parameters:
        `left` - the left Collection
        `right` - the right Collection
      Returns:
        the merged Collection
      Since:
        1.5.0

    - #### <T> public static Collection<T> plus(Iterable<T> left, Iterable<T> right)

      Create a Collection as a union of two iterables. If the left iterable is a Set, then the returned collection will be a Set otherwise a List. This operation will always create a new object for the result, while the operands remain unchanged.

          assert [1,2,3,4] == [1,2] + [3,4]

      Parameters:
        `left` - the left Iterable
        `right` - the right Iterable
      Returns:
        the merged Collection
      Since:
        2.4.0

    - #### <T> public static Collection<T> plus(Collection<T> left, Iterable<T> right)

      Create a Collection as a union of a Collection and an Iterable. If the left collection is a Set, then the returned collection will be a Set otherwise a List. This operation will always create a new object for the result, while the operands remain unchanged.

      Parameters:
        `left` - the left Collection
        `right` - the right Iterable
      Returns:
        the merged Collection
      Since:
        1.8.7
      See Also:
        plus(Collection, Collection)

    - #### <T> public static List<T> plus(List<T> left, Iterable<T> right)

      Create a List as a union of a List and an Iterable. This operation will always create a new object for the result, while the operands remain unchanged.

      Parameters:
        `left` - the left List
        `right` - the right Iterable
      Returns:
        the merged List
      Since:
        2.4.0
      See Also:
        plus(Collection, Collection)

    - #### <T> public static List<T> plus(List<T> left, Collection<T> right)

      Create a List as a union of a List and a Collection. This operation will always create a new object for the result, while the operands remain unchanged.

      Parameters:
        `left` - the left List
        `right` - the right Collection
      Returns:
        the merged List
      Since:
        2.4.0
      See Also:
        plus(Collection, Collection)

    - #### <T> public static Set<T> plus(Set<T> left, Iterable<T> right)

      Create a Set as a union of a Set and an Iterable. This operation will always create a new object for the result, while the operands remain unchanged.

      Parameters:
        `left` - the left Set
        `right` - the right Iterable
      Returns:
        the merged Set
      Since:
        2.4.0
      See Also:
        plus(Collection, Collection)

    - #### <T> public static Set<T> plus(Set<T> left, Collection<T> right)

      Create a Set as a union of a Set and a Collection. This operation will always create a new object for the result, while the operands remain unchanged.

      Parameters:
        `left` - the left Set
        `right` - the right Collection
      Returns:
        the merged Set
      Since:
        2.4.0
      See Also:
        plus(Collection, Collection)

    - #### <T> public static SortedSet<T> plus(SortedSet<T> left, Iterable<T> right)

      Create a SortedSet as a union of a SortedSet and an Iterable. This operation will always create a new object for the result, while the operands remain unchanged.

      Parameters:
        `left` - the left SortedSet
        `right` - the right Iterable
      Returns:
        the merged SortedSet
      Since:
        2.4.0
      See Also:
        plus(Collection, Collection)

    - #### <T> public static SortedSet<T> plus(SortedSet<T> left, Collection<T> right)

      Create a SortedSet as a union of a SortedSet and a Collection. This operation will always create a new object for the result, while the operands remain unchanged.

      Parameters:
        `left` - the left SortedSet
        `right` - the right Collection
      Returns:
        the merged SortedSet
      Since:
        2.4.0
      See Also:
        plus(Collection, Collection)

    - #### <T> public static List<T> plus(List<T> self, int index, T[] items)

      Creates a new List by inserting all the elements in the specified array to the elements from the original List at the specified index. Shifts the element currently at that index (if any) and any subsequent elements to the right (increasing their indices). The new elements will appear in the resulting List in the order that they occur in the original array. The behavior of this operation is undefined if the list or array operands are modified while the operation is in progress. The original list and array operands remain unchanged.

           def items = [1, 2, 3]
           def newItems = items.plus(2, 'a'..'c' as String[])
           assert newItems == [1, 2, 'a', 'b', 'c', 3]
           assert items == [1, 2, 3]

      See also `addAll` for similar functionality with modify semantics, i.e. which performs the changes on the original list itself.
      Parameters:
        `self` - an original list
        `items` - array containing elements to be merged with elements from the original list
        `index` - index at which to insert the first element from the specified array
      Returns:
        the new list
      See Also:
        plus(List, int, List)
      Since:
        1.8.1

    - #### <T> public static List<T> plus(List<T> self, int index, List<T> additions)

      Creates a new List by inserting all the elements in the given additions List to the elements from the original List at the specified index. Shifts the element currently at that index (if any) and any subsequent elements to the right (increasing their indices). The new elements will appear in the resulting List in the order that they occur in the original lists. The behavior of this operation is undefined if the original lists are modified while the operation is in progress. The original lists remain unchanged.

           def items = [1, 2, 3]
           def newItems = items.plus(2, 'a'..'c')
           assert newItems == [1, 2, 'a', 'b', 'c', 3]
           assert items == [1, 2, 3]

      See also `addAll` for similar functionality with modify semantics, i.e. which performs the changes on the original list itself.
      Parameters:
        `self` - an original List
        `additions` - a List containing elements to be merged with elements from the original List
        `index` - index at which to insert the first element from the given additions List
      Returns:
        the new list
      Since:
        1.8.1

    - #### <T> public static List<T> plus(List<T> self, int index, Iterable<T> additions)

      Creates a new List by inserting all the elements in the given Iterable to the elements from this List at the specified index.

      Parameters:
        `self` - an original list
        `additions` - an Iterable containing elements to be merged with the elements from the original List
        `index` - index at which to insert the first element from the given additions Iterable
      Returns:
        the new list
      Since:
        1.8.7
      See Also:
        plus(List, int, List)

    - #### <T> public static Collection<T> plus(Collection<T> left, T right)

      Create a collection as a union of a Collection and an Object. If the collection is a Set, then the returned collection will be a Set otherwise a List. This operation will always create a new object for the result, while the operands remain unchanged.

          assert [1,2,3] == [1,2] + 3

      Parameters:
        `left` - a Collection
        `right` - an object to add/append
      Returns:
        the resulting Collection
      Since:
        1.5.0

    - #### <T> public static Collection<T> plus(Iterable<T> left, T right)

      Create a collection as a union of an Iterable and an Object. If the iterable is a Set, then the returned collection will be a Set otherwise a List. This operation will always create a new object for the result, while the operands remain unchanged.

          assert [1,2,3] == [1,2] + 3

      Parameters:
        `left` - an Iterable
        `right` - an object to add/append
      Returns:
        the resulting Collection
      Since:
        2.4.0

    - #### <T> public static List<T> plus(List<T> left, T right)

      Create a List as a union of a List and an Object. This operation will always create a new object for the result, while the operands remain unchanged.

          assert [1,2,3] == [1,2] + 3

      Parameters:
        `left` - a List
        `right` - an object to add/append
      Returns:
        the resulting List
      Since:
        2.4.0

    - #### <T> public static Set<T> plus(Set<T> left, T right)

      Create a Set as a union of a Set and an Object. This operation will always create a new object for the result, while the operands remain unchanged.

          assert [1,2,3] == [1,2] + 3

      Parameters:
        `left` - a Set
        `right` - an object to add/append
      Returns:
        the resulting Set
      Since:
        2.4.0

    - #### <T> public static SortedSet<T> plus(SortedSet<T> left, T right)

      Create a SortedSet as a union of a SortedSet and an Object. This operation will always create a new object for the result, while the operands remain unchanged.

          assert [1,2,3] == [1,2] + 3

      Parameters:
        `left` - a SortedSet
        `right` - an object to add/append
      Returns:
        the resulting SortedSet
      Since:
        2.4.0

    - #### <K, V> public static Map<K, V> plus(Map<K, V> left, Map<K, V> right)

      Returns a new `Map` containing all entries from `left` and `right`, giving precedence to `right`. Any keys appearing in both Maps will appear in the resultant map with values from the `right` operand. If the `left` map is one of TreeMap, LinkedHashMap, Hashtable or Properties, the returned Map will preserve that type, otherwise a HashMap will be returned.

      Roughly equivalent to `Map m = new HashMap(); m.putAll(left); m.putAll(right); return m;` but with some additional logic to preserve the `left` Map type for common cases as described above.

           assert [a:10, b:20] + [a:5, c:7] == [a:5, b:20, c:7]

      Parameters:
        `left` - a Map
        `right` - a Map
      Returns:
        a new Map containing all entries from left and right
      Since:
        1.5.0

    - #### <K, V> public static Map<K, V> plus(Map<K, V> self, Collection<? extends Map.Entry<? extends K, ? extends V>> entries)

      Returns a new `Map` containing all entries from `self` and `entries`, giving precedence to `entries`. Any keys appearing in both Maps will appear in the resultant map with values from the `entries` operand. If `self` map is one of TreeMap, LinkedHashMap, Hashtable or Properties, the returned Map will preserve that type, otherwise a HashMap will be returned.

      Parameters:
        `self` - a Map
        `entries` - a Collection of Map.Entry items to be added to the Map.
      Returns:
        a new Map containing all key, value pairs from self and entries
      Since:
        1.6.1

    - #### public static Number plus(Character left, Number right)

      Add a Character and a Number. The ordinal value of the Character is used in the addition (the ordinal value is the unicode value which for simple character sets is the ASCII value). This operation will always create a new object for the result, while the operands remain unchanged.

      See Also:
        Integer.valueOf
      Parameters:
        `left` - a Character
        `right` - a Number
      Returns:
        the Number corresponding to the addition of left and right
      Since:
        1.0

    - #### public static Number plus(Number left, Character right)

      Add a Number and a Character. The ordinal value of the Character is used in the addition (the ordinal value is the unicode value which for simple character sets is the ASCII value).

      See Also:
        Integer.valueOf
      Parameters:
        `left` - a Number
        `right` - a Character
      Returns:
        The Number corresponding to the addition of left and right
      Since:
        1.0

    - #### public static Number plus(Character left, Character right)

      Add one Character to another. The ordinal values of the Characters are used in the addition (the ordinal value is the unicode value which for simple character sets is the ASCII value). This operation will always create a new object for the result, while the operands remain unchanged.

      See Also:
        plus(java.lang.Number, java.lang.Character)
      Parameters:
        `left` - a Character
        `right` - a Character
      Returns:
        the Number corresponding to the addition of left and right
      Since:
        1.0

    - #### public static String plus(Map left, String right)

      Appends a String to the literal of the Map instance.

           assert '[a:1] is a map' == [a:1] + ' is a map'

      Parameters:
        `left` - a Map
        `right` - a String
      Returns:
        the concatenated string
      Since:
        4.0.3

    - #### public static String plus(Map left, GString right)

      Appends a GString to the literal of the Map instance.

           assert '[a:1] is a map' == [a:1] + " is ${'a'} map"

      Parameters:
        `left` - a Map
        `right` - a GString
      Returns:
        the concatenated string
      Since:
        4.0.3

    - #### <T> public static Iterator<T> plus(Iterator<T> left, Iterator<T> right)

      Appends two iterators.

           assert [1, 2].iterator().plus([3, 4].iterator()).toList() == 1..4

      Parameters:
        `left` - an Iterator
        `right` - an Iterator
      Returns:
        an iterator of all the items from the first then second iterator
      Since:
        5.0.0

    - #### <T> @Deprecated(since = "5.0.0")
      public static T[] plus(T[] left, Collection<?> right)

    - #### <T> @Deprecated(since = "5.0.0")
      public static T[] plus(T[] left, Iterable<?> right)

    - #### <T> @Deprecated(since = "5.0.0")
      public static T[] plus(T[] left, Object[] right)

    - #### <T> @Deprecated(since = "5.0.0")
      public static T[] plus(T[] left, Object right)

    - #### <T> public static T pop(List<T> self)

      Removes the initial item from the List.

           def list = ["a", false, 2]
           assert list.pop() == 'a'
           assert list == [false, 2]

      This is similar to pop on a Stack where the first item in the list represents the top of the stack. Note: The behavior of this method changed in Groovy 2.5 to align with Java. If you need the old behavior use 'removeLast'.
      throws:
        NoSuchElementException if the list is empty
      Parameters:
        `self` - a List
      Returns:
        the item removed from the List
      Since:
        1.0

    - #### public static Number power(Number self, Number exponent)

      Power of a Number to a certain exponent. Called by the '**' operator.

      Parameters:
        `self` - a Number
        `exponent` - a Number exponent
      Returns:
        a Number to the power of a certain exponent
      Since:
        1.0

    - #### public static Number power(BigDecimal self, Integer exponent)

      Power of a BigDecimal to an integer certain exponent. If the exponent is positive, call the BigDecimal.pow(int) method to maintain precision. Called by the '**' operator.

      Parameters:
        `self` - a BigDecimal
        `exponent` - an Integer exponent
      Returns:
        a Number to the power of the exponent

    - #### public static Number power(BigInteger self, Integer exponent)

      Power of a BigInteger to an integer certain exponent. If the exponent is positive, call the BigInteger.pow(int) method to maintain precision. Called by the '**' operator.

      Parameters:
        `self` - a BigInteger
        `exponent` - an Integer exponent
      Returns:
        a Number to the power of the exponent

    - #### public static Number power(Integer self, Integer exponent)

      Power of an integer to an integer certain exponent. If the exponent is positive, convert to a BigInteger and call BigInteger.pow(int) method to maintain precision. Called by the '**' operator.

      Parameters:
        `self` - an Integer
        `exponent` - an Integer exponent
      Returns:
        a Number to the power of the exponent

    - #### public static Number power(Long self, Integer exponent)

      Power of a long to an integer certain exponent. If the exponent is positive, convert to a BigInteger and call BigInteger.pow(int) method to maintain precision. Called by the '**' operator.

      Parameters:
        `self` - a Long
        `exponent` - an Integer exponent
      Returns:
        a Number to the power of the exponent

    - #### public static BigInteger power(BigInteger self, BigInteger exponent)

      Power of a BigInteger to a BigInteger certain exponent. Called by the '**' operator.

      Parameters:
        `self` - a BigInteger
        `exponent` - a BigInteger exponent
      Returns:
        a BigInteger to the power of the exponent
      Since:
        2.3.8

    - #### public static Character previous(Character self)

      Decrement a Character by one.

      Parameters:
        `self` - a Character
      Returns:
        a decremented Character
      Since:
        1.5.7

    - #### public static Number previous(Number self)

      Decrement a Number by one.

      Parameters:
        `self` - a Number
      Returns:
        a decremented Number
      Since:
        1.0

    - #### @Deprecated(since = "5.0.0")
      protected static Object primitiveArrayGet(Object self, int idx)

      Implements the getAt(int) method for primitive type arrays.

      Parameters:
        `self` - an array object
        `idx` - the index of interest
      Returns:
        the returned value from the array
      Since:
        1.5.0

    - #### @Deprecated(since = "5.0.0")
      protected static List primitiveArrayGet(Object self, Range range)

      Implements the getAt(Range) method for primitive type arrays.

      Parameters:
        `self` - an array object
        `range` - the range of indices of interest
      Returns:
        the returned values from the array corresponding to the range
      Since:
        1.5.0

    - #### @Deprecated(since = "5.0.0")
      protected static List primitiveArrayGet(Object self, Collection indices)

      Implements the getAt(Collection) method for primitive type arrays. Each value in the collection argument is assumed to be a valid array index. The value at each index is then added to a list which is returned.

      Parameters:
        `self` - an array object
        `indices` - the indices of interest
      Returns:
        the returned values from the array
      Since:
        1.0

    - #### @Deprecated(since = "5.0.0")
      protected static Object primitiveArrayPut(Object self, int idx, Object newValue)

      Implements the putAt(int) method for primitive type arrays.

      Parameters:
        `self` - an object
        `idx` - the index of interest
        `newValue` - the new value to be put into the index of interest
      Returns:
        the added value
      Since:
        1.5.0

    - #### public static void print(Object self, Object value)

      Print a value formatted Groovy style to self if it is a Writer, otherwise to the standard output stream.

      Parameters:
        `self` - any Object
        `value` - the value to print
      Since:
        1.0

    - #### public static void print(PrintWriter self, Object value)

      Print a value formatted Groovy style to the print writer.

      Parameters:
        `self` - a PrintWriter
        `value` - the value to print
      Since:
        1.0

    - #### public static void print(PrintStream self, Object value)

      Print a value formatted Groovy style to the print stream.

      Parameters:
        `self` - a PrintStream
        `value` - the value to print
      Since:
        1.6.0

    - #### public static void print(Object self, PrintWriter out)

      Print to a console in interactive format.

      Parameters:
        `self` - any Object
        `out` - the PrintWriter used for printing
      Since:
        1.0

    - #### public static void print(Closure self, Object value)

      Print a value to the standard output stream. This method delegates to the owner to execute the method.

      Parameters:
        `self` - a generated closure
        `value` - the value to print
      Since:
        1.0

    - #### public static void printf(Object self, String format, Object[] values)

      Printf to the standard output stream.

      Parameters:
        `self` - any Object
        `format` - a format string
        `values` - values referenced by the format specifiers in the format string
      Since:
        1.0

    - #### public static void printf(Closure self, String format, Object[] values)

      Printf 0 or more values to the standard output stream using a format string. This method delegates to the owner to execute the method.

      Parameters:
        `self` - a generated closure
        `format` - a format string
        `values` - values referenced by the format specifiers in the format string
      Since:
        3.0.0

    - #### public static void printf(Closure self, String format, Object value)

      Printf a value to the standard output stream using a format string. This method delegates to the owner to execute the method.

      Parameters:
        `self` - a generated closure
        `format` - a format string
        `value` - value referenced by the format specifier in the format string
      Since:
        3.0.0

    - #### public static void printf(Object self, String format, Object arg)

      Prints a formatted string using the specified format string and arguments.

      Examples:

               printf ( "Hello, %s!\n" , [ "world" ] as String[] )
               printf ( "Hello, %s!\n" , [ "Groovy" ])
               printf ( "%d + %d = %d\n" , [ 1 , 2 , 1+2 ] as Integer[] )
               printf ( "%d + %d = %d\n" , [ 3 , 3 , 3+3 ])

               ( 1..5 ).each { printf ( "-- %d\n" , [ it ] as Integer[] ) }
               ( 1..5 ).each { printf ( "-- %d\n" , [ it ] as int[] ) }
               ( 0x41..0x45 ).each { printf ( "-- %c\n" , [ it ] as char[] ) }
               ( 07..011 ).each { printf ( "-- %d\n" , [ it ] as byte[] ) }
               ( 7..11 ).each { printf ( "-- %d\n" , [ it ] as short[] ) }
               ( 7..11 ).each { printf ( "-- %d\n" , [ it ] as long[] ) }
               ( 7..11 ).each { printf ( "-- %5.2f\n" , [ it ] as float[] ) }
               ( 7..11 ).each { printf ( "-- %5.2g\n" , [ it ] as double[] ) }

      Parameters:
        `self` - any Object
        `format` - A format string
        `arg` - Argument which is referenced by the format specifiers in the format string. The type of `arg` should be one of Object[], List, int[], short[], byte[], char[], boolean[], long[], float[], or double[].
      Since:
        1.0

    - #### public static void println(Object self)

      Print a linebreak to the standard output stream.

      Parameters:
        `self` - any Object
      Since:
        1.0

    - #### public static void println(Closure self)

      Print a linebreak to the standard output stream. This method delegates to the owner to execute the method.

      Parameters:
        `self` - a closure
      Since:
        1.0

    - #### public static void println(Object self, Object value)

      Print a value formatted Groovy style (followed by a newline) to self if it is a Writer, otherwise to the standard output stream.

      Parameters:
        `self` - any Object
        `value` - the value to print
      Since:
        1.0

    - #### public static void println(PrintWriter self, Object value)

      Print a value formatted Groovy style (followed by a newline) to the print writer.

      Parameters:
        `self` - a PrintWriter
        `value` - the value to print
      Since:
        1.0

    - #### public static void println(PrintStream self, Object value)

      Print a value formatted Groovy style (followed by a newline) to the print stream.

      Parameters:
        `self` - any Object
        `value` - the value to print
      Since:
        1.6.0

    - #### public static void println(Closure self, Object value)

      Print a value (followed by a newline) to the standard output stream. This method delegates to the owner to execute the method.

      Parameters:
        `self` - a closure
        `value` - the value to print
      Since:
        1.0

    - #### public static void println(Object self, PrintWriter out)

      Print to a console in interactive format.

      Parameters:
        `self` - any Object
        `out` - the PrintWriter used for printing
      Since:
        1.0

    - #### <T> public static boolean push(List<T> self, T value)

      Prepends an item to the start of the List.

           def list = [3, 4, 2]
           list.push("x")
           assert list == ['x', 3, 4, 2]

      This is similar to push on a Stack where the first item in the list represents the top of the stack. Note: The behavior of this method changed in Groovy 2.5 to align with Java. If you need the old behavior use 'add'.
      Parameters:
        `self` - a List
        `value` - element to be prepended to this list.
      Returns:
        `true` (for legacy compatibility reasons).
      Since:
        1.5.5

    - #### <K, V> public static Map<K, V> putAll(Map<K, V> self, Collection<? extends Map.Entry<? extends K, ? extends V>> entries)

      Provides an easy way to append multiple Map.Entry values to a Map.

      Parameters:
        `self` - a Map
        `entries` - a Collection of Map.Entry items to be added to the Map.
      Returns:
        the same map, after the items have been added to it.
      Since:
        1.6.1

    - #### public static void putAt(Object self, String property, Object newValue)

      Allows the subscript operator to be used to set dynamically named property values. `bean[somePropertyNameExpression] = foo`. The normal property notation of groovy is neater and more concise but only works with property names which are known at compile time.

      Parameters:
        `self` - the object to act upon
        `property` - the name of the property to set
        `newValue` - the value to set
      Since:
        1.0

    - #### <T> public static void putAt(List<T> self, int idx, T value)

      A helper method to allow lists to work with subscript operators.

          def list = [2, 3]
           list[0] = 1
           assert list == [1, 3]

      Parameters:
        `self` - a List
        `idx` - an index
        `value` - the value to put at the given index
      Since:
        1.0

    - #### <T> public static void putAt(List<T> self, Number idx, T value)

      Support subscript operator for list modification.

    - #### @SuppressWarnings("unchecked")
      public static void putAt(List self, EmptyRange range, Object value)

      A helper method to allow lists to work with subscript operators.

           def list = ["a", true]
           list[1..<1] = 5
           assert list == ["a", 5, true]

      Parameters:
        `self` - a List
        `range` - the (in this case empty) subset of the list to set
        `value` - the values to put at the given sublist or a Collection of values
      Since:
        1.0

    - #### public static void putAt(List self, EmptyRange range, Collection value)

      A helper method to allow lists to work with subscript operators.

           def list = ["a", true]
           list[1..<1] = [4, 3, 2]
           assert list == ["a", 4, 3, 2, true]

      Parameters:
        `self` - a List
        `range` - the (in this case empty) subset of the list to set
        `value` - the Collection of values
      Since:
        1.0
      See Also:
        putAt(java.util.List, groovy.lang.EmptyRange, java.lang.Object)

    - #### @SuppressWarnings("unchecked")
      public static void putAt(List self, IntRange range, Collection col)

      List subscript assignment operator when given a range as the index and the assignment operand is a collection. Example:

          def myList = [4, 3, 5, 1, 2, 8, 10]
           myList[3..5] = ["a", true]
           assert myList == [4, 3, 5, "a", true, 10]

      Items in the given range are replaced with items from the collection.
      Parameters:
        `self` - a List
        `range` - the subset of the list to set
        `col` - the collection of values to put at the given sublist
      Since:
        1.5.0

    - #### @SuppressWarnings("unchecked")
      public static void putAt(List self, IntRange range, Object value)

      List subscript assignment operator when given a range as the index. Example:

          def myList = [4, 3, 5, 1, 2, 8, 10]
           myList[3..5] = "b"
           assert myList == [4, 3, 5, "b", 10]

      Items in the given range are replaced with the operand. The `value` operand is always treated as a single value.
      Parameters:
        `self` - a List
        `range` - the subset of the list to set
        `value` - the value to put at the given sublist
      Since:
        1.0

    - #### @SuppressWarnings("unchecked")
      public static void putAt(List self, List splice, Collection values)

      A helper method to allow lists to work with subscript operators.

          def list = ["a", true, 42, 9.4]
           list[1, 4] = ["x", false]
           assert list == ["a", "x", 42, 9.4, false]

      Parameters:
        `self` - a List
        `splice` - the subset of the list to set
        `values` - the value to put at the given sublist
      Since:
        1.0

    - #### @SuppressWarnings("unchecked")
      public static void putAt(List self, List splice, Object value)

      A helper method to allow lists to work with subscript operators.

          def list = ["a", true, 42, 9.4]
           list[1, 3] = 5
           assert list == ["a", 5, 42, 5]

      Parameters:
        `self` - a List
        `splice` - the subset of the list to set
        `value` - the value to put at the given sublist
      Since:
        1.0

    - #### <K, V> public static V putAt(Map<K, V> self, K key, V value)

      A helper method to allow maps to work with subscript operators

      Parameters:
        `self` - a Map
        `key` - an Object as a key for the map
        `value` - the value to put into the map
      Returns:
        the value corresponding to the given key
      Since:
        1.0

    - #### public static void putAt(BitSet self, IntRange range, boolean value)

      Support assigning a range of values with a single assignment statement.

      Parameters:
        `self` - a BitSet
        `range` - the range of values to set
        `value` - value
      See Also:
        BitSet
        Range
      Since:
        1.5.0

    - #### public static void putAt(BitSet self, int index, boolean value)

      Support subscript-style assignment for a BitSet.

      Parameters:
        `self` - a BitSet
        `index` - index of the entry to set
        `value` - value
      See Also:
        BitSet
      Since:
        1.5.0

    - #### @Deprecated(since = "2.4.0")
      public static void putAt(List self, List splice, List values)

    - #### public static Number remainder(Number left, Number right)

      Performs a division modulus operation. Called by the '%' operator.

      Parameters:
        `left` - a Number
        `right` - another Number to find the remainder
      Returns:
        the remainder result
      Since:
        5.0.0

    - #### @Override
      public void remove()

    - #### @SuppressWarnings("unchecked")
      public static boolean removeAll(Collection self, Object[] items)

      Modifies this collection by removing its elements that are contained within the specified object array. See also `findAll` and `grep` when wanting to produce a new list containing items which don't match some criteria while leaving the original collection unchanged.

      Parameters:
        `self` - a Collection to be modified
        `items` - array containing elements to be removed from this collection
      Returns:
        `true` if this collection changed as a result of the call
      See Also:
        Collection.removeAll
      Since:
        1.7.2

    - #### <T> public static boolean removeAll(Collection<T> self, @ClosureParams(FirstParam.FirstGenericType.class)
      Closure condition)

      Modifies this collection by removing the elements that are matched according to the specified closure condition.

          def list = ['a', 'b']
           list.removeAll { it == 'b' }
           assert list == ['a']

      See also `findAll` and `grep` when wanting to produce a new list containing items which match some criteria but leaving the original collection unchanged.
      Parameters:
        `self` - a Collection to be modified
        `condition` - a closure condition
      Returns:
        `true` if this collection changed as a result of the call
      See Also:
        Iterator.remove
      Since:
        1.7.2

    - #### <K, V> public static boolean removeAll(Map<K, V> self, @ClosureParams(MapEntryOrKeyValue.class)
      Closure condition)

      Modifies this map by removing the elements that are matched according to the specified closure condition. If the closure takes one parameter then it will be passed the `Map.Entry`. Otherwise the closure should take two parameters, which will be the key and the value.

          def map = [a:1, b:2]
           map.removeAll { k,v -> k == 'b' }
           assert map == [a:1]

      See also `findAll` when wanting to produce a new map containing items which match some criteria but leaving the original map unchanged.
      Parameters:
        `self` - a Map to be modified
        `condition` - a 1 or 2 arg Closure condition applying on the entries
      Returns:
        `true` if this map changed as a result of the call
      Since:
        2.5.0

    - #### <E> public static E removeAt(List<E> self, int index)

      Modifies this list by removing the element at the specified position in this list. Returns the removed element. Essentially an alias for List.remove but with no ambiguity for List<Integer>.

      Example:

           def list = [1, 2, 3]
           list.removeAt(1)
           assert [1, 3] == list

      Parameters:
        `self` - a List
        `index` - the index of the element to be removed
      Returns:
        the element previously at the specified position
      Since:
        2.4.0

    - #### <E> public static boolean removeElement(Collection<E> self, Object o)

      Modifies this collection by removing a single instance of the specified element from this collection, if it is present. Essentially an alias for Collection.remove but with no ambiguity for Collection<Integer>.

      Example:

           def list = [1, 2, 3, 2]
           list.removeElement(2)
           assert [1, 3, 2] == list

      Parameters:
        `self` - a Collection
        `o` - element to be removed from this collection, if present
      Returns:
        true if an element was removed as a result of this call
      Since:
        2.4.0

    - #### <T> public static T removeLast(List<T> self)

      Removes the last item from the List.

           def list = ['a', false, 2]
           assert list.removeLast() == 2
           assert list == ['a', false]

      Using add() and removeLast() is similar to push and pop on a Stack where the last item in the list represents the top of the stack.
      throws:
        NoSuchElementException if the list is empty
      Parameters:
        `self` - a List
      Returns:
        the item removed from the List
      Since:
        2.5.0

    - #### <T> public static Collection<T> repeat(Iterable<T> self, int count)

      Repeat the elements from an iterable. An alias for multiply.

           assert ['a', 42].repeat(2) == ['a', 42, 'a', 42]

      Parameters:
        `self` - an Iterable
        `count` - the (non-negative) number of times to repeat
      Returns:
        a collection containing the repeated elements
      Since:
        5.0.0

    - #### <T> public static Iterator<T> repeat(Iterable<T> self)

      Repeat the elements from an iterable infinitely.

           assert ['a', 42].repeat().take(5).toList() == ['a', 42, 'a', 42, 'a']

      Parameters:
        `self` - an Iterable
      Returns:
        an iterator containing the (infinite) repeated elements
      Since:
        5.0.0

    - #### <T> public static Iterator<T> repeat(Iterator<T> self, int count)

      Repeat the elements from an iterator.

           assert ['a', 42].iterator().repeat(2).toList() == ['a', 42, 'a', 42]

      Parameters:
        `self` - an Iterator
        `count` - the (non-negative) number of times to repeat
      Returns:
        an iterator containing the repeated elements
      Since:
        5.0.0

    - #### <T> public static Iterator<T> repeat(Iterator<T> self)

      Repeat the elements from an iterator infinitely.

           assert ['a', 42].iterator().repeat().take(5).toList() == ['a', 42, 'a', 42, 'a']

      Parameters:
        `self` - an Iterable
      Returns:
        an iterator containing the (infinite) repeated elements
      Since:
        5.0.0

    - #### public static List<MetaMethod> respondsTo(Object self, String name, Object[] argTypes)

      Returns an object satisfying Groovy truth if the implementing MetaClass responds to a method with the given name and arguments types.

      Note that this method's return value is based on realised methods and does not take into account objects or classes that implement invokeMethod or methodMissing

      This method is "safe" in that it will always return a value and never throw an exception

      Parameters:
        `self` - The object to inspect
        `name` - The name of the method of interest
        `argTypes` - The argument types to match against
      Returns:
        A List of MetaMethods matching the argument types which will be empty if no matching methods exist
      See Also:
        MetaObjectProtocol.respondsTo
      Since:
        1.6.0

    - #### public static List<MetaMethod> respondsTo(Object self, String name)

      Returns an object satisfying Groovy truth if the implementing MetaClass responds to a method with the given name regardless of the arguments.

      Note that this method's return value is based on realised methods and does not take into account objects or classes that implement invokeMethod or methodMissing

      This method is "safe" in that it will always return a value and never throw an exception

      Parameters:
        `self` - The object to inspect
        `name` - The name of the method of interest
      Returns:
        A List of MetaMethods matching the given name or an empty list if no matching methods exist
      See Also:
        MetaObjectProtocol.respondsTo
      Since:
        1.6.1

    - #### @SuppressWarnings("unchecked")
      public static boolean retainAll(Collection self, Object[] items)

      Modifies this collection so that it retains only its elements that are contained in the specified array. In other words, removes from this collection all of its elements that are not contained in the specified array. See also `grep` and `findAll` when wanting to produce a new list containing items which match some specified items but leaving the original collection unchanged.

      Parameters:
        `self` - a Collection to be modified
        `items` - array containing elements to be retained from this collection
      Returns:
        `true` if this collection changed as a result of the call
      See Also:
        Collection.retainAll
      Since:
        1.7.2

    - #### <T> public static boolean retainAll(Collection<T> self, @ClosureParams(FirstParam.FirstGenericType.class)
      Closure condition)

      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.

          def list = ['a', 'b']
           list.retainAll { it == 'b' }
           assert list == ['b']

      See also `findAll` and `grep` when wanting to produce a new list containing items which match some criteria but leaving the original collection unchanged.
      Parameters:
        `self` - a Collection to be modified
        `condition` - a closure condition
      Returns:
        `true` if this collection changed as a result of the call
      See Also:
        Iterator.remove
      Since:
        1.7.2

    - #### <K, V> public static boolean retainAll(Map<K, V> self, @ClosureParams(MapEntryOrKeyValue.class)
      Closure condition)

      Modifies this map so that it retains only its elements that are matched according to the specified closure condition. In other words, removes from this map all of its elements that don't match. If the closure takes one parameter then it will be passed the `Map.Entry`. Otherwise the closure should take two parameters, which will be the key and the value.

          def map = [a:1, b:2]
           map.retainAll { k,v -> k == 'b' }
           assert map == [b:2]

      See also `findAll` when wanting to produce a new map containing items which match some criteria but leaving the original map unchanged.
      Parameters:
        `self` - a Map to be modified
        `condition` - a 1 or 2 arg Closure condition applying on the entries
      Returns:
        `true` if this map changed as a result of the call
      Since:
        2.5.0

    - #### <T> public static List<T> reverse(List<T> self)

      Creates a new List with the identical contents to this list but in reverse order.

           def list = ["a", 4, false]
           assert list.reverse() == [false, 4, "a"]
           assert list == ["a", 4, false]

      Parameters:
        `self` - a List
      Returns:
        a reversed List
      See Also:
        reverse(List, boolean)
      Since:
        1.0

    - #### <T> public static List<T> reverse(List<T> self, boolean mutate)

      Reverses the elements in a list. If mutate is true, the original list is modified in place and returned. Otherwise, a new list containing the reversed items is produced.

           def list = ["a", 4, false]
           assert list.reverse(false) == [false, 4, "a"]
           assert list == ["a", 4, false]
           assert list.reverse(true) == [false, 4, "a"]
           assert list == [false, 4, "a"]

      Parameters:
        `self` - a List
        `mutate` - true if the list itself should be reversed in place and returned, false if a new list should be created
      Returns:
        a reversed List
      Since:
        1.8.1

    - #### <T> public static Iterator<T> reverse(Iterator<T> self)

      Reverses the iterator. The original iterator will become exhausted of elements after determining the reversed values. A new iterator for iterating through the reversed values is returned.

      Parameters:
        `self` - an Iterator
      Returns:
        a reversed Iterator
      Since:
        1.5.5

    - #### <T> @Deprecated(since = "5.0.0")
      public static T[] reverse(T[] self)

    - #### <T> @Deprecated(since = "5.0.0")
      public static T[] reverse(T[] self, boolean mutate)

    - #### <K, V> @SuppressWarnings("unchecked")
      public static Map<K, V> reverseEach(Map<K, V> self, @ClosureParams(MapEntryOrKeyValue.class)
      Closure<?> closure)

      Allows a Map to be iterated through in reverse order using a closure. In general, the order in which the map contents are processed cannot be guaranteed. In practise, specialized forms of Map, e.g. a TreeMap will have its contents processed according to the reverse of the natural ordering of the map.

      Parameters:
        `self` - the map over which we iterate
        `closure` - the 1 or 2 arg closure applied on each entry of the map
      Returns:
        returns the self parameter
      See Also:
        each(Map, Closure)
      Since:
        1.7.2

    - #### <T> public static List<T> reverseEach(List<T> self, @ClosureParams(FirstParam.FirstGenericType.class)
      Closure closure)

      Iterate over each element of the list in the reverse order.

          def result = []
           [1,2,3].reverseEach { result << it }
           assert result == [3,2,1]

      Parameters:
        `self` - a List
        `closure` - a closure to which each item is passed.
      Returns:
        the original list
      Since:
        1.5.0

    - #### <T> public static NavigableSet<T> reverseEach(NavigableSet<T> self, @ClosureParams(FirstParam.FirstGenericType.class)
      Closure closure)

      Iterate over each element of the set in reverse order.

           TreeSet navSet = [2, 4, 1, 3]  // natural order is sorted
           List result = []
           navSet.reverseEach { result << it }
           assert result == [4, 3, 2, 1]

      Parameters:
        `self` - a NavigableSet
        `closure` - a closure to which each item is passed.
      Returns:
        the original NavigableSet
      Since:
        4.0.11

    - #### <T> @Deprecated(since = "5.0.0")
      public static T[] reverseEach(T[] self, @ClosureParams(FirstParam.Component.class)
      Closure closure)

    - #### public static Number rightShift(Number self, Number operand)

      Implementation of the right shift operator for integral types. Non-integral Number types throw UnsupportedOperationException.

      Parameters:
        `self` - a Number object
        `operand` - the shift distance by which to right shift the number
      Returns:
        the resulting number
      Since:
        1.5.0

    - #### public static BitSet rightShift(BitSet self, Number operand)

      Implementation of the right shift operator for BitSets, returning a new BitSet and leaving the original unchanged. The `intValue()` is taken for the shift distance for non-integer operands.

      Parameters:
        `self` - a BitSet
        `operand` - the shift distance by which to right shift the BitSet
      Returns:
        the resulting BitSet
      Since:
        5.0.0

    - #### public static Number rightShiftUnsigned(Number self, Number operand)

      Implementation of the right shift (unsigned) operator for integral types. Non-integral Number types throw UnsupportedOperationException.

      Parameters:
        `self` - a Number object
        `operand` - the shift distance by which to right shift (unsigned) the number
      Returns:
        the resulting number
      Since:
        1.5.0

    - #### public static BitSet rightShiftUnsigned(BitSet self, Number operand)

      Implementation of the right shift (unsigned) operator for BitSets, returning a new BitSet and leaving the original unchanged. The `intValue()` is taken for the shift distance for non-integer operands.

      Parameters:
        `self` - a BitSet
        `operand` - the shift distance by which to right shift (unsigned) the BitSet
      Returns:
        the resulting BitSet
      Since:
        5.0.0

    - #### public static int round(Float number)

      Round the value

      Parameters:
        `number` - a Float
      Returns:
        the rounded value of that Float
      Since:
        1.0

    - #### public static float round(Float number, int precision)

      Round the value

      Parameters:
        `number` - a Float
        `precision` - the number of decimal places to keep
      Returns:
        the Float rounded to the number of decimal places specified by precision
      Since:
        1.6.0

    - #### public static long round(Double number)

      Round the value

      Parameters:
        `number` - a Double
      Returns:
        the rounded value of that Double
      Since:
        1.0

    - #### public static double round(Double number, int precision)

      Round the value

      Parameters:
        `number` - a Double
        `precision` - the number of decimal places to keep
      Returns:
        the Double rounded to the number of decimal places specified by precision
      Since:
        1.6.4

    - #### public static BigDecimal round(BigDecimal number)

      Round the value

      Note that this method differs from BigDecimal.round which specifies the digits to retain starting from the leftmost nonzero digit. This method rounds the integral part to the nearest whole number.

      Parameters:
        `number` - a BigDecimal
      Returns:
        the rounded value of that BigDecimal
      See Also:
        round(java.math.BigDecimal, int)
        BigDecimal.round
      Since:
        2.5.0

    - #### public static BigDecimal round(BigDecimal number, int precision)

      Round the value

      Note that this method differs from BigDecimal.round which specifies the digits to retain starting from the leftmost nonzero digit. This method operates on the fractional part of the number and the precision argument specifies the number of digits to the right of the decimal point to retain.

      Parameters:
        `number` - a BigDecimal
        `precision` - the number of decimal places to keep
      Returns:
        a BigDecimal rounded to the number of decimal places specified by precision
      See Also:
        round(java.math.BigDecimal)
        BigDecimal.round
      Since:
        2.5.0

    - #### @Override
      public void run()

    - #### public static TimerTask runAfter(Timer timer, int delay, Closure closure)

      Allows a simple syntax for using timers. This timer will execute the given closure after the given delay.

      Parameters:
        `timer` - a timer object
        `delay` - the delay in milliseconds before running the closure code
        `closure` - the closure to invoke
      Returns:
        The timer task which has been scheduled.
      Since:
        1.5.0

    - #### public static void setMetaClass(Class self, MetaClass metaClass)

      Sets the metaclass for a given class.

      Parameters:
        `self` - the class whose metaclass we wish to set
        `metaClass` - the new MetaClass
      Since:
        1.6.0

    - #### public static void setMetaClass(Object self, MetaClass metaClass)

      Sets the metaclass for an object.

      Parameters:
        `self` - the object whose metaclass we want to set
        `metaClass` - the new metaclass value
      Since:
        1.6.0

    - #### public static void setMetaClass(GroovyObject self, MetaClass metaClass)

      Sets the metaclass for a `GroovyObject`.

      Parameters:
        `self` - the object whose metaclass we want to set
        `metaClass` - the new metaclass value
      Since:
        2.0.0

    - #### public static void shuffle(List<?> self)

      Randomly reorders the elements of the specified list.

           def list = ["a", 4, false]
           def origSize = list.size()
           def origCopy = new ArrayList(list)
           list.shuffle()
           assert list.size() == origSize
           assert origCopy.every{ list.contains(it) }

      Parameters:
        `self` - a List
      See Also:
        Collections.shuffle
      Since:
        3.0.0

    - #### public static void shuffle(List<?> self, Random rnd)

      Randomly reorders the elements of the specified list using the specified random instance as the source of randomness.

           def r = new Random()
           def list = ["a", 4, false]
           def origSize = list.size()
           def origCopy = new ArrayList(list)
           list.shuffle(r)
           assert list.size() == origSize
           assert origCopy.every{ list.contains(it) }

      Parameters:
        `self` - a List
      See Also:
        Collections.shuffle
      Since:
        3.0.0

    - #### <T> @Deprecated(since = "5.0.0")
      public static void shuffle(T[] self)

    - #### <T> @Deprecated(since = "5.0.0")
      public static void shuffle(T[] self, Random rnd)

    - #### <T> public static List<T> shuffled(List<T> self)

      Creates a new list containing the elements of the specified list but in a random order.

           def list = ["a", 4, false]
           def result = list.shuffled()
           assert list !== result
           assert list == ["a", 4, false]
           assert list.size() == result.size()
           assert list.every{ result.contains(it) }

      Parameters:
        `self` - a List
      See Also:
        Collections.shuffle
      Since:
        3.0.0

    - #### <T> public static List<T> shuffled(List<T> self, Random rnd)

      Creates a new list containing the elements of the specified list but in a random order using the specified random instance as the source of randomness.

           def r = new Random()
           def list = ["a", 4, false]
           def result = list.shuffled(r)
           assert list !== result
           assert list == ["a", 4, false]
           assert list.size() == result.size()
           assert list.every{ result.contains(it) }

      Parameters:
        `self` - a List
      See Also:
        Collections.shuffle
      Since:
        3.0.0

    - #### <T> @Deprecated(since = "5.0.0")
      public static T[] shuffled(T[] self)

    - #### <T> @Deprecated(since = "5.0.0")
      public static T[] shuffled(T[] self, Random rnd)

    - #### public static int size(Iterator self)

      Provide the standard Groovy `size()` method for `Iterator`. The iterator will become exhausted of elements after determining the size value.

      Parameters:
        `self` - an Iterator
      Returns:
        the length of the Iterator
      Since:
        1.5.5

    - #### public static int size(Iterable self)

      Provide the standard Groovy `size()` method for `Iterable`.

           def items = [1, 2, 3]
           def iterable = { [ hasNext:{ !items.isEmpty() }, next:{ items.pop() } ] as Iterator } as Iterable
           assert iterable.size() == 3

      Parameters:
        `self` - an Iterable
      Returns:
        the length of the Iterable
      Since:
        2.3.8

    - #### @Deprecated(since = "5.0.0")
      public static int size(boolean[] self)

    - #### @Deprecated(since = "5.0.0")
      public static int size(byte[] self)

    - #### @Deprecated(since = "5.0.0")
      public static int size(char[] self)

    - #### @Deprecated(since = "5.0.0")
      public static int size(short[] self)

    - #### @Deprecated(since = "5.0.0")
      public static int size(int[] self)

    - #### @Deprecated(since = "5.0.0")
      public static int size(long[] self)

    - #### @Deprecated(since = "5.0.0")
      public static int size(float[] self)

    - #### @Deprecated(since = "5.0.0")
      public static int size(double[] self)

    - #### @Deprecated(since = "5.0.0")
      public static int size(Object[] self)

    - #### <T> public static List<T> sort(Iterable<T> self)

      Sorts the Collection. Assumes that the collection items are comparable and uses their natural ordering to determine the resulting order. If the Collection is a List, it is sorted in place and returned. Otherwise, the elements are first placed into a new list which is then sorted and returned - leaving the original Collection unchanged.

          assert [1,2,3] == [3,1,2].sort()

      Parameters:
        `self` - the Iterable to be sorted
      Returns:
        the sorted Iterable as a List
      See Also:
        sort(Iterable, boolean)
      Since:
        2.2.0

    - #### <T> public static List<T> sort(Iterable<T> self, boolean mutate)

      Sorts the Iterable. Assumes that the Iterable items are comparable and uses their natural ordering to determine the resulting order. If the Iterable is a List and mutate is true, it is sorted in place and returned. Otherwise, the elements are first placed into a new list which is then sorted and returned - leaving the original Iterable unchanged.

          assert [1,2,3] == [3,1,2].sort()

           def orig = [1, 3, 2]
           def sorted = orig.sort(false)
           assert orig == [1, 3, 2]
           assert sorted == [1, 2, 3]

      Parameters:
        `self` - the iterable to be sorted
        `mutate` - false will always cause a new list to be created, true will mutate lists in place
      Returns:
        the sorted iterable as a List
      Since:
        2.2.0

    - #### <K, V> public static Map<K, V> sort(Map<K, V> self, @ClosureParams(value=FromString.class, options={"Map.Entry","Map.Entry,Map.Entry"})
      Closure closure)

      Sorts the elements from the given map into a new ordered map using the closure as a comparator to determine the ordering. The original map is unchanged.

          def map = [a:5, b:3, c:6, d:4].sort { a, b -> a.value <=> b.value }
           assert map == [b:3, d:4, a:5, c:6]

      Parameters:
        `self` - the original unsorted map
        `closure` - a Closure used as a comparator
      Returns:
        the sorted map
      Since:
        1.6.0

    - #### <K, V> public static Map<K, V> sort(Map<K, V> self, Comparator<? super K> comparator)

      Sorts the elements from the given map into a new ordered Map using the specified key comparator to determine the ordering. The original map is unchanged.

          def map = [ba:3, cz:6, ab:5].sort({ a, b -> a[-1] <=> b[-1] } as Comparator)
           assert map*.value == [3, 5, 6]

      Parameters:
        `self` - the original unsorted map
        `comparator` - a Comparator
      Returns:
        the sorted map
      Since:
        1.7.2

    - #### <K, V> public static Map<K, V> sort(Map<K, V> self)

      Sorts the elements from the given map into a new ordered Map using the natural ordering of the keys to determine the ordering. The original map is unchanged.

          map = [ba:3, cz:6, ab:5].sort()
           assert map*.value == [5, 3, 6]

      Parameters:
        `self` - the original unsorted map
      Returns:
        the sorted map
      Since:
        1.7.2

    - #### <T> public static Iterator<T> sort(Iterator<T> self)

      Sorts the given iterator items into a sorted iterator. The items are assumed to be comparable. The original iterator will become exhausted of elements after completing this method call. A new iterator is produced that traverses the items in sorted order.

      The iterator is exhausted before elements are produced, so this method isn't suitable for use with infinite iterators.

      Parameters:
        `self` - the Iterator to be sorted
      Returns:
        the sorted items as an Iterator
      Since:
        1.5.5

    - #### <T> public static Iterator<T> sort(Iterator<T> self, Comparator<? super T> comparator)

      Sorts the given iterator items into a sorted iterator using the comparator. The original iterator will become exhausted of elements after completing this method call. A new iterator is produced that traverses the items in sorted order.

      The iterator is exhausted before elements are produced, so this method isn't suitable for use with infinite iterators.

      Parameters:
        `self` - the Iterator to be sorted
        `comparator` - a Comparator used for comparing items
      Returns:
        the sorted items as an Iterator
      Since:
        1.5.5

    - #### <T> public static List<T> sort(Iterable<T> self, boolean mutate, Comparator<? super T> comparator)

      Sorts the Iterable using the given Comparator. If the Iterable is a List and mutate is true, it is sorted in place and returned. Otherwise, the elements are first placed into a new list which is then sorted and returned - leaving the original Iterable unchanged.

           assert ["hi","hey","hello"] == ["hello","hi","hey"].sort(false, { a, b -> a.length() <=> b.length() } as Comparator )

           def orig = ["hello","hi","Hey"]
           def sorted = orig.sort(false, String.CASE_INSENSITIVE_ORDER)
           assert orig == ["hello","hi","Hey"]
           assert sorted == ["hello","Hey","hi"]

      Parameters:
        `self` - the Iterable to be sorted
        `mutate` - false causes a new list to be created, true will mutate lists in place
        `comparator` - a Comparator used for the comparison
      Returns:
        a sorted List
      Since:
        2.2.0

    - #### <T> public static List<T> sort(List<T> self, IntRange range, boolean mutate, Comparator<? super T> comparator)

      Sorts the Iterable using the given Comparator over the given index range. If the Iterable is a List and mutate is true, it is sorted in place and returned. Otherwise, the elements are first placed into a new list which is then sorted and returned - leaving the original Iterable unchanged.

           def orig = ['hello', 'hi', 'Hey', 'a']
           def sorted = orig.sort(0..2, false, String.CASE_INSENSITIVE_ORDER)
           assert orig == ['hello', 'hi', 'Hey', 'a']
           assert sorted == ['hello', 'Hey', 'hi', 'a']

      Parameters:
        `self` - the Iterable to be sorted
        `range` - the inclusive range of index values over which to sort
        `mutate` - false causes a new list to be created, true will mutate lists in place
        `comparator` - a Comparator used for the comparison
      Returns:
        a sorted List
      Since:
        5.0.0

    - #### <T> public static List<T> sort(List<T> self, IntRange range, Comparator<? super T> comparator)

      Sorts the Iterable using the given Comparator over the given index range.

           def orig = ['hello', 'hi', 'Hey', 'a']
           orig.sort(0..2, String.CASE_INSENSITIVE_ORDER)
           assert orig == ['hello', 'Hey', 'hi', 'a']

      Parameters:
        `self` - the Iterable to be sorted
        `range` - the inclusive range of index values over which to sort
        `comparator` - a Comparator used for the comparison
      Returns:
        a sorted List
      Since:
        5.0.0

    - #### <T> public static List<T> sort(List<T> self, IntRange range, boolean mutate, @ClosureParams(value=FromString.class,options={"T","T,T"})
      Closure<?> closure)

      Sorts elements in the given index range using the given Closure to determine the ordering. If mutate is true, it is sorted in place and returned. Otherwise, the elements are first placed into a new list which is then sorted and returned, leaving the original List unchanged.

           // a list with some odd then even numbers
           def nums = [5, 9, 1, 7, 3, 4, 8, 6, 0, 2]

           // sort odds ascending, evens descending
           assert nums.sort(0..4, false) { it }.sort(5..9, false) { -it }
            == [1, 3, 5, 7, 9, 8, 6, 4, 2, 0]
           // sort odds descending, evens descending
           assert nums.sort(0..<5, false) { -it }.sort(4<..<10, false) { -it }
            == [9, 7, 5, 3, 1, 8, 6, 4, 2, 0]
           // sort odds descending, evens ascending
           assert nums.sort(0..<5, false) { -it }.sort(5..-1, false) { it }
            == [9, 7, 5, 3, 1, 0, 2, 4, 6, 8]
           // leave first and last numbers, sort remaining odds ascending, remaining evens descending
           assert nums.sort(1..4, false) { it }.sort(5..-2, false) { -it }
            == [5, 1, 3, 7, 9, 8, 6, 4, 0, 2]
           // leave first and last numbers, sort remaining odds descending, remaining evens ascending
           assert nums.sort(1..4, false) { -it }.sort(5..-2, false) { it }
            == [5, 9, 7, 3, 1, 0, 4, 6, 8, 2]
           // leave first and last odds and evens, sort remaining odds ascending, remaining evens descending
           assert nums.sort(0<..<4, false) { it }.sort(5<..<9, false) { -it }
            == [5, 1, 7, 9, 3, 4, 8, 6, 0, 2]
           // leave first and last odds and evens, sort remaining odds descending, remaining evens ascending
           assert nums.sort(0<..<4, false) { -it }.sort(5<..<-1, false) { it }
            == [5, 9, 7, 1, 3, 4, 0, 6, 8, 2]

      Parameters:
        `self` - the List to be sorted
        `range` - the inclusive range of index values over which to sort
        `mutate` - false causes a new list to be created, true will mutate lists in place
        `closure` - a Closure used to determine the correct ordering
      Returns:
        a sorted List
      Since:
        5.0.0

    - #### <T> public static List<T> sort(List<T> self, IntRange range, @ClosureParams(value=FromString.class,options={"T","T,T"})
      Closure<?> closure)

      A sort variant that takes an index range and always mutates the original list.

           def nums = [5, 9, 1, 7, 3, 4, 8, 6, 0, 2]
           nums.sort(0..4) { it }
           assert nums == [1, 3, 5, 7, 9, 4, 8, 6, 0, 2]

      See Also:
        sort(List, IntRange, boolean, Closure)
      Returns:
        the sorted list
      Since:
        5.0.0

    - #### <T> public static List<T> sort(List<T> self, IntRange range)

      A mutating sort variant that takes an index range.

           def nums = [5, 9, 1, 7, 3, 4, 8, 6, 0, 2]
           nums.sort(0..4)
           assert nums == [1, 3, 5, 7, 9, 4, 8, 6, 0, 2]

      See Also:
        sort(List, IntRange, boolean, Closure)
      Returns:
        the sorted list
      Since:
        5.0.0

    - #### <T> public static Iterator<T> sort(Iterator<T> self, @ClosureParams(value=FromString.class, options={"T","T,T"})
      Closure closure)

      Sorts the given iterator items into a sorted iterator using the Closure to determine the correct ordering. The original iterator will be fully processed after the method call.

      If the closure has two parameters it is used like a traditional Comparator. I.e. it should compare its two parameters for order, returning a negative integer, zero, or a positive integer when the first parameter is less than, equal to, or greater than the second respectively. Otherwise, the Closure is assumed to take a single parameter and return a Comparable (typically an Integer) which is then used for further comparison.

      The iterator is exhausted before elements are produced, so this method isn't suitable for use with infinite iterators.

      Parameters:
        `self` - the Iterator to be sorted
        `closure` - a Closure used to determine the correct ordering
      Returns:
        the sorted items as an Iterator
      Since:
        1.5.5

    - #### <T> public static List<T> sort(Iterable<T> self, @ClosureParams(value=FromString.class, options={"T","T,T"})
      Closure closure)

      Sorts this Iterable using the given Closure to determine the correct ordering. If the Iterable is a List, it is sorted in place and returned. Otherwise, the elements are first placed into a new list which is then sorted and returned - leaving the original Iterable unchanged.

      If the Closure has two parameters it is used like a traditional Comparator. I.e. it should compare its two parameters for order, returning a negative integer, zero, or a positive integer when the first parameter is less than, equal to, or greater than the second respectively. Otherwise, the Closure is assumed to take a single parameter and return a Comparable (typically an Integer) which is then used for further comparison.

          assert ["hi","hey","hello"] == ["hello","hi","hey"].sort { it.length() }

          assert ["hi","hey","hello"] == ["hello","hi","hey"].sort { a, b -> a.length() <=> b.length() }

      Parameters:
        `self` - the Iterable to be sorted
        `closure` - a 1 or 2 arg Closure used to determine the correct ordering
      Returns:
        a newly created sorted List
      See Also:
        sort(Iterable, boolean, Closure)
      Since:
        2.2.0

    - #### <T> public static List<T> sort(Iterable<T> self, boolean mutate, @ClosureParams(value=FromString.class, options={"T","T,T"})
      Closure closure)

      Sorts this Iterable using the given Closure to determine the correct ordering. If the Iterable is a List and mutate is true, it is sorted in place and returned. Otherwise, the elements are first placed into a new list which is then sorted and returned - leaving the original Iterable unchanged.

      If the closure has two parameters it is used like a traditional Comparator. I.e. it should compare its two parameters for order, returning a negative integer, zero, or a positive integer when the first parameter is less than, equal to, or greater than the second respectively. Otherwise, the Closure is assumed to take a single parameter and return a Comparable (typically an Integer) which is then used for further comparison.

          assert ["hi","hey","hello"] == ["hello","hi","hey"].sort { it.length() }

          assert ["hi","hey","hello"] == ["hello","hi","hey"].sort { a, b -> a.length() <=> b.length() }

           def orig = ["hello","hi","Hey"]
           def sorted = orig.sort(false) { it.toUpperCase() }
           assert orig == ["hello","hi","Hey"]
           assert sorted == ["hello","Hey","hi"]

      Parameters:
        `self` - the Iterable to be sorted
        `mutate` - false will always cause a new list to be created, true will mutate lists in place
        `closure` - a 1 or 2 arg Closure used to determine the correct ordering
      Returns:
        a newly created sorted List
      Since:
        2.2.0

    - #### <T> public static SortedSet<T> sort(SortedSet<T> self)

      Avoids doing unnecessary work when sorting an already sorted set (i.e. an identity function for an already sorted set).

      Parameters:
        `self` - an already sorted set
      Returns:
        the set
      Since:
        1.0

    - #### <K, V> public static SortedMap<K, V> sort(SortedMap<K, V> self)

      Avoids doing unnecessary work when sorting an already sorted map (i.e. an identity function for an already sorted map).

      Parameters:
        `self` - an already sorted map
      Returns:
        the map
      Since:
        1.8.1

    - #### <T> @Deprecated(since = "5.0.0")
      public static T[] sort(T[] self)

    - #### <T> @Deprecated(since = "5.0.0")
      public static T[] sort(T[] self, boolean mutate)

    - #### <T> @Deprecated(since = "5.0.0")
      public static T[] sort(T[] self, Comparator<? super T> comparator)

    - #### <T> @Deprecated(since = "5.0.0")
      public static T[] sort(T[] self, boolean mutate, Comparator<? super T> comparator)

    - #### <T> @Deprecated(since = "5.0.0")
      public static T[] sort(T[] self, @ClosureParams(value=FromString.class,options={"T","T,T"})
      Closure closure)

    - #### <T> @Deprecated(since = "5.0.0")
      public static T[] sort(T[] self, boolean mutate, @ClosureParams(value=FromString.class,options={"T","T,T"})
      Closure closure)

    - #### @SuppressWarnings("unchecked")
      public static Collection split(Object self, Closure closure)

      Splits all items into two lists based on the closure condition. The first list contains all items matching the closure expression. The second list all those that don't.

      Parameters:
        `self` - an Object with an Iterator returning its values
        `closure` - a closure condition
      Returns:
        a List whose first item is the accepted values and whose second item is the rejected values
      Since:
        1.6.0

    - #### <T> public static Collection<Collection<T>> split(Collection<T> self, @ClosureParams(FirstParam.FirstGenericType.class)
      Closure closure)

      Splits all items into two collections based on the closure condition. The first list contains all items which match the closure expression. The second list all those that don't.

      Example usage:

          assert [[2,4],[1,3]] == [1,2,3,4].split { it % 2 == 0 }

      Parameters:
        `self` - a Collection of values
        `closure` - a closure condition
      Returns:
        a List whose first item is the accepted values and whose second item is the rejected values
      Since:
        1.6.0

    - #### <T> @SuppressWarnings("unchecked")
      public static List<List<T>> split(List<T> self, @ClosureParams(FirstParam.FirstGenericType.class)
      Closure closure)

      Splits all items into two collections based on the closure condition. The first list contains all items which match the closure expression. The second list all those that don't.

      Example usage:

          assert [[2,4],[1,3]] == [1,2,3,4].split { it % 2 == 0 }

      Parameters:
        `self` - a List of values
        `closure` - a closure condition
      Returns:
        a List whose first item is the accepted values and whose second item is the rejected values
      Since:
        2.4.0

    - #### <T> @SuppressWarnings("unchecked")
      public static List<Set<T>> split(Set<T> self, @ClosureParams(FirstParam.FirstGenericType.class)
      Closure closure)

      Splits all items into two collections based on the closure condition. The first list contains all items which match the closure expression. The second list all those that don't.

      Example usage:

          assert [[2,4] as Set, [1,3] as Set] == ([1,2,3,4] as Set).split { it % 2 == 0 }

      Parameters:
        `self` - a Set of values
        `closure` - a closure condition
      Returns:
        a List whose first item is the accepted values and whose second item is the rejected values
      Since:
        2.4.0

    - #### <T> @Deprecated(since = "5.0.0")
      public static Collection<Collection<T>> split(T[] self, @ClosureParams(FirstParam.Component.class)
      Closure closure)

    - #### public static SpreadMap spread(Map self)

      Synonym for toSpreadMap(java.util.Map).

      Parameters:
        `self` - a map
      Returns:
        a newly created SpreadMap
      Since:
        1.0

    - #### public static String sprintf(Object self, String format, Object[] values)

      Sprintf to a string.

      Parameters:
        `self` - any Object
        `format` - a format string
        `values` - values referenced by the format specifiers in the format string
      Returns:
        the resulting formatted string
      Since:
        1.5.0

    - #### public static String sprintf(Object self, String format, Object arg)

      Returns a formatted string using the specified format string and arguments.

      Parameters:
        `self` - any Object
        `format` - A format string
        `arg` - Argument which is referenced by the format specifiers in the format string. The type of `arg` should be one of Object[], List, int[], short[], byte[], char[], boolean[], long[], float[], or double[].
      Returns:
        the resulting printf'd string
      Since:
        1.5.0

    - #### public static void step(Number self, Number to, Number stepNumber, Closure closure)

      Iterates from this number up to the given number using a step increment. Each intermediate number is passed to the given closure. Example:

           0.step( 10, 2 ) {
             println it
           }

      Prints even numbers 0 through 8.
      Parameters:
        `self` - a Number to start with
        `to` - a Number to go up to, exclusive
        `stepNumber` - a Number representing the step increment
        `closure` - the closure to call
      Since:
        1.0

    - #### <T> public static List<T> subList(List<T> self, IntRange range)

      Returns a view of the portion of this list given by the specified range.

           def nums = [0, 1, 2, 3, 4]
           assert nums.subList(1..3) == 1..3
           assert nums.subList(0<..<-1) == 1..3
           nums.subList(1..3).clear()
           assert nums == [0, 4]

      Parameters:
        `self` - a List
        `range` - a range
      Returns:
        a view of the specified range within this list
      Since:
        5.0.0

    - #### <K, V> public static Map<K, V> subMap(Map<K, V> map, Collection<K> keys)

      Creates a sub-Map containing the given keys. This method is similar to List.subList() but uses keys rather than index ranges.

          assert [1:10, 2:20, 4:40].subMap( [2, 4] ) == [2:20, 4:40]

      Parameters:
        `map` - a Map
        `keys` - a Collection of keys
      Returns:
        a new Map containing the given keys
      Since:
        1.0

    - #### <K, V> public static Map<K, V> subMap(Map<K, V> map, K[] keys)

      Creates a sub-Map containing the given keys. This method is similar to List.subList() but uses keys rather than index ranges. The original map is unaltered.

           def orig = [1:10, 2:20, 3:30, 4:40]
           assert orig.subMap([1, 3] as int[]) == [1:10, 3:30]
           assert orig.subMap([2, 4] as Integer[]) == [2:20, 4:40]
           assert orig.size() == 4

      Parameters:
        `map` - a Map
        `keys` - an array of keys
      Returns:
        a new Map containing the given keys
      Since:
        2.1.0

    - #### <T> public static Future<T> submit(ExecutorService self, Closure<T> task)

      Submits a value-returning task for execution and returns a Future representing the pending results of the task.

           def executor = java.util.concurrent.Executors.newSingleThreadExecutor()
           try {
             def future = executor.submit {
               return 'works'
             }
             assert future.get() == 'works'
           } finally {
             executor.shutdown()
           }

      Since:
        5.0.0

    - #### <T> public static Set<List<T>> subsequences(List<T> self)

      Finds all non-null subsequences of a list.

      Example usage:

          def result = [1, 2, 3].subsequences()
           assert result == [[1, 2, 3], [1, 3], [2, 3], [1, 2], [1], [2], [3]] as Set

      Parameters:
        `self` - the List of items
      Returns:
        the subsequences from the list
      Since:
        1.7.0

    - #### public static Object sum(Iterable<?> self)

      Sums the items in an Iterable. This is equivalent to invoking the "plus" method on all items in the Iterable.

          assert 1+2+3+4 == [1,2,3,4].sum()

      Parameters:
        `self` - Iterable of values to add together
      Returns:
        The sum of all the items
      See Also:
        sum(Iterator)
      Since:
        2.2.0

    - #### public static Object sum(Iterator<Object> self)

      Sums the items from an Iterator. This is equivalent to invoking the "plus" method on all items from the Iterator. The iterator will become exhausted of elements after determining the sum value.

      Parameters:
        `self` - an Iterator for the values to add together
      Returns:
        The sum of all the items
      Since:
        1.5.5

    - #### public static Object sum(Iterable<?> self, Object initialValue)

      Sums the items in an Iterable, adding the result to some initial value.

           assert 5+1+2+3+4 == [1,2,3,4].sum(5)

      Parameters:
        `self` - an Iterable of values to sum
        `initialValue` - the items in the collection will be summed to this initial value
      Returns:
        The sum of all the items.
      See Also:
        sum(Iterator, Object)
      Since:
        2.2.0

    - #### public static Object sum(Iterator<?> self, Object initialValue)

      Sums the items from an Iterator, adding the result to some initial value. This is equivalent to invoking the "plus" method on all items from the Iterator. The iterator will become exhausted of elements after determining the sum value.

      Parameters:
        `self` - an Iterator for the values to add together
        `initialValue` - the items in the collection will be summed to this initial value
      Returns:
        The sum of all the items
      Since:
        1.5.5

    - #### <T> public static Object sum(Iterable<T> self, @ClosureParams(FirstParam.FirstGenericType.class)
      Closure closure)

      Sums the result of applying a closure to each item of an Iterable. `coll.sum(closure)` is equivalent to: `coll.collect(closure).sum()`.

          assert 4+6+10+12 == [2,3,5,6].sum { it * 2 }

      Parameters:
        `self` - an Iterable
        `closure` - a single parameter closure that returns a (typically) numeric value.
      Returns:
        The sum of the values returned by applying the closure to each item of the Iterable.
      Since:
        2.2.0

    - #### <T> public static Object sum(Iterator<T> self, @ClosureParams(FirstParam.FirstGenericType.class)
      Closure closure)

      Sums the result of applying a closure to each item returned from an iterator. `iter.sum(closure)` is equivalent to: `iter.collect(closure).sum()`. The iterator will become exhausted of elements after determining the sum value.

      Parameters:
        `self` - An Iterator
        `closure` - a single parameter closure that returns a (typically) numeric value.
      Returns:
        The sum of the values returned by applying the closure to each item from the Iterator.
      Since:
        1.7.1

    - #### <T> public static Object sum(Iterable<T> self, Object initialValue, @ClosureParams(FirstParam.FirstGenericType.class)
      Closure closure)

      Sums the result of applying a closure to each item of an Iterable to some initial value. `iter.sum(initVal, closure)` is equivalent to: `iter.collect(closure).sum(initVal)`.

          assert 50+4+6+10+12 == [2,3,5,6].sum(50) { it * 2 }

      Parameters:
        `self` - an Iterable
        `closure` - a single parameter closure that returns a (typically) numeric value.
        `initialValue` - the closure results will be summed to this initial value
      Returns:
        The sum of the values returned by applying the closure to each item of the collection.
      Since:
        1.5.0

    - #### <T> public static Object sum(Iterator<T> self, Object initialValue, @ClosureParams(FirstParam.FirstGenericType.class)
      Closure closure)

      Sums the result of applying a closure to each item of an Iterator to some initial value. `iter.sum(initVal, closure)` is equivalent to: `iter.collect(closure).sum(initVal)`. The iterator will become exhausted of elements after determining the sum value.

      Parameters:
        `self` - an Iterator
        `closure` - a single parameter closure that returns a (typically) numeric value.
        `initialValue` - the closure results will be summed to this initial value
      Returns:
        The sum of the values returned by applying the closure to each item from the Iterator.
      Since:
        1.7.1

    - #### @Deprecated(since = "5.0.0")
      public static byte sum(byte[] self)

    - #### @Deprecated(since = "5.0.0")
      public static char sum(char[] self)

    - #### @Deprecated(since = "5.0.0")
      public static short sum(short[] self)

    - #### @Deprecated(since = "5.0.0")
      public static int sum(int[] self)

    - #### @Deprecated(since = "5.0.0")
      public static long sum(long[] self)

    - #### @Deprecated(since = "5.0.0")
      public static float sum(float[] self)

    - #### @Deprecated(since = "5.0.0")
      public static double sum(double[] self)

    - #### @Deprecated(since = "5.0.0")
      public static Object sum(Object[] self)

    - #### @Deprecated(since = "5.0.0")
      public static byte sum(byte[] self, byte initialValue)

    - #### @Deprecated(since = "5.0.0")
      public static float sum(float[] self, float initialValue)

    - #### @Deprecated(since = "5.0.0")
      public static short sum(short[] self, short initialValue)

    - #### @Deprecated(since = "5.0.0")
      public static int sum(int[] self, int initialValue)

    - #### @Deprecated(since = "5.0.0")
      public static long sum(long[] self, long initialValue)

    - #### @Deprecated(since = "5.0.0")
      public static char sum(char[] self, char initialValue)

    - #### @Deprecated(since = "5.0.0")
      public static double sum(double[] self, double initialValue)

    - #### @Deprecated(since = "5.0.0")
      public static Object sum(Object[] self, Object initialValue)

    - #### <T> @Deprecated(since = "5.0.0")
      public static Object sum(T[] self, @ClosureParams(FirstParam.Component.class)
      Closure closure)

    - #### <T> @Deprecated(since = "5.0.0")
      public static Object sum(T[] self, Object initialValue, @ClosureParams(FirstParam.Component.class)
      Closure closure)

    - #### <T> public static List<T> swap(List<T> self, int i, int j)

      Swaps two elements at the specified positions.

      Example:

           assert [1, 3, 2, 4] == [1, 2, 3, 4].swap(1, 2)

      Parameters:
        `self` - a List
        `i` - a position
        `j` - a position
      Returns:
        self
      See Also:
        Collections.swap
      Since:
        2.4.0

    - #### @Deprecated(since = "5.0.0")
      public static boolean[] swap(boolean[] self, int i, int j)

    - #### @Deprecated(since = "5.0.0")
      public static byte[] swap(byte[] self, int i, int j)

    - #### @Deprecated(since = "5.0.0")
      public static char[] swap(char[] self, int i, int j)

    - #### @Deprecated(since = "5.0.0")
      public static short[] swap(short[] self, int i, int j)

    - #### @Deprecated(since = "5.0.0")
      public static int[] swap(int[] self, int i, int j)

    - #### @Deprecated(since = "5.0.0")
      public static long[] swap(long[] self, int i, int j)

    - #### @Deprecated(since = "5.0.0")
      public static float[] swap(float[] self, int i, int j)

    - #### @Deprecated(since = "5.0.0")
      public static double[] swap(double[] self, int i, int j)

    - #### <T> @Deprecated(since = "5.0.0")
      public static T[] swap(T[] self, int i, int j)

    - #### <T> public static List<T> tail(List<T> self)

      Returns the items from the List excluding the first item.

           def list = [3, 4, 2]
           assert list.tail() == [4, 2]
           assert list == [3, 4, 2]

      throws:
        NoSuchElementException if you try to access tail() for an empty List
      Parameters:
        `self` - a List
      Returns:
        a List without its first element
      Since:
        1.5.6

    - #### <T> public static SortedSet<T> tail(SortedSet<T> self)

      Returns the items from the SortedSet excluding the first item.

           def sortedSet = [3, 4, 2] as SortedSet
           assert sortedSet.tail() == [3, 4] as SortedSet
           assert sortedSet == [3, 4, 2] as SortedSet

      throws:
        NoSuchElementException if you try to access tail() for an empty SortedSet
      Parameters:
        `self` - a SortedSet
      Returns:
        a SortedSet without its first element
      Since:
        2.4.0

    - #### <T> public static Collection<T> tail(Iterable<T> self)

      Returns the items from the Iterable excluding the first item.

           def list = [3, 4, 2]
           assert list.tail() == [4, 2]
           assert list == [3, 4, 2]

      throws:
        NoSuchElementException if you try to access tail() for an empty Iterable
      Parameters:
        `self` - an Iterable
      Returns:
        a collection without its first element
      Since:
        2.4.0

    - #### <T> public static Iterator<T> tail(Iterator<T> self)

      Returns the original iterator after throwing away the first element.

      throws:
        NoSuchElementException if you try to access tail() for an exhausted/empty Iterator
      Parameters:
        `self` - the original iterator
      Returns:
        the iterator without its first element
      Since:
        1.8.1

    - #### <T> @Deprecated(since = "5.0.0")
      public static T[] tail(T[] self)

    - #### <T> public static List<List<T>> tails(Iterable<T> self)

      Calculates the tail values of this Iterable: the first value will be this list of all items from the iterable and the final one will be an empty list, with the intervening values the results of successive applications of tail on the items.

           assert [1, 2, 3, 4].tails() == [[1, 2, 3, 4], [2, 3, 4], [3, 4], [4], []]

      Parameters:
        `self` - an Iterable
      Returns:
        a List of the tail values from the given Iterable
      Since:
        2.5.0

    - #### <T> public static List<T> take(List<T> self, int num)

      Returns the first `num` elements from the head of this List.

           def strings = [ 'a', 'b', 'c' ]
           assert strings.take( 0 ) == []
           assert strings.take( 2 ) == [ 'a', 'b' ]
           assert strings.take( 5 ) == [ 'a', 'b', 'c' ]

      Parameters:
        `self` - the original List
        `num` - the number of elements to take from this List
      Returns:
        a List consisting of the first `num` elements from this List, or else all the elements from the List if it has less than `num` elements.
      Since:
        1.8.1

    - #### <T> public static SortedSet<T> take(SortedSet<T> self, int num)

      Returns the first `num` elements from the head of this SortedSet.

           def strings = [ 'a', 'b', 'c' ] as SortedSet
           assert strings.take( 0 ) == [] as SortedSet
           assert strings.take( 2 ) == [ 'a', 'b' ] as SortedSet
           assert strings.take( 5 ) == [ 'a', 'b', 'c' ] as SortedSet

      Parameters:
        `self` - the original SortedSet
        `num` - the number of elements to take from this SortedSet
      Returns:
        a SortedSet consisting of the first `num` elements from this List, or else all the elements from the SortedSet if it has less than `num` elements.
      Since:
        2.4.0

    - #### <T> public static Collection<T> take(Iterable<T> self, int num)

      Returns the first `num` elements from the head of this Iterable.

           def strings = [ 'a', 'b', 'c' ]
           assert strings.take( 0 ) == []
           assert strings.take( 2 ) == [ 'a', 'b' ]
           assert strings.take( 5 ) == [ 'a', 'b', 'c' ]

           class AbcIterable implements Iterable {
               Iterator iterator() { "abc".iterator() }
           }
           def abc = new AbcIterable()
           assert abc.take(0) == []
           assert abc.take(1) == ['a']
           assert abc.take(3) == ['a', 'b', 'c']
           assert abc.take(5) == ['a', 'b', 'c']

      Parameters:
        `self` - the original Iterable
        `num` - the number of elements to take from this Iterable
      Returns:
        a Collection consisting of the first `num` elements from this Iterable, or else all the elements from the Iterable if it has less than `num` elements.
      Since:
        1.8.7

    - #### <K, V> public static Map<K, V> take(Map<K, V> self, int num)

      Returns a new map containing the first `num` elements from the head of this map. If the map instance does not have ordered keys, then this function could return a random `num` entries. Groovy by default uses LinkedHashMap, so this shouldn't be an issue in the main.

           def strings = [ 'a':10, 'b':20, 'c':30 ]
           assert strings.take( 0 ) == [:]
           assert strings.take( 2 ) == [ 'a':10, 'b':20 ]
           assert strings.take( 5 ) == [ 'a':10, 'b':20, 'c':30 ]

      Parameters:
        `self` - the original map
        `num` - the number of elements to take from this map
      Returns:
        a new map consisting of the first `num` elements of this map, or else the whole map if it has less than `num` elements.
      Since:
        1.8.1

    - #### <T> public static Iterator<T> take(Iterator<T> self, int num)

      Returns an iterator of up to the first `num` elements from this iterator. The original iterator is stepped along by `num` elements.

           def a = 0
           def iter = [ hasNext:{ true }, next:{ a++ } ] as Iterator
           def iteratorCompare( Iterator a, List b ) {
               a.collect { it } == b
           }
           assert iteratorCompare( iter.take( 0 ), [] )
           assert iteratorCompare( iter.take( 2 ), [ 0, 1 ] )
           assert iteratorCompare( iter.take( 5 ), [ 2, 3, 4, 5, 6 ] )

      Parameters:
        `self` - the Iterator
        `num` - the number of elements to take from this iterator
      Returns:
        an iterator consisting of up to the first `num` elements of this iterator.
      Since:
        1.8.1

    - #### <T> @Deprecated(since = "5.0.0")
      public static T[] take(T[] self, int num)

    - #### <T> public static Collection<T> takeRight(Iterable<T> self, int num)

      Returns the last `num` elements from the tail of this Iterable.

           def strings = [ 'a', 'b', 'c' ]
           assert strings.takeRight( 0 ) == []
           assert strings.takeRight( 2 ) == [ 'b', 'c' ]
           assert strings.takeRight( 5 ) == [ 'a', 'b', 'c' ]

           class AbcIterable implements Iterable {
               Iterator iterator() { "abc".iterator() }
           }
           def abc = new AbcIterable()
           assert abc.takeRight(0) == []
           assert abc.takeRight(1) == ['c']
           assert abc.takeRight(3) == ['a', 'b', 'c']
           assert abc.takeRight(5) == ['a', 'b', 'c']

      Parameters:
        `self` - the original Iterable
        `num` - the number of elements to take from this Iterable
      Returns:
        a Collection consisting of the last `num` elements from this Iterable, or else all the elements from the Iterable if it has less than `num` elements.
      Since:
        2.4.0

    - #### <T> public static List<T> takeRight(List<T> self, int num)

      Returns the last `num` elements from the tail of this List.

           def strings = [ 'a', 'b', 'c' ]
           assert strings.takeRight( 0 ) == []
           assert strings.takeRight( 2 ) == [ 'b', 'c' ]
           assert strings.takeRight( 5 ) == [ 'a', 'b', 'c' ]

      Parameters:
        `self` - the original List
        `num` - the number of elements to take from this List
      Returns:
        a List consisting of the last `num` elements from this List, or else all the elements from the List if it has less than `num` elements.
      Since:
        2.4.0

    - #### <T> public static SortedSet<T> takeRight(SortedSet<T> self, int num)

      Returns the last `num` elements from the tail of this SortedSet.

           def strings = [ 'a', 'b', 'c' ] as SortedSet
           assert strings.takeRight( 0 ) == [] as SortedSet
           assert strings.takeRight( 2 ) == [ 'b', 'c' ] as SortedSet
           assert strings.takeRight( 5 ) == [ 'a', 'b', 'c' ] as SortedSet

      Parameters:
        `self` - the original SortedSet
        `num` - the number of elements to take from this SortedSet
      Returns:
        a SortedSet consisting of the last `num` elements from this SortedSet, or else all the elements from the SortedSet if it has less than `num` elements.
      Since:
        2.4.0

    - #### <T> @Deprecated(since = "5.0.0")
      public static T[] takeRight(T[] self, int num)

    - #### <T> public static List<T> takeWhile(List<T> self, @ClosureParams(FirstParam.FirstGenericType.class)
      Closure condition)

      Returns the longest prefix of this list where each element passed to the given closure condition evaluates to true. Similar to takeWhile(Iterable, groovy.lang.Closure) except that it attempts to preserve the type of the original list.

           def nums = [ 1, 3, 2 ]
           assert nums.takeWhile{ it < 1 } == []
           assert nums.takeWhile{ it < 3 } == [ 1 ]
           assert nums.takeWhile{ it < 4 } == [ 1, 3, 2 ]

      Parameters:
        `self` - the original list
        `condition` - the closure that must evaluate to true to continue taking elements
      Returns:
        a prefix of the given list where each element passed to the given closure evaluates to true
      Since:
        1.8.7

    - #### <T> public static Collection<T> takeWhile(Iterable<T> self, @ClosureParams(FirstParam.FirstGenericType.class)
      Closure condition)

      Returns a Collection containing the longest prefix of the elements from this Iterable where each element passed to the given closure evaluates to true.

           class AbcIterable implements Iterable {
               Iterator iterator() { "abc".iterator() }
           }
           def abc = new AbcIterable()
           assert abc.takeWhile{ it < 'b' } == ['a']
           assert abc.takeWhile{ it <= 'b' } == ['a', 'b']

      Parameters:
        `self` - an Iterable
        `condition` - the closure that must evaluate to true to continue taking elements
      Returns:
        a Collection containing a prefix of the elements from the given Iterable where each element passed to the given closure evaluates to true
      Since:
        1.8.7

    - #### <T> public static SortedSet<T> takeWhile(SortedSet<T> self, @ClosureParams(FirstParam.FirstGenericType.class)
      Closure condition)

      Returns the longest prefix of this SortedSet where each element passed to the given closure condition evaluates to true. Similar to takeWhile(Iterable, groovy.lang.Closure) except that it attempts to preserve the type of the original SortedSet.

           def nums = [ 1, 2, 3 ] as SortedSet
           assert nums.takeWhile{ it < 1 } == [] as SortedSet
           assert nums.takeWhile{ it < 2 } == [ 1 ] as SortedSet
           assert nums.takeWhile{ it < 4 } == [ 1, 2, 3 ] as SortedSet

      Parameters:
        `self` - the original SortedSet
        `condition` - the closure that must evaluate to true to continue taking elements
      Returns:
        a prefix of the given SortedSet where each element passed to the given closure evaluates to true
      Since:
        2.4.0

    - #### <K, V> public static Map<K, V> takeWhile(Map<K, V> self, @ClosureParams(MapEntryOrKeyValue.class)
      Closure condition)

      Returns the longest prefix of this Map where each entry (or key/value pair) when passed to the given closure evaluates to true.

           def shopping = [milk:1, bread:2, chocolate:3]
           assert shopping.takeWhile{ it.key.size() < 6 } == [milk:1, bread:2]
           assert shopping.takeWhile{ it.value % 2 } == [milk:1]
           assert shopping.takeWhile{ k, v -> k.size() + v <= 7 } == [milk:1, bread:2]

      If the map instance does not have ordered keys, then this function could appear to take random entries. Groovy by default uses LinkedHashMap, so this shouldn't be an issue in the main.
      Parameters:
        `self` - a Map
        `condition` - a 1 (or 2) arg Closure that must evaluate to true for the entry (or key and value) to continue taking elements
      Returns:
        a prefix of the given Map where each entry (or key/value pair) passed to the given closure evaluates to true
      Since:
        1.8.7

    - #### <T> public static Iterator<T> takeWhile(Iterator<T> self, @ClosureParams(FirstParam.FirstGenericType.class)
      Closure condition)

      Returns the longest prefix of elements in this iterator where each element passed to the given condition closure evaluates to true.

           def a = 0
           def iter = [ hasNext:{ true }, next:{ a++ } ] as Iterator

           assert [].iterator().takeWhile{ it < 3 }.toList() == []
           assert [1, 2, 3, 4, 5].iterator().takeWhile{ it < 3 }.toList() == [ 1, 2 ]
           assert iter.takeWhile{ it < 5 }.toList() == [ 0, 1, 2, 3, 4 ]

      Parameters:
        `self` - the Iterator
        `condition` - the closure that must evaluate to true to continue taking elements
      Returns:
        a prefix of elements in the given iterator where each element passed to the given closure evaluates to true
      Since:
        1.8.7

    - #### <T> @Deprecated(since = "5.0.0")
      public static T[] takeWhile(T[] self, @ClosureParams(FirstParam.Component.class)
      Closure condition)

    - #### <T, U> public static U tap(@groovy.lang.DelegatesTo.Target
      U self, @DelegatesTo(strategy=Closure.DELEGATE_FIRST)
      @ClosureParams(FirstParam.class)
      Closure<T> closure)

      Allows the closure to be called for the object reference self (similar to `with`) and always returns self.

      Any method invoked inside the closure will first be invoked on the self reference. For instance, the following method calls to the append() method are invoked on the StringBuilder instance:

           def b = new StringBuilder().tap {
             append('foo')
             append('bar')
           }
           assert b.toString() == 'foobar'

      This is commonly used to simplify object creation, such as this example:

           def p = new Person().tap {
             firstName = 'John'
             lastName = 'Doe'
           }

      Parameters:
        `self` - the object to have a closure act upon
        `closure` - the closure to call on the object
      Returns:
        self
      See Also:
        with(Object, boolean, Closure)
        with(Object, Closure)
      Since:
        2.5.0

    - #### <T, U> public static Iterator<U> tapEvery(@groovy.lang.DelegatesTo.Target
      Iterator<U> self, int every, @DelegatesTo(genericTypeIndex = 0, strategy = Closure.DELEGATE_FIRST)
      @ClosureParams(FirstParam.FirstGenericType.class)
      Closure<T> closure)

      Allows the closure to be called for each (or some) elements in the iterator.

      Example:

           def items = (1..9).iterator()
           def collected = []
           assert items.tapEvery(3) { collected << it }.toList() == 1..9
           assert collected == [1, 4, 7]

      Parameters:
        `self` - an Iterator
        `closure` - the closure to call
        `every` - call the closure every this many elements
      Returns:
        an Iterator for the original elements
      Since:
        5.0.0

    - #### <T, U> public static Iterator<U> tapEvery(@groovy.lang.DelegatesTo.Target
      Iterator<U> self, @DelegatesTo(genericTypeIndex = 0, strategy = Closure.DELEGATE_FIRST)
      @ClosureParams(FirstParam.FirstGenericType.class)
      Closure<T> closure)

      Allows the closure to be called for each element in the iterator.

      Example:

           def items = (1..9).iterator()
           def collected = []
           assert items.tapEvery { collected << it }.toList() == 1..9
           assert collected == 1..9

           var nums = []
           assert [
               [x: 3, y: 4],
               [x: 5, y: 12],
               [x: 8, y: 15],
               [x: 7, y: 24]
           ].iterator().tapEvery {
               nums << Math.sqrt(x ** 2 + y ** 2).intValue()
           }*.x == [3, 5, 8, 7]
           assert nums == [5, 13, 17, 25]

      Parameters:
        `self` - an Iterator
        `closure` - the closure to call
      Returns:
        an Iterator for the original elements
      Since:
        5.0.0

    - #### public static void times(Number self, @ClosureParams(value=SimpleType.class,options="int")
      Closure closure)

      Executes the closure this many times, starting from zero. The current index is passed to the closure each time. Example:

          10.times {
             println it
           }

      Prints the numbers 0 through 9.
      Parameters:
        `self` - a Number
        `closure` - the closure to call a number of times
      Since:
        1.0

    - #### @Deprecated(since = "5.0.0")
      public static String toArrayString(Object[] self)

    - #### public static BigDecimal toBigDecimal(Number self)

      Transforms a Number into a BigDecimal.

      Parameters:
        `self` - a Number
      Returns:
        a BigDecimal
      Since:
        1.0

    - #### public static BigInteger toBigInteger(Number self)

      Transforms this Number into a BigInteger.

      Parameters:
        `self` - a Number
      Returns:
        a BigInteger
      Since:
        1.0

    - #### public static Boolean toBoolean(Boolean self)

      Identity conversion which returns Boolean.TRUE for a true Boolean and Boolean.FALSE for a false Boolean.

      Parameters:
        `self` - a Boolean
      Returns:
        the original Boolean
      Since:
        1.7.6

    - #### public static Double toDouble(Number self)

      Transforms a Number into a Double.

      Parameters:
        `self` - a Number
      Returns:
        a Double
      Since:
        1.0

    - #### public static Float toFloat(Number self)

      Transforms a Number into a Float.

      Parameters:
        `self` - a Number
      Returns:
        a Float
      Since:
        1.0

    - #### public static Integer toInteger(Number self)

      Transforms a Number into an Integer.

      Parameters:
        `self` - a Number
      Returns:
        an Integer
      Since:
        1.0

    - #### <T> public static List<T> toList(Iterator<T> self)

      Convert an iterator to a List. The iterator will become exhausted of elements after making this conversion.

      Parameters:
        `self` - an iterator
      Returns:
        a List of the elements from the iterator
      Since:
        1.5.0

    - #### <T> public static List<T> toList(Iterable<T> self)

      Convert an Iterable to a List. The Iterable's iterator will become exhausted of elements after making this conversion.

      Example usage:

          def x = [1,2,3] as HashSet
           assert x.class == HashSet
           assert x.toList() instanceof List

      Parameters:
        `self` - an Iterable
      Returns:
        a List
      Since:
        1.8.7

    - #### <T> public static List<T> toList(Enumeration<T> self)

      Convert an enumeration to a List.

      Parameters:
        `self` - an enumeration
      Returns:
        a List
      Since:
        1.5.0

    - #### @Deprecated(since = "5.0.0")
      public static List<Boolean> toList(boolean[] self)

    - #### @Deprecated(since = "5.0.0")
      public static List<Byte> toList(byte[] self)

    - #### @Deprecated(since = "5.0.0")
      public static List<Character> toList(char[] self)

    - #### @Deprecated(since = "5.0.0")
      public static List<Short> toList(short[] self)

    - #### @Deprecated(since = "5.0.0")
      public static List<Integer> toList(int[] self)

    - #### @Deprecated(since = "5.0.0")
      public static List<Long> toList(long[] self)

    - #### @Deprecated(since = "5.0.0")
      public static List<Float> toList(float[] self)

    - #### @Deprecated(since = "5.0.0")
      public static List<Double> toList(double[] self)

    - #### <T> @Deprecated(since = "5.0.0")
      public static List<T> toList(T[] self)

    - #### public static String toListString(Collection self)

      Returns the string representation of the given list. The string displays the contents of the list, similar to a list literal, i.e. `[1, 2, a]`.

      Parameters:
        `self` - a Collection
      Returns:
        the string representation
      Since:
        1.0

    - #### public static String toListString(Collection self, int maxSize)

      Returns the string representation of the given list. The string displays the contents of the list, similar to a list literal, i.e. `[1, 2, a]`.

      Parameters:
        `self` - a Collection
        `maxSize` - stop after approximately this many characters and append '...'
      Returns:
        the string representation
      Since:
        1.7.3

    - #### public static Long toLong(Number self)

      Transforms a Number into a Long.

      Parameters:
        `self` - a Number
      Returns:
        a Long
      Since:
        1.0

    - #### public static char toLowerCase(Character self)

      Converts the character to lowercase. Synonym for 'Character.toLowerCase(this)'.

      Parameters:
        `self` - a Character to convert
      Returns:
        the lowercase equivalent of the character, if any; otherwise, the character itself.
      See Also:
        Character.isLowerCase
        String.toLowerCase
      Since:
        1.5.7

    - #### public static String toMapString(Map self)

      Returns the string representation of this map. The string displays the contents of the map, i.e. `[one:1, two:2, three:3]`.

      Parameters:
        `self` - a Map
      Returns:
        the string representation
      Since:
        1.0

    - #### public static String toMapString(Map self, int maxSize)

      Returns the string representation of this map. The string displays the contents of the map, i.e. `[one:1, two:2, three:3]`.

      Parameters:
        `self` - a Map
        `maxSize` - stop after approximately this many characters and append '...'
      Returns:
        the string representation
      Since:
        1.0

    - #### <T> public static Set<T> toSet(Collection<T> self)

      Convert a Collection to a Set. Always returns a new Set even if the Collection is already a Set.

      Example usage:

           def result = [1, 2, 2, 2, 3].toSet()
           assert result instanceof Set
           assert result == [1, 2, 3] as Set

      Parameters:
        `self` - a collection
      Returns:
        a Set
      Since:
        1.8.0

    - #### <T> public static Set<T> toSet(Iterable<T> self)

      Convert an Iterable to a Set. Always returns a new Set even if the Iterable is already a Set.

      Example usage:

           def result = [1, 2, 2, 2, 3].toSet()
           assert result instanceof Set
           assert result == [1, 2, 3] as Set

      Parameters:
        `self` - an Iterable
      Returns:
        a Set
      Since:
        2.4.0

    - #### <T> public static Set<T> toSet(Iterator<T> self)

      Convert an iterator to a Set. The iterator will become exhausted of elements after making this conversion.

      Parameters:
        `self` - an iterator
      Returns:
        a Set
      Since:
        1.8.0

    - #### <T> public static Set<T> toSet(Enumeration<T> self)

      Convert an enumeration to a Set.

      Parameters:
        `self` - an enumeration
      Returns:
        a Set
      Since:
        1.8.0

    - #### @Deprecated(since = "5.0.0")
      public static Set<Boolean> toSet(boolean[] self)

    - #### @Deprecated(since = "5.0.0")
      public static Set<Byte> toSet(byte[] self)

    - #### @Deprecated(since = "5.0.0")
      public static Set<Character> toSet(char[] self)

    - #### @Deprecated(since = "5.0.0")
      public static Set<Short> toSet(short[] self)

    - #### @Deprecated(since = "5.0.0")
      public static Set<Integer> toSet(int[] self)

    - #### @Deprecated(since = "5.0.0")
      public static Set<Long> toSet(long[] self)

    - #### @Deprecated(since = "5.0.0")
      public static Set<Float> toSet(float[] self)

    - #### @Deprecated(since = "5.0.0")
      public static Set<Double> toSet(double[] self)

    - #### <T> public static List<T> toSorted(Iterable<T> self)

      Sorts the Iterable. Assumes that the Iterable elements are comparable and uses a NumberAwareComparator to determine the resulting order. `NumberAwareComparator` has special treatment for numbers but otherwise uses the natural ordering of the Iterable elements. The elements are first placed into a new list which is then sorted and returned - leaving the original Iterable unchanged.

           def orig = [1, 3, 2]
           def sorted = orig.toSorted()
           assert orig == [1, 3, 2]
           assert sorted == [1, 2, 3]

      Parameters:
        `self` - the Iterable to be sorted
      Returns:
        the sorted iterable as a List
      See Also:
        toSorted(Iterable, Comparator)
      Since:
        2.4.0

    - #### <T> public static List<T> toSorted(Iterable<T> self, Comparator<? super T> comparator)

      Sorts the Iterable using the given Comparator. The elements are first placed into a new list which is then sorted and returned - leaving the original Iterable unchanged.

           def orig = ["hello","hi","Hey"]
           def sorted = orig.toSorted(String.CASE_INSENSITIVE_ORDER)
           assert orig == ["hello","hi","Hey"]
           assert sorted == ["hello","Hey","hi"]

      Parameters:
        `self` - the Iterable to be sorted
        `comparator` - a Comparator used for the comparison
      Returns:
        a sorted List
      Since:
        2.4.0

    - #### <T> public static List<T> toSorted(Iterable<T> self, @ClosureParams(value=FromString.class, options={"T","T,T"})
      Closure closure)

      Sorts this Iterable using the given Closure to determine the correct ordering. The elements are first placed into a new list which is then sorted and returned - leaving the original Iterable unchanged.

      If the Closure has two parameters it is used like a traditional Comparator. I.e. it should compare its two parameters for order, returning a negative integer, zero, or a positive integer when the first parameter is less than, equal to, or greater than the second respectively. Otherwise, the Closure is assumed to take a single parameter and return a Comparable (typically an Integer) which is then used for further comparison.

          assert ["hi","hey","hello"] == ["hello","hi","hey"].sort { it.length() }

          assert ["hi","hey","hello"] == ["hello","hi","hey"].sort { a, b -> a.length() <=> b.length() }

      Parameters:
        `self` - the Iterable to be sorted
        `closure` - a 1 or 2 arg Closure used to determine the correct ordering
      Returns:
        a newly created sorted List
      See Also:
        toSorted(Iterable, Comparator)
      Since:
        2.4.0

    - #### <T> public static Iterator<T> toSorted(Iterator<T> self)

      Sorts the Iterator. Assumes that the Iterator elements are comparable and uses a NumberAwareComparator to determine the resulting order. `NumberAwareComparator` has special treatment for numbers but otherwise uses the natural ordering of the Iterator elements. A new iterator is produced that traverses the items in sorted order.

      The iterator is exhausted before elements are produced, so this method isn't suitable for use with infinite iterators.

      Parameters:
        `self` - the Iterator to be sorted
      Returns:
        the sorted items as an Iterator
      See Also:
        toSorted(Iterator, Comparator)
      Since:
        2.4.0

    - #### <T> public static Iterator<T> toSorted(Iterator<T> self, Comparator<? super T> comparator)

      Sorts the given iterator items using the comparator. The original iterator will become exhausted of elements after completing this method call. A new iterator is produced that traverses the items in sorted order.

      The iterator is exhausted before elements are produced, so this method isn't suitable for use with infinite iterators.

      Parameters:
        `self` - the Iterator to be sorted
        `comparator` - a Comparator used for comparing items
      Returns:
        the sorted items as an Iterator
      Since:
        2.4.0

    - #### <T> public static Iterator<T> toSorted(Iterator<T> self, @ClosureParams(value=FromString.class, options={"T","T,T"})
      Closure closure)

      Sorts the given iterator items into a sorted iterator using the Closure to determine the correct ordering. The original iterator will be fully processed after the method call.

      If the closure has two parameters it is used like a traditional Comparator. I.e. it should compare its two parameters for order, returning a negative integer, zero, or a positive integer when the first parameter is less than, equal to, or greater than the second respectively. Otherwise, the Closure is assumed to take a single parameter and return a Comparable (typically an Integer) which is then used for further comparison.

      The iterator is exhausted before elements are produced, so this method isn't suitable for use with infinite iterators.

      Parameters:
        `self` - the Iterator to be sorted
        `closure` - a Closure used to determine the correct ordering
      Returns:
        the sorted items as an Iterator
      See Also:
        toSorted(Iterator, Comparator)
      Since:
        2.4.0

    - #### <T> public static List<T> toSorted(List<T> self, IntRange range, @ClosureParams(value=FromString.class,options={"T","T,T"})
      Closure<?> closure)

      A sort variant that takes an index range and never modifies the original list.

           def nums = [5, 9, 1, 7, 3, 4, 8, 6, 0, 2]
           assert nums.toSorted(0..4) { it } == [1, 3, 5, 7, 9, 4, 8, 6, 0, 2]

      Parameters:
        `self` - the Iterable to be sorted
        `range` - the inclusive range of index values over which to sort
        `closure` - a Closure used for the comparison
      See Also:
        sort(List, IntRange, boolean, Closure)
      Returns:
        the sorted list
      Since:
        5.0.0

    - #### <T> public static List<T> toSorted(List<T> self, IntRange range, Comparator<? super T> comparator)

      Returns a list, sorted over the given range using a NumberAwareComparator, leaving the original list unmodified.

           def nums = [5, 9, 1, 7, 3, 4, 8, 6, 0, 2]
           assert nums.toSorted(0..4, Comparator.reverseOrder()) == [9, 7, 5, 3, 1, 4, 8, 6, 0, 2]
           assert nums.toSorted(5..-1, Comparator.reverseOrder()) == [5, 9, 1, 7, 3, 8, 6, 4, 2, 0]

      Parameters:
        `self` - the List to be sorted
        `range` - the inclusive range of index values over which to sort
        `comparator` - a Comparator used for the comparison
      See Also:
        sort(List, IntRange, boolean, Comparator)
      Returns:
        the sorted list
      Since:
        5.0.0

    - #### <T> public static List<T> toSorted(List<T> self, IntRange range)

      Returns a list, sorted over the given range using a NumberAwareComparator, leaving the original list unmodified.

           def nums = [5, 9, 1, 7, 3, 4, 8, 6, 0, 2]
           assert nums.toSorted(0..4) == [1, 3, 5, 7, 9, 4, 8, 6, 0, 2]
           assert nums.toSorted(5..-1) == [5, 9, 1, 7, 3, 0, 2, 4, 6, 8]

      Parameters:
        `self` - the List to be sorted
        `range` - the inclusive range of index values over which to sort
      See Also:
        toSorted(List, IntRange, Closure)
      Returns:
        the sorted list
      Since:
        5.0.0

    - #### <K, V> public static Map<K, V> toSorted(Map<K, V> self)

      Sorts the elements from the given map into a new ordered map using a NumberAwareComparator on map entry values to determine the resulting order. `NumberAwareComparator` has special treatment for numbers but otherwise uses the natural ordering of the Iterator elements. The original map is unchanged.

           def map = [a:5L, b:3, c:6, d:4.0].toSorted()
           assert map.toString() == '[b:3, d:4.0, a:5, c:6]'

      Parameters:
        `self` - the original unsorted map
      Returns:
        the sorted map
      Since:
        2.4.0

    - #### <K, V> public static Map<K, V> toSorted(Map<K, V> self, Comparator<Map.Entry<K, V>> comparator)

      Sorts the elements from the given map into a new ordered map using the supplied comparator to determine the ordering. The original map is unchanged.

           def keyComparator = [compare: { e1, e2 -> e1.key <=> e2.key }] as Comparator
           def valueComparator = [compare: { e1, e2 -> e1.value <=> e2.value }] as Comparator
           def map1 = [a:5, b:3, d:4, c:6].toSorted(keyComparator)
           assert map1.toString() == '[a:5, b:3, c:6, d:4]'
           def map2 = [a:5, b:3, d:4, c:6].toSorted(valueComparator)
           assert map2.toString() == '[b:3, d:4, a:5, c:6]'

      Parameters:
        `self` - the original unsorted map
        `comparator` - a Comparator used for the comparison
      Returns:
        the sorted map
      Since:
        2.4.0

    - #### <K, V> public static Map<K, V> toSorted(Map<K, V> self, @ClosureParams(value=FromString.class, options={"Map.Entry","Map.Entry,Map.Entry"})
      Closure condition)

      Sorts the elements from the given map into a new ordered map using the supplied Closure condition as a comparator to determine the ordering. The original map is unchanged.

      If the closure has two parameters it is used like a traditional Comparator. I.e. it should compare its two entry parameters for order, returning a negative integer, zero, or a positive integer when the first parameter is less than, equal to, or greater than the second respectively. Otherwise, the Closure is assumed to take a single entry parameter and return a Comparable (typically an Integer) which is then used for further comparison.

           def map = [a:5, b:3, c:6, d:4].toSorted { a, b -> a.value <=> b.value }
           assert map.toString() == '[b:3, d:4, a:5, c:6]'

      Parameters:
        `self` - the original unsorted map
        `condition` - a Closure used as a comparator
      Returns:
        the sorted map
      Since:
        2.4.0

    - #### <T> public static Set<T> toSorted(SortedSet<T> self)

      Avoids doing unnecessary work when sorting an already sorted set

      Parameters:
        `self` - an already sorted set
      Returns:
        an ordered copy of the sorted set
      Since:
        2.4.0

    - #### <K, V> public static Map<K, V> toSorted(SortedMap<K, V> self)

      Avoids doing unnecessary work when sorting an already sorted map

      Parameters:
        `self` - an already sorted map
      Returns:
        an ordered copy of the map
      Since:
        2.4.0

    - #### <T> @Deprecated(since = "5.0.0")
      public static T[] toSorted(T[] self)

    - #### <T> @Deprecated(since = "5.0.0")
      public static T[] toSorted(T[] self, Comparator<? super T> comparator)

    - #### <T> @Deprecated(since = "5.0.0")
      public static T[] toSorted(T[] self, @ClosureParams(value=FromString.class,options={"T","T,T"})
      Closure closure)

    - #### public static SpreadMap toSpreadMap(Map self)

      Returns a new `SpreadMap` from this map.

      The example below shows the various possible use cases:

           def fn(Map m) { return m.a + m.b + m.c + m.d }

           assert fn(a:1, b:2, c:3, d:4) == 10
           assert fn(a:1, *:[b:2, c:3], d:4) == 10
           assert fn([a:1, b:2, c:3, d:4].toSpreadMap()) == 10
           assert fn((['a', 1, 'b', 2, 'c', 3, 'd', 4] as Object[]).toSpreadMap()) == 10
           assert fn(['a', 1, 'b', 2, 'c', 3, 'd', 4].toSpreadMap()) == 10
           assert fn(['abcd'.toList(), 1..4].transpose().flatten().toSpreadMap()) == 10

      Note that toSpreadMap() is not normally used explicitly but under the covers by Groovy.
      Parameters:
        `self` - a map to be converted into a SpreadMap
      Returns:
        a newly created SpreadMap if this map is not null and its size is positive.
      See Also:
        SpreadMap.SpreadMap
      Since:
        1.0

    - #### public static SpreadMap toSpreadMap(List self)

      Creates a spreadable map from this list.

      Parameters:
        `self` - a list
      Returns:
        a newly created SpreadMap
      See Also:
        SpreadMap.SpreadMap
        toSpreadMap(java.util.Map)
      Since:
        1.8.0

    - #### @SuppressWarnings("unchecked")
      public static SpreadMap toSpreadMap(Iterable self)

      Creates a spreadable map from this iterable.

      Parameters:
        `self` - an iterable
      Returns:
        a newly created SpreadMap
      See Also:
        SpreadMap.SpreadMap
        toSpreadMap(java.util.Map)
      Since:
        2.4.0

    - #### @Deprecated(since = "5.0.0")
      public static SpreadMap toSpreadMap(Object[] self)

    - #### public static String toString(AbstractMap self)

      Returns the string representation of the given map.

      Parameters:
        `self` - a Map
      Returns:
        the string representation
      See Also:
        toMapString(java.util.Map)
      Since:
        1.0

    - #### public static String toString(AbstractCollection self)

      Returns the string representation of the given collection. The string displays the contents of the collection, i.e. `[1, 2, a]`.

      Parameters:
        `self` - a Collection
      Returns:
        the string representation
      See Also:
        toListString(java.util.Collection)
      Since:
        1.0

    - #### public static String toString(Object value)

      Create a String representation of this object.

      Parameters:
        `value` - an object
      Returns:
        a string.
      Since:
        1.0

    - #### @Deprecated(since = "5.0.0")
      public static String toString(boolean[] self)

    - #### @Deprecated(since = "5.0.0")
      public static String toString(byte[] self)

    - #### @Deprecated(since = "5.0.0")
      public static String toString(char[] self)

    - #### @Deprecated(since = "5.0.0")
      public static String toString(short[] self)

    - #### @Deprecated(since = "5.0.0")
      public static String toString(int[] self)

    - #### @Deprecated(since = "5.0.0")
      public static String toString(long[] self)

    - #### @Deprecated(since = "5.0.0")
      public static String toString(float[] self)

    - #### @Deprecated(since = "5.0.0")
      public static String toString(double[] self)

    - #### @Deprecated(since = "5.0.0")
      public static String toString(Object[] self)

    - #### <K, V> public static Tuple2<K, V> toTuple(Map.Entry<K, V> entry)

      Create a Tuple from the key and value of this Map Entry.

           assert [a:1, b:2, c:3]*.toTuple().toString() == '[[a, 1], [b, 2], [c, 3]]'
           assert [a:1, b:2, c:3].findAll(e -> e.toTuple().sum() != 'b2') == [a:1, c:3]

      Parameters:
        `entry` - a Map Entry
      Returns:
        a tuple containing the key and value.
      Since:
        5.0.0

    - #### <T> public static Iterator<T> toUnique(Iterator<T> self, @ClosureParams(value=FromString.class, options={"T","T,T"})
      Closure condition)

      Returns an iterator equivalent to this iterator but with all duplicated items removed where duplicate (equal) items are deduced by calling the supplied Closure condition.

      If the supplied Closure takes a single parameter, the argument passed will be each element, and the closure should return a value used for comparison (either using Comparable.compareTo or Object.equals). If the closure takes two parameters, two items from the Iterator will be passed as arguments, and the closure should return an int value (with 0 indicating the items are not unique).

           def items = "Hello".toList() + [null, null] + "there".toList()
           def toLower = { it == null ? null : it.toLowerCase() }
           def noDups = items.iterator().toUnique(toLower).toList()
           assert noDups == ['H', 'e', 'l', 'o', null, 't', 'r']

          assert [1,4] == [1,3,4,5].toUnique { it % 2 }

          assert [2,3,4] == [2,3,3,4].toUnique { a, b -> a <=> b }

      Parameters:
        `self` - an Iterator
        `condition` - a Closure used to determine unique items
      Returns:
        an Iterator with no duplicate items
      Since:
        2.4.0

    - #### <T> public static Iterator<T> toUnique(Iterator<T> self, Comparator<? super T> comparator)

      Returns an iterator equivalent to this iterator with all duplicated items removed by using the supplied comparator.

      Parameters:
        `self` - an Iterator
        `comparator` - a Comparator used to determine unique (equal) items If `null`, the Comparable natural ordering of the elements will be used.
      Returns:
        an Iterator with no duplicate items
      Since:
        2.4.0

    - #### <T> public static Iterator<T> toUnique(Iterator<T> self)

      Returns an iterator equivalent to this iterator with all duplicated items removed by using the natural ordering of the items.

      Parameters:
        `self` - an Iterator
      Returns:
        an Iterator with no duplicate items
      Since:
        2.4.0

    - #### <T> public static Collection<T> toUnique(Iterable<T> self, Comparator<? super T> comparator)

      Returns a Collection containing the items from the Iterable but with duplicates removed. The items in the Iterable are compared by the given Comparator. For each duplicate, the first member which is returned from the Iterable is retained, but all other ones are removed.

           class Person {
               def fname, lname
               String toString() {
                   return fname + " " + lname
               }
           }

           class PersonComparator implements Comparator {
               int compare(Object o1, Object o2) {
                   Person p1 = (Person) o1
                   Person p2 = (Person) o2
                   if (p1.lname != p2.lname)
                       return p1.lname.compareTo(p2.lname)
                   else
                       return p1.fname.compareTo(p2.fname)
               }

               boolean equals(Object obj) {
                   return this.equals(obj)
               }
           }

           Person a = new Person(fname:"John", lname:"Taylor")
           Person b = new Person(fname:"Clark", lname:"Taylor")
           Person c = new Person(fname:"Tom", lname:"Cruz")
           Person d = new Person(fname:"Clark", lname:"Taylor")

           def list = [a, b, c, d]
           List list2 = list.toUnique(new PersonComparator())
           assert list2 == [a, b, c] && list == [a, b, c, d]

      Parameters:
        `self` - an Iterable
        `comparator` - a Comparator used to determine unique (equal) items If `null`, the Comparable natural ordering of the elements will be used.
      Returns:
        the Collection of non-duplicate items
      Since:
        2.4.0

    - #### <T> public static List<T> toUnique(List<T> self, Comparator<? super T> comparator)

      Returns a List containing the items from the List but with duplicates removed. The items in the List are compared by the given Comparator. For each duplicate, the first member which is returned from the List is retained, but all other ones are removed.

           class Person {
               def fname, lname
               String toString() {
                   return fname + " " + lname
               }
           }

           class PersonComparator implements Comparator {
               int compare(Object o1, Object o2) {
                   Person p1 = (Person) o1
                   Person p2 = (Person) o2
                   if (p1.lname != p2.lname)
                       return p1.lname.compareTo(p2.lname)
                   else
                       return p1.fname.compareTo(p2.fname)
               }

               boolean equals(Object obj) {
                   return this.equals(obj)
               }
           }

           Person a = new Person(fname:"John", lname:"Taylor")
           Person b = new Person(fname:"Clark", lname:"Taylor")
           Person c = new Person(fname:"Tom", lname:"Cruz")
           Person d = new Person(fname:"Clark", lname:"Taylor")

           def list = [a, b, c, d]
           List list2 = list.toUnique(new PersonComparator())
           assert list2 == [a, b, c] && list == [a, b, c, d]

      Parameters:
        `self` - a List
        `comparator` - a Comparator used to determine unique (equal) items If `null`, the Comparable natural ordering of the elements will be used.
      Returns:
        the List of non-duplicate items
      Since:
        2.4.0

    - #### <T> public static Collection<T> toUnique(Iterable<T> self)

      Returns a Collection containing the items from the Iterable but with duplicates removed using the natural ordering of the items to determine uniqueness.

           String[] letters = ['c', 'a', 't', 's', 'a', 't', 'h', 'a', 't']
           String[] expected = ['c', 'a', 't', 's', 'h']
           assert letters.toUnique() == expected

      Parameters:
        `self` - an Iterable
      Returns:
        the Collection of non-duplicate items
      Since:
        2.4.0

    - #### <T> public static List<T> toUnique(List<T> self)

      Returns a List containing the items from the List but with duplicates removed using the natural ordering of the items to determine uniqueness.

           def letters = ['c', 'a', 't', 's', 'a', 't', 'h', 'a', 't']
           def expected = ['c', 'a', 't', 's', 'h']
           assert letters.toUnique() == expected

      Parameters:
        `self` - a List
      Returns:
        the List of non-duplicate items
      Since:
        2.4.0

    - #### <T> public static Collection<T> toUnique(Iterable<T> self, @ClosureParams(value = FromString.class, options = {"T", "T,T"})
      Closure condition)

      Returns a Collection containing the items from the Iterable but with duplicates removed. The items in the Iterable are compared by the given Closure condition. For each duplicate, the first member which is returned from the Iterable is retained, but all other ones are removed.

      If the closure takes a single parameter, each element from the Iterable will be passed to the closure. The closure should return a value used for comparison (either using Comparable.compareTo or Object.equals). If the closure takes two parameters, two items from the Iterable will be passed as arguments, and the closure should return an int value (with 0 indicating the items are not unique).

           class Person {
               def fname, lname
               String toString() {
                   return fname + " " + lname
               }
           }

           Person a = new Person(fname:"John", lname:"Taylor")
           Person b = new Person(fname:"Clark", lname:"Taylor")
           Person c = new Person(fname:"Tom", lname:"Cruz")
           Person d = new Person(fname:"Clark", lname:"Taylor")

           def list = [a, b, c, d]
           def list2 = list.toUnique{ p1, p2 -> p1.lname != p2.lname ? p1.lname <=> p2.lname : p1.fname <=> p2.fname }
           assert( list2 == [a, b, c] && list == [a, b, c, d] )
           def list3 = list.toUnique{ it.toString() }
           assert( list3 == [a, b, c] && list == [a, b, c, d] )

      Parameters:
        `self` - an Iterable
        `condition` - a Closure used to determine unique items
      Returns:
        a new Collection
      See Also:
        toUnique(Iterable, Comparator)
      Since:
        2.4.0

    - #### <T> public static List<T> toUnique(List<T> self, @ClosureParams(value = FromString.class, options = {"T", "T,T"})
      Closure condition)

      Returns a List containing the items from the List but with duplicates removed. The items in the List are compared by the given Closure condition. For each duplicate, the first member which is returned from the Iterable is retained, but all other ones are removed.

      If the closure takes a single parameter, each element from the Iterable will be passed to the closure. The closure should return a value used for comparison (either using Comparable.compareTo or Object.equals). If the closure takes two parameters, two items from the Iterable will be passed as arguments, and the closure should return an int value (with 0 indicating the items are not unique).

           class Person {
               def fname, lname
               String toString() {
                   return fname + " " + lname
               }
           }

           Person a = new Person(fname:"John", lname:"Taylor")
           Person b = new Person(fname:"Clark", lname:"Taylor")
           Person c = new Person(fname:"Tom", lname:"Cruz")
           Person d = new Person(fname:"Clark", lname:"Taylor")

           def list = [a, b, c, d]
           def list2 = list.toUnique{ p1, p2 -> p1.lname != p2.lname ? p1.lname <=> p2.lname : p1.fname <=> p2.fname }
           assert( list2 == [a, b, c] && list == [a, b, c, d] )
           def list3 = list.toUnique{ it.toString() }
           assert( list3 == [a, b, c] && list == [a, b, c, d] )

      Parameters:
        `self` - a List
        `condition` - a Closure used to determine unique items
      Returns:
        a new List
      See Also:
        toUnique(Iterable, Comparator)
      Since:
        2.4.0

    - #### <T> @Deprecated(since = "5.0.0")
      public static T[] toUnique(T[] self)

    - #### <T> @Deprecated(since = "5.0.0")
      public static T[] toUnique(T[] self, Comparator<? super T> comparator)

    - #### <T> @Deprecated(since = "5.0.0")
      public static T[] toUnique(T[] self, @ClosureParams(value=FromString.class, options={"T","T,T"})
      Closure closure)

    - #### public static char toUpperCase(Character self)

      Converts the character to uppercase. Synonym for 'Character.toUpperCase(this)'.

      Parameters:
        `self` - a Character to convert
      Returns:
        the uppercase equivalent of the character, if any; otherwise, the character itself.
      See Also:
        Character.isUpperCase
        String.toUpperCase
      Since:
        1.5.7

    - #### public static List transpose(List self)

      Adds GroovyCollections#transpose(List) as a method on lists. A Transpose Function takes a collection of columns and returns a collection of rows. The first row consists of the first element from each column. Successive rows are constructed similarly.

      Example usage:

           def result = [['a', 'b'], [1, 2]].transpose()
           assert result == [['a', 1], ['b', 2]]

           def result = [['a', 'b'], [1, 2], [3, 4]].transpose()
           assert result == [['a', 1, 3], ['b', 2, 4]]

      Parameters:
        `self` - a List of lists
      Returns:
        a List of the transposed lists
      See Also:
        GroovyCollections.transpose
      Since:
        1.5.0

    - #### @Deprecated(since = "5.0.0")
      public static int transpose(int self)

    - #### @Deprecated(since = "5.0.0")
      public static long transpose(long self)

    - #### @Deprecated(since = "5.0.0")
      public static double transpose(double self)

    - #### public static float trunc(Float number, int precision)

      Truncate the value

      Parameters:
        `number` - a Float
        `precision` - the number of decimal places to keep
      Returns:
        the Float truncated to the number of decimal places specified by precision
      Since:
        1.6.0

    - #### public static float trunc(Float number)

      Truncate the value

      Parameters:
        `number` - a Float
      Returns:
        the Float truncated to 0 decimal places
      Since:
        1.6.0

    - #### public static double trunc(Double number)

      Truncate the value

      Parameters:
        `number` - a Double
      Returns:
        the Double truncated to 0 decimal places
      Since:
        1.6.4

    - #### public static double trunc(Double number, int precision)

      Truncate the value

      Parameters:
        `number` - a Double
        `precision` - the number of decimal places to keep
      Returns:
        the Double truncated to the number of decimal places specified by precision
      Since:
        1.6.4

    - #### public static BigDecimal trunc(BigDecimal number)

      Truncate the value

      Parameters:
        `number` - a BigDecimal
      Returns:
        a BigDecimal truncated to 0 decimal places
      See Also:
        trunc(java.math.BigDecimal, int)
      Since:
        2.5.0

    - #### public static BigDecimal trunc(BigDecimal number, int precision)

      Truncate the value

      Parameters:
        `number` - a BigDecimal
        `precision` - the number of decimal places to keep
      Returns:
        a BigDecimal truncated to the number of decimal places specified by precision
      See Also:
        trunc(java.math.BigDecimal)
      Since:
        2.5.0

    - #### public static Number unaryMinus(Number left)

      Negates the number. Equivalent to the '-' operator when it precedes a single operand, i.e. `-10`

      Parameters:
        `left` - a Number
      Returns:
        the negation of the number
      Since:
        1.5.0

    - #### public static Number unaryPlus(Number left)

      Returns the number, effectively being a noop for numbers. Operator overloaded form of the '+' operator when it precedes a single operand, i.e. `+10`

      Parameters:
        `left` - a Number
      Returns:
        the number
      Since:
        2.2.0

    - #### <T> public static Collection<T> union(Collection<T> left, Collection<T> right)

      Create a Collection composed of the union of both collections. Any elements that exist in either collections are added to the resultant collection, such that no elements are duplicated in the resultant collection. For collections of custom objects; the objects should implement java.lang.Comparable

          assert [1,2,3,4,5,6,7,8] == [1,2,3,4,5].union([4,5,6,7,8])

      By default, Groovy uses a NumberAwareComparator when determining if an element exists in the resultant collection.
      Parameters:
        `left` - a Collection
        `right` - a Collection
      Returns:
        a Collection as a union of both collections
      See Also:
        union(Collection, Collection, Comparator)
      Since:
        5.0.0

    - #### <T> public static Collection<T> union(Collection<T> left, Collection<T> right, Comparator<? super T> comparator)

      Create a Collection composed of the union of both collections. Any elements that exist in either collections are added to the resultant collection, such that no elements are duplicated in the resultant collection. For collections of custom objects; the objects should implement java.lang.Comparable

           assert [1,2,3,4,5,6] == [1,2,3,4].union([3,4,5,6], Comparator.naturalOrder())
           assert [4,8,12,16,20,1,3] == [4,8,12,16,20].union([1,2,3,4], (x, y) -> x * x <=> y)

           def one = ['a', 'B', 'c', 'd']
           def two = ['b', 'C', 'd', 'e']
           def compareIgnoreCase = { a, b -> a.toLowerCase() <=> b.toLowerCase() }
           assert one.union(two) == ['a', 'B', 'c', 'd', 'b', 'C', 'e']
           assert two.union(one) == ['b', 'C', 'd', 'e', 'a', 'B', 'c']
           assert one.union(two, compareIgnoreCase) == ['a', 'B', 'c', 'd', 'e']
           assert two.union(one, compareIgnoreCase) == ['b', 'C', 'd', 'e', 'a']

      Parameters:
        `left` - a Collection
        `right` - a Collection
        `comparator` - a Comparator
      Returns:
        a Collection as a union of both collections
      Since:
        5.0.0

    - #### <T> public static Collection<T> union(Iterable<T> left, Iterable<T> right)

      Create a Collection composed of the union of both iterables. Any elements that exist in either iterables are added to the resultant collection, such that no elements are duplicated in the resultant collection. For iterables of custom objects; the objects should implement java.lang.Comparable

           assert [1,2,3,4,5,6,7,8] == [1,2,3,4,5].union([4,5,6,7,8])

      By default, Groovy uses a NumberAwareComparator when determining if an element already exists in the resultant collection.
      Parameters:
        `left` - an Iterable
        `right` - an Iterable
      Returns:
        a Collection as a union of both iterables
      See Also:
        union(Iterable, Iterable, Comparator)
      Since:
        5.0.0

    - #### <T> public static Collection<T> union(Iterable<T> left, Iterable<T> right, Comparator<? super T> comparator)

      Create a Collection composed of the union of both iterables. Any elements that exist in either iterables are added to the resultant collection, such that no elements are duplicated in the resultant collection. For iterables of custom objects; the objects should implement java.lang.Comparable

           assert [1,2,3,4,5,6] == [1,2,3,4].union([3,4,5,6], Comparator.naturalOrder())

      Parameters:
        `left` - an Iterable
        `right` - an Iterable
        `comparator` - a Comparator
      Returns:
        a Collection as a union of both iterables
      Since:
        5.0.0

    - #### <T> public static Collection<T> union(Iterable<T> left, Iterable<T> right, @ClosureParams(value=FromString.class, options={"T","T,T"})
      Closure condition)

      Create a Collection composed of the union of both iterables. Elements from the first iterable and second iterable are added to the result if the elements are not already in the result (according to the comparator closure). If the closure takes a single parameter, the argument passed will be each element, and the closure should return a value used for comparison (either using Comparable.compareTo or Object.equals). If the closure takes two parameters, two items from the Iterator will be passed as arguments, and the closure should return an int value (with 0 indicating the items are deemed equal).

           def one = ['a', 'B', 'c', 'd']
           def two = ['b', 'C', 'd', 'e']
           def compareIgnoreCase = { it.toLowerCase() }
           assert one.union(two, compareIgnoreCase) == ['a', 'B', 'c', 'd', 'e']
           assert two.union(one, compareIgnoreCase) == ['b', 'C', 'd', 'e', 'a']

      Parameters:
        `left` - an Iterable
        `right` - an Iterable
        `condition` - a Closure used to determine unique items
      Returns:
        a Collection as a union of both iterables
      Since:
        5.0.0

    - #### <T> public static List<T> union(List<T> left, Iterable<T> right)

      Create a List composed of the union of a List and an Iterable. Any elements that exist in both iterables are added to the resultant collection, such that no elements are duplicated in the resultant collection.

           assert [1,2,3,4,5,6,7,8] == [1,2,3,4,5].union([4,5,6,7,8])

      By default, Groovy uses a NumberAwareComparator when determining if an element already exists in the resultant collection.
      Parameters:
        `left` - a List
        `right` - an Iterable
      Returns:
        a List as a union of a List and an Iterable
      See Also:
        union(List, Iterable, Comparator)
      Since:
        5.0.0

    - #### <T> public static List<T> union(List<T> left, Iterable<T> right, Comparator<? super T> comparator)

      Create a List composed of the union of a List and an Iterable. Any elements that exist in either iterables are added to the resultant collection, such that no elements are duplicated in the resultant collection.

           assert [1,2,3,4,5,6] == [1,2,3,4].union([3,4,5,6])

      Parameters:
        `left` - a List
        `right` - an Iterable
        `comparator` - a Comparator
      Returns:
        a List as a union of a List and an Iterable
      Since:
        5.0.0

    - #### <T> public static Set<T> union(Set<T> left, Iterable<T> right)

      Create a Set composed of the union of a Set and an Iterable. Any elements that exist in either iterables are added to the resultant collection, such that no elements are duplicated in the resultant collection.

           assert [1,2,3,4,5,6,7,8] as Set == ([1,2,3,4,5] as Set).union([4,5,6,7,8])

      By default, Groovy uses a NumberAwareComparator when determining if an element already exists in the resultant collection.
      Parameters:
        `left` - a Set
        `right` - an Iterable
      Returns:
        a Set as a union of a Set and an Iterable
      See Also:
        union(Set, Iterable, Comparator)
      Since:
        5.0.0

    - #### <T> public static Set<T> union(Set<T> left, Iterable<T> right, Comparator<? super T> comparator)

      Create a Set composed of the union of a Set and an Iterable. Any elements that exist in either iterables are added to the resultant collection, such that no elements are duplicated in the resultant collection.

           assert [1,2,3,4,5,6] as Set == ([1,2,3,4] as Set).union([3,4,5,6], Comparator.naturalOrder())

      Parameters:
        `left` - a Set
        `right` - an Iterable
        `comparator` - a Comparator
      Returns:
        a Set as a union of a Set and an Iterable
      Since:
        5.0.0

    - #### <T> public static SortedSet<T> union(SortedSet<T> left, Iterable<T> right)

      Create a SortedSet composed of the union of a SortedSet and an Iterable. Any elements that exist in either iterables are added to the resultant collection, such that no elements are duplicated in the resultant collection.

           assert [1,2,3,4,5,6,7,8] as SortedSet == ([1,2,3,4,5] as SortedSet).union([4,5,6,7,8])

      By default, Groovy uses a NumberAwareComparator when determining if an element already exists in the resultant collection.
      Parameters:
        `left` - a SortedSet
        `right` - an Iterable
      Returns:
        a Set as a union of a SortedSet and an Iterable
      See Also:
        intersect(SortedSet, Iterable, Comparator)
      Since:
        5.0.0

    - #### <T> public static SortedSet<T> union(SortedSet<T> left, Iterable<T> right, Comparator<? super T> comparator)

      Create a SortedSet composed of the intersection of a SortedSet and an Iterable. Any elements that exist in either iterables are added to the resultant collection, such that no elements are duplicated in the resultant collection.

           assert [1,2,3,4,5,6,7,8] as SortedSet == ([1,2,3,4,5] as SortedSet).union([4,5,6,7,8])

      Parameters:
        `left` - a SortedSet
        `right` - an Iterable
        `comparator` - a Comparator
      Returns:
        a Set as a union of a SortedSet and an Iterable
      Since:
        2.5.0

    - #### @Deprecated(since = "5.0.0")
      public static Object[] union(Object[] left, Collection<?> right)

    - #### @Deprecated(since = "5.0.0")
      public static Object[] union(Object[] left, Iterable<?> right)

    - #### @Deprecated(since = "5.0.0")
      public static Object[] union(Object[] left, Object[] right)

    - #### @Deprecated(since = "5.0.0")
      public static Object[] union(Object[] left, Object right)

    - #### <T> public static Iterator<T> unique(Iterator<T> self)

      Returns an iterator equivalent to this iterator with all duplicated items removed by using Groovy's default number-aware comparator. The original iterator will become exhausted of elements after determining the unique values. A new iterator for the unique values will be returned.

      Parameters:
        `self` - an Iterator
      Returns:
        a new Iterator of the unique items from the original iterator
      Since:
        1.5.5

    - #### <T> public static Collection<T> unique(Collection<T> self)

      Modifies this collection to remove all duplicated items, using Groovy's default number-aware comparator.

          assert [1,3] == [1,3,3].unique()

      Parameters:
        `self` - a collection
      Returns:
        the now modified collection
      See Also:
        unique(Collection, boolean)
      Since:
        1.0

    - #### <T> public static List<T> unique(List<T> self)

      Modifies this List to remove all duplicated items, using Groovy's default number-aware comparator.

          assert [1,3] == [1,3,3].unique()

      Parameters:
        `self` - a List
      Returns:
        the now modified List
      See Also:
        unique(Collection, boolean)
      Since:
        2.4.0

    - #### <T> public static Collection<T> unique(Collection<T> self, boolean mutate)

      Remove all duplicates from a given Collection using Groovy's default number-aware comparator. If mutate is true, it works by modifying the original object (and also returning it). If mutate is false, a new collection is returned leaving the original unchanged.

           assert [1,3] == [1,3,3].unique()

           def orig = [1, 3, 2, 3]
           def uniq = orig.unique(false)
           assert orig == [1, 3, 2, 3]
           assert uniq == [1, 3, 2]

      Parameters:
        `self` - a collection
        `mutate` - false will return a new collection containing the unique items from the collection, true will mutate collections in place and return the original collection
      Returns:
        a collection with unique elements
      Since:
        1.8.1

    - #### <T> public static List<T> unique(List<T> self, boolean mutate)

      Remove all duplicates from a given List using Groovy's default number-aware comparator. If mutate is true, it works by modifying the original object (and also returning it). If mutate is false, a new collection is returned leaving the original unchanged.

           assert [1,3] == [1,3,3].unique()

           def orig = [1, 3, 2, 3]
           def uniq = orig.unique(false)
           assert orig == [1, 3, 2, 3]
           assert uniq == [1, 3, 2]

      Parameters:
        `self` - a List
        `mutate` - false will cause a new List containing unique items from the List to be created, true will mutate List in place
      Returns:
        the now modified List
      Since:
        2.4.0

    - #### <T> public static Iterator<T> unique(Iterator<T> self, @ClosureParams(value=FromString.class, options={"T","T,T"})
      Closure condition)

      Returns an iterator equivalent to this iterator but with all duplicated items removed by using a Closure to determine duplicate (equal) items. The original iterator will be fully processed after the call.

      If the closure takes a single parameter, the argument passed will be each element, and the closure should return a value used for comparison (either using Comparable.compareTo or Object.equals). If the closure takes two parameters, two items from the Iterator will be passed as arguments, and the closure should return an int value (with 0 indicating the items are not unique).

      Parameters:
        `self` - an Iterator
        `condition` - a Closure used to determine unique items
      Returns:
        the modified Iterator
      Since:
        1.5.5

    - #### <T> public static Collection<T> unique(Collection<T> self, @ClosureParams(value=FromString.class, options={"T","T,T"})
      Closure closure)

      A convenience method for making a collection unique using a Closure to determine duplicate (equal) items.

      If the closure takes a single parameter, the argument passed will be each element, and the closure should return a value used for comparison (either using Comparable.compareTo or Object.equals). If the closure takes two parameters, two items from the collection will be passed as arguments, and the closure should return an int value (with 0 indicating the items are not unique).

          assert [1,4] == [1,3,4,5].unique { it % 2 }

          assert [2,3,4] == [2,3,3,4].unique { a, b -> a <=> b }

      Parameters:
        `self` - a Collection
        `closure` - a 1 or 2 arg Closure used to determine unique items
      Returns:
        self without any duplicates
      See Also:
        unique(Collection, boolean, Closure)
      Since:
        1.0

    - #### <T> public static List<T> unique(List<T> self, @ClosureParams(value=FromString.class, options={"T","T,T"})
      Closure closure)

      A convenience method for making a List unique using a Closure to determine duplicate (equal) items.

      If the closure takes a single parameter, the argument passed will be each element, and the closure should return a value used for comparison (either using Comparable.compareTo or Object.equals). If the closure takes two parameters, two items from the List will be passed as arguments, and the closure should return an int value (with 0 indicating the items are not unique).

          assert [1,4] == [1,3,4,5].unique { it % 2 }

          assert [2,3,4] == [2,3,3,4].unique { a, b -> a <=> b }

      Parameters:
        `self` - a List
        `closure` - a 1 or 2 arg Closure used to determine unique items
      Returns:
        self without any duplicates
      See Also:
        unique(Collection, boolean, Closure)
      Since:
        2.4.0

    - #### <T> public static Collection<T> unique(Collection<T> self, boolean mutate, @ClosureParams(value=FromString.class, options={"T","T,T"})
      Closure closure)

      A convenience method for making a collection unique using a Closure to determine duplicate (equal) items. If mutate is true, it works on the receiver object and returns it. If mutate is false, a new collection is returned.

      If the closure takes a single parameter, each element from the Collection will be passed to the closure. The closure should return a value used for comparison (either using Comparable.compareTo or Object.equals). If the closure takes two parameters, two items from the collection will be passed as arguments, and the closure should return an int value (with 0 indicating the items are not unique).

           def orig = [1, 3, 4, 5]
           def uniq = orig.unique(false) { it % 2 }
           assert orig == [1, 3, 4, 5]
           assert uniq == [1, 4]

           def orig = [2, 3, 3, 4]
           def uniq = orig.unique(false) { a, b -> a <=> b }
           assert orig == [2, 3, 3, 4]
           assert uniq == [2, 3, 4]

      Parameters:
        `self` - a Collection
        `mutate` - false will always cause a new list to be created, true will mutate lists in place
        `closure` - a 1 or 2 arg Closure used to determine unique items
      Returns:
        self without any duplicates
      Since:
        1.8.1

    - #### <T> public static List<T> unique(List<T> self, boolean mutate, @ClosureParams(value=FromString.class, options={"T","T,T"})
      Closure closure)

      A convenience method for making a List unique using a Closure to determine duplicate (equal) items. If mutate is true, it works on the receiver object and returns it. If mutate is false, a new collection is returned.

      If the closure takes a single parameter, each element from the List will be passed to the closure. The closure should return a value used for comparison (either using Comparable.compareTo or Object.equals). If the closure takes two parameters, two items from the collection will be passed as arguments, and the closure should return an int value (with 0 indicating the items are not unique).

           def orig = [1, 3, 4, 5]
           def uniq = orig.unique(false) { it % 2 }
           assert orig == [1, 3, 4, 5]
           assert uniq == [1, 4]

           def orig = [2, 3, 3, 4]
           def uniq = orig.unique(false) { a, b -> a <=> b }
           assert orig == [2, 3, 3, 4]
           assert uniq == [2, 3, 4]

      Parameters:
        `self` - a List
        `mutate` - false will always cause a new list to be created, true will mutate lists in place
        `closure` - a 1 or 2 arg Closure used to determine unique items
      Returns:
        self without any duplicates
      Since:
        2.4.0

    - #### <T> public static Iterator<T> unique(Iterator<T> self, Comparator<? super T> comparator)

      Returns an iterator equivalent to this iterator with all duplicated items removed by using the supplied comparator. The original iterator will be exhausted upon returning.

      Parameters:
        `self` - an Iterator
        `comparator` - a Comparator
      Returns:
        the modified Iterator
      Since:
        1.5.5

    - #### <T> public static Collection<T> unique(Collection<T> self, Comparator<? super T> comparator)

      Remove all duplicates from a given Collection. Works on the original object (and also returns it). The order of members in the Collection are compared by the given Comparator. For each duplicate, the first member which is returned by the given Collection's iterator is retained, but all other ones are removed. The given Collection's original order is preserved.

           class Person {
               def fname, lname
               String toString() {
                   return fname + " " + lname
               }
           }

           class PersonComparator implements Comparator {
               int compare(Object o1, Object o2) {
                   Person p1 = (Person) o1
                   Person p2 = (Person) o2
                   if (p1.lname != p2.lname)
                       return p1.lname.compareTo(p2.lname)
                   else
                       return p1.fname.compareTo(p2.fname)
               }

               boolean equals(Object obj) {
                   return this.equals(obj)
               }
           }

           Person a = new Person(fname:"John", lname:"Taylor")
           Person b = new Person(fname:"Clark", lname:"Taylor")
           Person c = new Person(fname:"Tom", lname:"Cruz")
           Person d = new Person(fname:"Clark", lname:"Taylor")

           def list = [a, b, c, d]
           List list2 = list.unique(new PersonComparator())
           assert( list2 == list && list == [a, b, c] )

      Parameters:
        `self` - a Collection
        `comparator` - a Comparator
      Returns:
        self the now modified collection without duplicates
      See Also:
        unique(java.util.Collection, boolean, java.util.Comparator)
      Since:
        1.0

    - #### <T> public static List<T> unique(List<T> self, Comparator<? super T> comparator)

      Remove all duplicates from a given List. Works on the original object (and also returns it). The order of members in the List are compared by the given Comparator. For each duplicate, the first member which is returned by the given List's iterator is retained, but all other ones are removed. The given List's original order is preserved.

           class Person {
               def fname, lname
               String toString() {
                   return fname + " " + lname
               }
           }

           class PersonComparator implements Comparator {
               int compare(Object o1, Object o2) {
                   Person p1 = (Person) o1
                   Person p2 = (Person) o2
                   if (p1.lname != p2.lname)
                       return p1.lname.compareTo(p2.lname)
                   else
                       return p1.fname.compareTo(p2.fname)
               }

               boolean equals(Object obj) {
                   return this.equals(obj)
               }
           }

           Person a = new Person(fname:"John", lname:"Taylor")
           Person b = new Person(fname:"Clark", lname:"Taylor")
           Person c = new Person(fname:"Tom", lname:"Cruz")
           Person d = new Person(fname:"Clark", lname:"Taylor")

           def list = [a, b, c, d]
           List list2 = list.unique(new PersonComparator())
           assert( list2 == list && list == [a, b, c] )

      Parameters:
        `self` - a List
        `comparator` - a Comparator
      Returns:
        self the now modified List without duplicates
      See Also:
        unique(java.util.Collection, boolean, java.util.Comparator)
      Since:
        2.4.0

    - #### <T> public static Collection<T> unique(Collection<T> self, boolean mutate, Comparator<? super T> comparator)

      Remove all duplicates from a given Collection. If mutate is true, it works on the original object (and also returns it). If mutate is false, a new collection is returned. The order of members in the Collection are compared by the given Comparator. For each duplicate, the first member which is returned by the given Collection's iterator is retained, but all other ones are removed. The given Collection's original order is preserved.

           class Person {
               def fname, lname
               String toString() {
                   return fname + " " + lname
               }
           }

           class PersonComparator implements Comparator {
               int compare(Object o1, Object o2) {
                   Person p1 = (Person) o1
                   Person p2 = (Person) o2
                   if (p1.lname != p2.lname)
                       return p1.lname.compareTo(p2.lname)
                   else
                       return p1.fname.compareTo(p2.fname)
               }

               boolean equals(Object obj) {
                   return this.equals(obj)
               }
           }

           Person a = new Person(fname:"John", lname:"Taylor")
           Person b = new Person(fname:"Clark", lname:"Taylor")
           Person c = new Person(fname:"Tom", lname:"Cruz")
           Person d = new Person(fname:"Clark", lname:"Taylor")

           def list = [a, b, c, d]
           List list2 = list.unique(false, new PersonComparator())
           assert( list2 != list && list2 == [a, b, c] )

      Parameters:
        `self` - a Collection
        `mutate` - false will always cause a new collection to be created, true will mutate collections in place
        `comparator` - a Comparator
      Returns:
        self the collection without duplicates
      Since:
        1.8.1

    - #### <T> public static List<T> unique(List<T> self, boolean mutate, Comparator<? super T> comparator)

      Remove all duplicates from a given List. If mutate is true, it works on the original object (and also returns it). If mutate is false, a new List is returned. The order of members in the List are compared by the given Comparator. For each duplicate, the first member which is returned by the given List's iterator is retained, but all other ones are removed. The given List's original order is preserved.

           class Person {
               def fname, lname
               String toString() {
                   return fname + " " + lname
               }
           }

           class PersonComparator implements Comparator {
               int compare(Object o1, Object o2) {
                   Person p1 = (Person) o1
                   Person p2 = (Person) o2
                   if (p1.lname != p2.lname)
                       return p1.lname.compareTo(p2.lname)
                   else
                       return p1.fname.compareTo(p2.fname)
               }

               boolean equals(Object obj) {
                   return this.equals(obj)
               }
           }

           Person a = new Person(fname:"John", lname:"Taylor")
           Person b = new Person(fname:"Clark", lname:"Taylor")
           Person c = new Person(fname:"Tom", lname:"Cruz")
           Person d = new Person(fname:"Clark", lname:"Taylor")

           def list = [a, b, c, d]
           List list2 = list.unique(false, new PersonComparator())
           assert( list2 != list && list2 == [a, b, c] )

      Parameters:
        `self` - a List
        `mutate` - false will always cause a new List to be created, true will mutate List in place
        `comparator` - a Comparator
      Returns:
        self the List without duplicates
      Since:
        2.4.0

    - #### public static void upto(Number self, Number to, @ClosureParams(FirstParam.class)
      Closure closure)

      Iterates from this number up to the given number, inclusive, incrementing by one each time.

      Parameters:
        `self` - a Number
        `to` - another Number to go up to
        `closure` - the closure to call
      Since:
        1.0

    - #### public static void upto(long self, Number to, @ClosureParams(FirstParam.class)
      Closure closure)

      Iterates from this number up to the given number, inclusive, incrementing by one each time.

      Parameters:
        `self` - a long
        `to` - the end number
        `closure` - the code to execute for each number
      Since:
        1.0

    - #### public static void upto(Long self, Number to, @ClosureParams(FirstParam.class)
      Closure closure)

      Iterates from this number up to the given number, inclusive, incrementing by one each time.

      Parameters:
        `self` - a Long
        `to` - the end number
        `closure` - the code to execute for each number
      Since:
        1.0

    - #### public static void upto(float self, Number to, @ClosureParams(FirstParam.class)
      Closure closure)

      Iterates from this number up to the given number, inclusive, incrementing by one each time.

      Parameters:
        `self` - a float
        `to` - the end number
        `closure` - the code to execute for each number
      Since:
        1.0

    - #### public static void upto(Float self, Number to, @ClosureParams(FirstParam.class)
      Closure closure)

      Iterates from this number up to the given number, inclusive, incrementing by one each time.

      Parameters:
        `self` - a Float
        `to` - the end number
        `closure` - the code to execute for each number
      Since:
        1.0

    - #### public static void upto(double self, Number to, @ClosureParams(FirstParam.class)
      Closure closure)

      Iterates from this number up to the given number, inclusive, incrementing by one each time.

      Parameters:
        `self` - a double
        `to` - the end number
        `closure` - the code to execute for each number
      Since:
        1.0

    - #### public static void upto(Double self, Number to, @ClosureParams(FirstParam.class)
      Closure closure)

      Iterates from this number up to the given number, inclusive, incrementing by one each time.

      Parameters:
        `self` - a Double
        `to` - the end number
        `closure` - the code to execute for each number
      Since:
        1.0

    - #### public static void upto(BigInteger self, Number to, @ClosureParams(FirstParam.class)
      Closure closure)

      Iterates from this number up to the given number, inclusive, incrementing by one each time. Example:

          0.upto( 10 ) {
             println it
           }

      Prints numbers 0 to 10
      Parameters:
        `self` - a BigInteger
        `to` - the end number
        `closure` - the code to execute for each number
      Since:
        1.0

    - #### public static void upto(BigDecimal self, Number to, @ClosureParams(FirstParam.class)
      Closure closure)

      Iterates from this number up to the given number, inclusive, incrementing by one each time.

          0.1.upto( 10 ) {
             println it
           }

      Prints numbers 0.1, 1.1, 2.1... to 9.1
      Parameters:
        `self` - a BigDecimal
        `to` - the end number
        `closure` - the code to execute for each number
      Since:
        1.0

    - #### <T> public static T use(Object self, Class categoryClass, Closure<T> closure)

      Scoped use method

      Parameters:
        `self` - any Object
        `categoryClass` - a category class to use
        `closure` - the closure to invoke with the category in place
      Returns:
        the value returned from the closure
      Since:
        1.0

    - #### <T> public static T use(Object self, List<Class> categoryClassList, Closure<T> closure)

      Scoped use method with list of categories.

      Parameters:
        `self` - any Object
        `categoryClassList` - a list of category classes
        `closure` - the closure to invoke with the categories in place
      Returns:
        the value returned from the closure
      Since:
        1.0

    - #### @SuppressWarnings("unchecked")
      public static Object use(Object self, Object[] array)

      Allows you to use a list of categories, specifying the list as varargs. `use(CategoryClass1, CategoryClass2) { ... }` This method saves having to wrap the category classes in a list.

      Parameters:
        `self` - any Object
        `array` - a list of category classes and a Closure
      Returns:
        the value returned from the closure
      Since:
        1.0

    - #### <T, U> public static T with(@groovy.lang.DelegatesTo.Target
      U self, @DelegatesTo(strategy=Closure.DELEGATE_FIRST)
      @ClosureParams(FirstParam.class)
      Closure<T> closure)

      Allows the closure to be called for the object reference self.

      Any method invoked inside the closure will first be invoked on the self reference. For instance, the following method calls to the append() method are invoked on the StringBuilder instance:

           def b = new StringBuilder().with {
             append('foo')
             append('bar')
             return it
           }
           assert b.toString() == 'foobar'

      This is commonly used to simplify object creation, such as this example:

           def p = new Person().with {
             firstName = 'John'
             lastName = 'Doe'
             return it
           }

      The other typical usage, uses the self object while creating some value:

           def fullName = person.with{ "$firstName $lastName" }

      Parameters:
        `self` - the object to have a closure act upon
        `closure` - the closure to call on the object
      Returns:
        result of calling the closure
      See Also:
        with(Object, boolean, Closure)
        tap(Object, Closure)
      Since:
        1.5.0

    - #### <T, U extends T, V extends T> public static T with(@groovy.lang.DelegatesTo.Target
      U self, boolean returnIt, @DelegatesTo(strategy=Closure.DELEGATE_FIRST)
      @ClosureParams(FirstParam.class)
      Closure<V> closure)

      Allows the closure to be called for the object reference self.

      Any method invoked inside the closure will first be invoked on the self reference. For example, the following method calls to the append() method are invoked on the StringBuilder instance and then, because 'returning' is true, the self instance is returned:

           def b = new StringBuilder().with(true) {
             append('foo')
             append('bar')
           }
           assert b.toString() == 'foobar'

      The returning parameter is commonly set to true when using with to simplify object creation, such as this example:

           def p = new Person().with(true) {
             firstName = 'John'
             lastName = 'Doe'
           }

      Alternatively, 'tap' is an alias for 'with(true)', so that method can be used instead. The other main use case for with is when returning a value calculated using self as shown here:

           def fullName = person.with(false){ "$firstName $lastName" }

      Alternatively, 'with' is an alias for 'with(false)', so the boolean parameter can be omitted instead.
      Parameters:
        `self` - the object to have a closure act upon
        `returnIt` - if true, return the self object; otherwise, the result of calling the closure
        `closure` - the closure to call on the object
      Returns:
        the self object or the result of calling the closure depending on `returnIt`
      See Also:
        with(Object, Closure)
        tap(Object, Closure)
      Since:
        2.5.0

    - #### <K, V> public static Map<K, V> withCollectedKeys(Iterator<V> values, Map<K, V> collector, Function<? super V, K> keyTransform)

      A variant of withCollectedKeys for Iterators.

      Parameters:
        `values` - an Iterator
        `collector` - the Map into which the transformed entries are put
        `keyTransform` - a function for transforming Iterator elements into values
      Returns:
        the collector with all transformed values added to it
      See Also:
        withCollectedKeys(Iterable, Map, Function)
      Since:
        5.0.0

    - #### <K, V> public static Map<K, V> withCollectedKeys(Iterator<V> values, Function<? super V, K> keyTransform)

      A variant of withCollectedKeys for Iterators.

      Parameters:
        `values` - an Iterator
        `keyTransform` - a function for transforming Iterator elements into values
      Returns:
        a Map of the transformed entries
      See Also:
        withCollectedKeys(Iterable, Function)
      Since:
        5.0.0

    - #### <K, V> public static Map<K, V> withCollectedKeys(Iterable<V> values, Map<K, V> collector, Function<? super V, K> keyTransform)

      Transform Iterable elements into Map entries with values unchanged and keys transformed using the supplied function. The supplied map is used as the destination for transformed entries.

           def languages = ['Groovy', 'Java', 'Kotlin', 'Scala']
           def firstLetter = s -> s[0]
           assert languages.withCollectedKeys([C:'Clojure'], firstLetter) ==
               [C:'Clojure', G:'Groovy', J:'Java', K:'Kotlin', S:'Scala']

      This method is a convenience method for collectEntries(Iterable, Map, Function, Function) with the `valueTransform` replaced by `Function.identity()` or {Closure.IDENTITY}.
      Parameters:
        `values` - an Iterable that will become the added entry values
        `collector` - the Map into which the transformed entries are put
        `keyTransform` - a function for transforming Iterator elements into keys
      Returns:
        the collector with all transformed values added to it
      Since:
        5.0.0

    - #### <K, V> public static Map<K, V> withCollectedKeys(Iterable<V> values, Function<? super V, K> keyTransform)

      Transform Iterable elements into Map entries with values unchanged and keys transformed using the supplied function.

           def languages = ['Groovy', 'Java', 'Kotlin', 'Scala']
           def firstLetter = s -> s[0]
           assert languages.withCollectedKeys(firstLetter) ==
               [G:'Groovy', J:'Java', K:'Kotlin', S:'Scala']

      This method is a convenience method for collectEntries(Iterable, Function, Function) with the `valueTransform` replaced by `Function.identity()` or {Closure.IDENTITY}.
      Parameters:
        `values` - an Iterable that will become the added entry values
        `keyTransform` - a function for transforming Iterator elements into keys
      Returns:
        the collector with all transformed values added to it
      Since:
        5.0.0

    - #### <K, V> public static Map<K, V> withCollectedValues(Iterator<K> keys, Map<K, V> collector, Function<? super K, V> valueTransform)

      A variant of withCollectedValues for Iterators.

      Parameters:
        `keys` - an Iterator
        `collector` - the Map into which the transformed entries are put
        `valueTransform` - a function for transforming Iterator elements into values
      Returns:
        the collector with all transformed values added to it
      See Also:
        withCollectedValues(Iterable, Map, Function)
      Since:
        5.0.0

    - #### <K, V> public static Map<K, V> withCollectedValues(Iterator<K> keys, Function<? super K, V> valueTransform)

      A variant of withCollectedValues for Iterators.

      Parameters:
        `keys` - an Iterator
        `valueTransform` - a function for transforming Iterator elements into values
      Returns:
        a Map of the transformed entries
      See Also:
        withCollectedValues(Iterable, Function)
      Since:
        5.0.0

    - #### <K, V> public static Map<K, V> withCollectedValues(Iterable<K> keys, Map<K, V> collector, Function<? super K, V> valueTransform)

      Transform Iterable elements into Map entries with keys unchanged and values transformed using the supplied function. The supplied collector map is used as the destination for transformed entries.

           def languages = ['Groovy', 'Java', 'Kotlin', 'Scala']
           assert languages.withCollectedValues([Clojure:7], String::size) ==
               [Clojure:7, Groovy:6, Java:4, Kotlin:6, Scala:5]

      This method is a convenience method for collectEntries(Iterable, Map, Function, Function) with the `keyTransform` replaced by `Function.identity()` or {Closure.IDENTITY}.
      Parameters:
        `keys` - an Iterable
        `collector` - the Map into which the transformed entries are put
        `valueTransform` - a function for transforming Iterable elements into values
      Returns:
        the collector with all transformed values added to it
      Since:
        5.0.0

    - #### <K, V> public static Map<K, V> withCollectedValues(Iterable<K> keys, Function<? super K, V> valueTransform)

      Transform Iterable elements into Map entries with keys unchanged and values transformed using the supplied function.

           def languages = ['Groovy', 'Java', 'Kotlin', 'Scala']
           assert languages.withCollectedValues(String::size) ==
               [Groovy:6, Java:4, Kotlin:6, Scala:5]

      This method is a convenience method for collectEntries(Iterable, Function, Function) with the `keyTransform` replaced by `Function.identity()` or {Closure.IDENTITY}.
      Parameters:
        `keys` - an Iterable
        `valueTransform` - a function for transforming Iterable elements into values
      Returns:
        a Map of the transformed entries
      Since:
        5.0.0

    - #### <K, V> public static Map<K, V> withDefault(Map<K, V> self, @ClosureParams(FirstParam.FirstGenericType.class)
      Closure<V> init)

      Wraps a map using the decorator pattern with a wrapper that intercepts all calls to `get(key)`. If an unknown key is found, a default value will be stored into the Map before being returned. The default value stored will be the result of calling the supplied Closure with the key as the parameter to the Closure. Example usage:

           def map = [a:1, b:2].withDefault{ k -> k.toCharacter().isLowerCase() ? 10 : -10 }
           def expected = [a:1, b:2, c:10, D:-10]
           assert expected.every{ e -> e.value == map[e.key] }

           def constMap = [:].withDefault{ 42 }
           assert constMap.foo == 42
           assert constMap.size() == 1

      Parameters:
        `self` - a Map
        `init` - a Closure which is passed the unknown key
      Returns:
        the wrapped Map
      Since:
        1.7.1
      See Also:
        withDefault(Map, boolean, boolean, Closure)

    - #### <K, V> public static Map<K, V> withDefault(Map<K, V> self, boolean autoGrow, boolean autoShrink, @ClosureParams(FirstParam.FirstGenericType.class)
      Closure<V> init)

      Wraps a map using the decorator pattern with a wrapper that intercepts all calls to `get(key)` and `put(key, value)`. If an unknown key is found for `get`, a default value will be returned. The default value will be the result of calling the supplied Closure with the key as the parameter to the Closure. If `autoGrow` is set, the value will be stored into the map. If `autoShrink` is set, then an attempt to `put` the default value into the map is ignored and indeed any existing value would be removed. If you wish the backing map to be as small as possible, consider setting `autoGrow` to `false` and `autoShrink` to `true`. This keeps the backing map as small as possible, i.e. sparse, but also means that `containsKey`, `keySet`, `size`, and other methods will only reflect the sparse values. If you are wrapping an immutable map, you should set `autoGrow` and `autoShrink` to `false`. In this scenario, the `get` method is essentially a shorthand for calling `getOrDefault` with the default value supplied once as a Closure. Example usage:

           // sparse map example
           def answers = [life: 100].withDefault(false, true){ 42 }
           assert answers.size() == 1
           assert answers.foo == 42
           assert answers.size() == 1
           answers.life = 42
           answers.putAll(universe: 42, everything: 42)
           assert answers.size() == 0

           // immutable map example
           def certainties = [death: true, taxes: true].asImmutable().withDefault(false, false){ false }
           assert certainties.size() == 2
           assert certainties.wealth == false
           assert certainties.size() == 2

      Parameters:
        `self` - a Map
        `autoGrow` - whether calling get could potentially grow the map if the key isn't found
        `autoShrink` - whether calling put with the default value could potentially shrink the map
        `init` - a Closure which is passed the unknown key
      Returns:
        the wrapped Map
      Since:
        4.0.1

    - #### <T> public static ListWithDefault<T> withDefault(List<T> self, @ClosureParams(value=SimpleType.class, options = "int")
      Closure<T> init)

      An alias for `withLazyDefault` which decorates a list allowing it to grow when called with index values outside the normal list bounds.

      Parameters:
        `self` - a List
        `init` - a Closure with the target index as parameter which generates the default value
      Returns:
        the decorated List
      See Also:
        withLazyDefault(java.util.List, groovy.lang.Closure)
        withEagerDefault(java.util.List, groovy.lang.Closure)
      Since:
        1.8.7

    - #### <T> @Deprecated
      public static List<T> withDefault$$bridge(List<T> self, @ClosureParams(value=SimpleType.class, options = "int")
      Closure<T> init)

    - #### <T> public static ListWithDefault<T> withEagerDefault(List<T> self, @ClosureParams(value=SimpleType.class, options="int")
      Closure<T> init)

      Decorates a list allowing it to grow when called with a non-existent index value. When called with such values, the list is grown in size and a default value is placed in the list by calling a supplied `init` Closure. Null values can be stored in the list.

      How it works: The decorated list intercepts all calls to `getAt(index)` and `get(index)`. If an index greater than or equal to the current `size()` is used, the list will grow automatically up to the specified index. Gaps will be filled by calling the `init` Closure. If generating a default value is a costly operation consider using `withLazyDefault`.

      Example usage:

           def list = [0, 1].withEagerDefault{ 42 }
           assert list[0] == 0
           assert list[1] == 1
           assert list[3] == 42   // default value
           assert list == [0, 1, 42, 42]   // gap filled with default value

           // illustrate using the index when generating default values
           def list2 = [5].withEagerDefault{ index -> index * index }
           assert list2[3] == 9
           assert list2 == [5, 1, 4, 9]

           // illustrate what happens with null values
           list2[2] = null
           assert list2[2] == null
           assert list2 == [5, 1, null, 9]

      Parameters:
        `self` - a List
        `init` - a Closure with the target index as parameter which generates the default value
      Returns:
        the wrapped List
      Since:
        1.8.7

    - #### <T> @Deprecated
      public static List<T> withEagerDefault$$bridge(List<T> self, @ClosureParams(value=SimpleType.class, options = "int")
      Closure<T> init)

    - #### <E> public static List<Tuple2<E, Integer>> withIndex(Iterable<E> self)

      Zips an Iterable with indices in (value, index) order.

      Example usage:

           assert [["a", 0], ["b", 1]] == ["a", "b"].withIndex()
           assert ["0: a", "1: b"] == ["a", "b"].withIndex().collect { str, idx -> "$idx: $str" }

      Parameters:
        `self` - an Iterable
      Returns:
        a zipped list with indices
      See Also:
        indexed(Iterable)
      Since:
        2.4.0

    - #### <E> public static List<Tuple2<E, Integer>> withIndex(Iterable<E> self, int offset)

      Zips an Iterable with indices in (value, index) order.

      Example usage:

           assert [["a", 5], ["b", 6]] == ["a", "b"].withIndex(5)
           assert ["1: a", "2: b"] == ["a", "b"].withIndex(1).collect { str, idx -> "$idx: $str" }

      Parameters:
        `self` - an Iterable
        `offset` - an index to start from
      Returns:
        a zipped list with indices
      See Also:
        indexed(Iterable, int)
      Since:
        2.4.0

    - #### <E> public static Iterator<Tuple2<E, Integer>> withIndex(Iterator<E> self)

      Zips an iterator with indices in (value, index) order.

      Example usage:

           assert [["a", 0], ["b", 1]] == ["a", "b"].iterator().withIndex().toList()
           assert ["0: a", "1: b"] == ["a", "b"].iterator().withIndex().collect { str, idx -> "$idx: $str" }.toList()

      Parameters:
        `self` - an iterator
      Returns:
        a zipped iterator with indices
      See Also:
        indexed(Iterator)
      Since:
        2.4.0

    - #### <E> public static Iterator<Tuple2<E, Integer>> withIndex(Iterator<E> self, int offset)

      Zips an iterator with indices in (value, index) order.

      Example usage:

           assert [["a", 5], ["b", 6]] == ["a", "b"].iterator().withIndex(5).toList()
           assert ["1: a", "2: b"] == ["a", "b"].iterator().withIndex(1).collect { str, idx -> "$idx: $str" }.toList()

      Parameters:
        `self` - an iterator
        `offset` - an index to start from
      Returns:
        a zipped iterator with indices
      See Also:
        indexed(Iterator, int)
      Since:
        2.4.0

    - #### <T> public static ListWithDefault<T> withLazyDefault(List<T> self, @ClosureParams(value=SimpleType.class, options="int")
      Closure<T> init)

      Decorates a list allowing it to grow when called with a non-existent index value. When called with such values, the list is grown in size and a default value is placed in the list by calling a supplied `init` Closure. Subsequent retrieval operations if finding a null value in the list assume it was set as null from an earlier growing operation and again call the `init` Closure to populate the retrieved value; consequently the list can't be used to store null values.

      How it works: The decorated list intercepts all calls to `getAt(index)` and `get(index)`. If an index greater than or equal to the current `size()` is used, the list will grow automatically up to the specified index. Gaps will be filled by `null`. If a default value should also be used to fill gaps instead of `null`, use `withEagerDefault`. If `getAt(index)` or `get(index)` are called and a null value is found, it is assumed that the null value was a consequence of an earlier grow list operation and the `init` Closure is called to populate the value.

      Example usage:

           def list = [0, 1].withLazyDefault{ 42 }
           assert list[0] == 0
           assert list[1] == 1
           assert list[3] == 42   // default value
           assert list == [0, 1, null, 42] // gap filled with null

           // illustrate using the index when generating default values
           def list2 = [5].withLazyDefault{ index -> index * index }
           assert list2[3] == 9
           assert list2 == [5, null, null, 9]
           assert list2[2] == 4
           assert list2 == [5, null, 4, 9]

           // illustrate what happens with null values
           list2[2] = null
           assert list2[2] == 4

      Parameters:
        `self` - a List
        `init` - a Closure with the target index as parameter which generates the default value
      Returns:
        the decorated List
      Since:
        1.8.7

    - #### <T> @Deprecated
      public static List<T> withLazyDefault$$bridge(List<T> self, @ClosureParams(value=SimpleType.class, options = "int")
      Closure<T> init)

    - #### public static Object withMethodClosure(Object self, MethodClosure mc)

      A utility method for calling a method closure on an object.

      Parameters:
        `self` - the object
        `mc` - the method closure
      Returns:
        the result of calling the method closure

    - #### public static Object withTraits(Object self, Class<?> traits)

      Dynamically wraps an instance into something which implements the supplied trait classes. It is guaranteed that the returned object will implement the trait interfaces, but the original type of the object is lost (replaced with a proxy).

      Parameters:
        `self` - object to be wrapped
        `traits` - a list of trait classes
      Returns:
        a proxy implementing the trait interfaces

    - #### public static Number xor(Number left, Number right)

      Bitwise XOR together two Numbers. Called when the '^' operator is used.

      Parameters:
        `left` - a Number
        `right` - another Number to bitwise XOR
      Returns:
        the bitwise XOR of both Numbers
      Since:
        1.0

    - #### public static BitSet xor(BitSet left, BitSet right)

      Bitwise XOR together two BitSets. Called when the '^' operator is used between two bit sets.

      Parameters:
        `left` - a BitSet
        `right` - another BitSet to bitwise XOR
      Returns:
        the bitwise XOR of both BitSets
      Since:
        1.5.0

    - #### public static Boolean xor(Boolean left, Boolean right)

      Exclusive disjunction of two boolean operators

      Parameters:
        `left` - left operator
        `right` - right operator
      Returns:
        result of exclusive disjunction
      Since:
        1.0

    - #### <T> public static Set<T> xor(Set<T> left, Iterable<T> right)

      Create a Set composed of the symmetric difference of a Set and an Iterable. Any elements that exit in only one are added to the resultant Set.

      This operation will always create a new object for the result, while the operands remain unchanged.

           def a = [1,2,3,4] as Set
           def b = [3,4,5,6] as Set
           assert (a ^ b) == [1,2,5,6] as Set

      By default, Groovy uses a NumberAwareComparator when determining if an element exists in both sets.
      Parameters:
        `left` - a Set
        `right` - an Iterable
      Returns:
        a Set as a symmetric difference of a Set and an Iterable
      Since:
        5.0.0

    - #### <T> public static Set<T> xor(Set<T> left, Iterable<T> right, Comparator<? super T> comparator)

      Create a Set composed of the symmetric difference of a Set and an Iterable. Any elements that exit in only one are added to the resultant Set.

      This operation will always create a new object for the result, while the operands remain unchanged.

           assert [1,2,5,6] as Set == ([1,2,3,4] as Set).xor([3,4,5,6], Comparator.naturalOrder())

      Parameters:
        `left` - a Set
        `right` - an Iterable
        `comparator` - a Comparator
      Returns:
        a Set as a symmetric difference of a Set and an Iterable
      Since:
        5.0.0

    - #### <T> public static SortedSet<T> xor(SortedSet<T> left, Iterable<T> right)

      Create a SortedSet composed of the symmetric difference of a SortedSet and an Iterable. Any elements that exist in only one of the sets are added to the resultant SortedSet.

      This operation will always create a new object for the result, while the operands remain unchanged.

           def a = [1,2,3,4] as SortedSet
           def b = [3,4,5,6] as Set
           assert (a ^ b) == [1,2,5,6] as SortedSet

      By default, Groovy uses a NumberAwareComparator when determining if an element exists in both sets.
      Parameters:
        `left` - a SortedSet
        `right` - an Iterable
      Returns:
        a SortedSet as a symmetric difference of a SortedSet and an Iterable
      Since:
        5.0.0

    - #### <T> public static SortedSet<T> xor(SortedSet<T> left, Iterable<T> right, Comparator<? super T> comparator)

      Create a SortedSet composed of the symmetric difference of a SortedSet and an Iterable. Any elements that exit in only one are added to the resultant SortedSet.

      This operation will always create a new object for the result, while the operands remain unchanged.

           assert [1,2,5,6] as SortedSet == ([1,2,3,4] as SortedSet).xor([3,4,5,6], Comparator.naturalOrder())

      Parameters:
        `left` - a SortedSet
        `right` - an Iterable
        `comparator` - a Comparator
      Returns:
        a SortedSet as a symmetric difference of a SortedSet and an Iterable
      Since:
        5.0.0

    - #### <U, V> public static List<Tuple2<U, V>> zip(Iterable<U> self, Iterable<V> other)

      A list of all the pairs from two Iterables. If the iterables are of different sizes, the result will have the same size as the shorter one.

      Example:

           def one = ['cat', 'spider']
           def two = ['fish', 'monkey']
           assert ['catfish', 'spidermonkey'] == one.zip(two).collect{ a, b -> a + b }
           assert [one, two].transpose() == one.zip(two).toList()

      Parameters:
        `self` - an Iterable
        `other` - another Iterable
      Returns:
        a list of all the pairs from self and other
      See Also:
        for zipping more than two lists
      Since:
        5.0.0

    - #### <U, V> public static Iterator<Tuple2<U, V>> zip(Iterator<U> self, Iterator<V> other)

      An iterator of all the pairs of two Iterators. If the iterators are of different sizes, the result will have the same size as the shorter one.

      Example:

           def small = [1, 2, 3].iterator()
           def large = [100, 200, 300].iterator()
           assert [101, 202, 303] == small.zip(large).collect{ a, b -> a + b }
           assert [small.toList(), large.toList()].transpose() == small.zip(large).toList()

      Parameters:
        `self` - an Iterator
        `other` - another Iterator
      Returns:
        an iterator of all the pairs from self and other
      Since:
        5.0.0

    - #### <U, V> public static Collection<Tuple2<U, V>> zipAll(Iterable<U> self, Iterable<V> other, U selfDefault, V otherDefault)

      A collection of all the pairs of two Iterables of potentially different size. If the iterables are of different sizes, the result will have the same size as the longer one with values completed using the provided default.

      Example:

           def ab = ['a', 'b']
           def abcd = 'a'..'d'
           def nums = 1..3
           assert ['a1', 'b2', 'unknown3'] == ab.zipAll(nums, 'unknown', 0).collect{ a, b -> a + b }
           assert ['a1', 'b2', 'c3', 'd0'] == abcd.zipAll(nums, 'unknown', 0).collect{ a, b -> a + b }

      Parameters:
        `self` - an Iterable
        `other` - another Iterable
      Returns:
        a collection of all the pairs from self and other
      Since:
        5.0.0

    - #### <U, V> public static Iterator<Tuple2<U, V>> zipAll(Iterator<U> left, Iterator<V> right, U leftDefault, V rightDefault)

      An iterator of all the pairs of two Iterators with potentially different numbers of elements. If the iterables are of different sizes, the result will have the same size as the longer one with values completed using the provided default.

      Example:

           def ab = ['a', 'b'].iterator()
           def abcd = ('a'..'d').iterator()
           def nums = (1..3).iterator()
           assert ['a1', 'b2', 'unknown3'] == ab.zipAll(nums, 'unknown', 0).collect{ a, b -> a + b }
           nums = (1..3).iterator()
           assert ['a1', 'b2', 'c3', 'd0'] == abcd.zipAll(nums, 'unknown', 0).collect{ a, b -> a + b }

      Parameters:
        `left` - an Iterator
        `right` - another Iterator
      Returns:
        an iterator of all the pairs from left and right
      Since:
        5.0.0