Java HashMap Encoding Program