Fix compatibility to JRuby in test