Ex 5: Groovy - Groovin' with Groovy
import java.util.*
class Erase {
    public static main(args) {
        names = [ "Ted", "Fred", "Jed", "Ned" ]
        System.out.println(names)
        e = new Erase()
        short_names = e.filterLongerThan(names, 3)
        System.out.println (short_names.size())
        for (s in short_names) {
            System.out.println(s)
        }
    }
    public filterLongerThan (strings, length) {
        result = strings.findAll { s | s.length() < length+1 }
        return result
    }
}

[Example 5 Output]

(Example 5)