Java and Groovy implementations