groovy/groovy-core — pull request #487 by yukoba (2014-07-22 04:52:09+00:00)
Title: Type cast methods for Collection

This is mainly my fault, current Groovy master branch cannot compile this code in `@TypeChecked` class,
because `Iterable.tail()` returns `Collection`.

```
void test() {
assert 2 == foo([1, 2].tail())
}

int foo(List a) {
a[0]
}
```

There is `List.tail()`, which returns `List`, but this method is `@Deprecated`,
and `@Deprecated` method is not called.

So I created a patch, in which many `List` methods return `List`, and also for many other `Collection` classes.
For example, now `List.leftShift()` returns `List`, this code can be compiled in `@TypeChecked` class.
```
([1, 2] << 3).each { println it }.collect { it + 1 }.subList(1, 2)
```

The implementation of `List.leftShift()` is just this. Only type casts.
```
public static List leftShift(List self, T value) {
return (List) leftShift((Collection) self, value);
}
```

Also I fixed these minor things.

1. This is a `@Deprecated` method and very meaningless to modify, but I changed internal cast of `Collection.multiply(Number)` from `List` to `Collection`. This was a bug.
2. Removed meaningless `@SupressWarning` of `Collection.grep()`.
3. Fixed some wrong JavaDoc.