In keyset, you need to get all the keys and then you search for every key in the collection.
Moreover, loop over the entrySet is faster, because you don't query the map twice for each key.
If you need only keys or only values of your Map, then use rather keySet() or values().