Use more concise/idiomatic Gradle code for example usage

I haven't tested this directly, but it should work. If it doesn't I have typo'd something.