tested on jruby and mri