example work now in Groovy and Java.