Combined Java and Groovy setting into a single block.
Added a unit test.