simplify code and fix broken Mock after jline2 migration.
code style
Merge pull request #190 from tkruse/fix_groovysh_tests

Fix groovysh tests