This repository has been archived by the owner on Aug 2, 2022. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 18
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
51b9b3a
commit 055efc3
Showing
4 changed files
with
36 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
package contribution | ||
|
||
def list = [0, 1, 2, 1, 1, 3, 2, 0, 1] | ||
|
||
assert 9 == list.size() | ||
assert 2 == list.count(0) | ||
assert 4 == list.count(1) | ||
assert 2 == list.count(2) | ||
assert 1 == list.count(3) | ||
|
||
def listItems = ['Groovy', 'Grails', 'Java'] | ||
assert listItems.count { it.startsWith('G') } == 2 | ||
|
||
def numbers = [1, 2, 3, 4] | ||
assert numbers.count { it > 2 } == 2 |