Skip to content

Instantly share code, notes, and snippets.

@StefanKrecher
Last active August 29, 2015 14:21
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save StefanKrecher/50254defdc6454601384 to your computer and use it in GitHub Desktop.
Save StefanKrecher/50254defdc6454601384 to your computer and use it in GitHub Desktop.
// 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!"
}
@StefanKrecher
Copy link
Author

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment