My thought is, as the method removeItemFromMapByValue will delete all the elements which contain the parameter "name" in the original map including the element we are iterating currently, calling removeItemFromMapByValue directly will cause fault by deleting all elements. Thus we need to exclude the current element in the original map and check if there are any elements have the same value as the current one. We could do this by creating a duplicated map. If there are, we call the method removeItemFromMapByValue to remove them all, if not, we continue to iterate the next element without delete the last element itself. Is all above right? If so, is there anything wrong with my code? Any idea will be appreciated!