TailorSoft interview question

Invert a string in groovy or Java