It's not terribly clean, but you could use indexOf() and check if it returns -1. Better than breaking out a loop.
You need to understand what happens when calling Java classes from scripts written in JRuby or Jython, and vice verse. You also need to be aware of the difficulties of integrating a scripting language ...