Handle the case in hashmap when there are 0 elements in it.