Fixing test for JRuby. Thanks to @enebo

Ref jruby/jruby#2053