convert java to groovy take 2