[groovy] move method to util class