Add List.bounds()

This commit is contained in:
Reinhard Pointner 2016-12-22 20:37:52 +08:00
parent 6090fab9eb
commit 815cda5f2d
1 changed files with 1 additions and 1 deletions

View File

@ -545,7 +545,7 @@ public class ExpressionFormatMethods {
}
public static List<?> bounds(Iterable<?> self) {
return asList(DefaultGroovyMethods.min(self), DefaultGroovyMethods.max(self));
return Stream.of(DefaultGroovyMethods.min(self), DefaultGroovyMethods.max(self)).filter(Objects::nonNull).distinct().collect(toList());
}
/**