Last active
August 29, 2015 14:21
-
-
Save StefanKrecher/50254defdc6454601384 to your computer and use it in GitHub Desktop.
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
// Booleans | |
false.ifTrue { assert false }.ifFalse { assert true }; | |
// Exceptions | |
{-> throw new NullPointerException("Buh!") }.on(NullPointerException).do { e -> | |
assert e in Exception | |
assert e in NullPointerException | |
assert !(e in ArithmeticException) | |
assert e.getMessage() == "Buh!" | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
find full source here: https://gist.github.com/StefanKrecher/a5b7f92b32815cce3be7