Simplify by using #to_java
Use string keys for efficiency

Avoids expensive Array#eql? and Array#hash calls