Fix tests on JRuby