Javascript Get Maximum Value From Array To Hashmap Iteration In Java