[ 
https://issues.apache.org/jira/browse/GROOVY-8406?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16285191#comment-16285191
 ] 

Paul King commented on GROOVY-8406:
-----------------------------------

Here is a sample test case for three of the methods:
{code}
@groovy.transform.CompileStatic
class Util {
  static allHiWords(String[] items) {
    items.collect{ it.toLowerCase() }.every{ it.startsWith('hi') }
  }
  static anyBYE(String[] items) {
    items.any{ it.equalsIgnoreCase('BYE') }
  }
}

assert Util.allHiWords(['Hi', 'hiest', 'hippopotamus'] as String[])
assert Util.anyBYE(['Hi', 'bye'] as String[])
{code}

> DefaultGroovyMethods missing Array support
> ------------------------------------------
>
>                 Key: GROOVY-8406
>                 URL: https://issues.apache.org/jira/browse/GROOVY-8406
>             Project: Groovy
>          Issue Type: Improvement
>    Affects Versions: 2.5.0-beta-1
>            Reporter: Nathan Harvey
>            Priority: Minor
>              Labels: easyfix
>
> The methods every, any, and collect support instances of Iterable and 
> Iterator, but do not include equivalent methods for support arrays.



--
This message was sent by Atlassian JIRA
(v6.4.14#64029)

Reply via email to