Fix failing jruby test

- klass.to_s sometimes fails in jruby, if the klass is defined in java world
Merge pull request #991 from udzura/fix/patch-jruby

Fix failing jruby test