Use entry API on hashmap