before: get = 100, contains = true after acc.owner = "ankur": map.get(acc) = null set.contains(acc) = false map.containsKey(acc) = false map.size() = 1 iteration still sees it = [Account(ankur)] map.remove(acc) = null map.size() after remove = 1 set.add(acc) again -> size = 2 [Account(ankur), Account(ankur)] (one object, two entries) immutable key: map.get("asha") = 1