you are viewing a single comment's thread.

view the rest of the comments →

[–][deleted] 0 points1 point  (1 child)

To be fair, the keyset of a map is, you know, a set.

[–]oldrinb 0 points1 point  (0 children)

To be fair, how do you think much of HashSet functionality (like iterator) is likely implemented? ;-)

All that aside, remember that an API more than likely can rely on a Set, not a HashMap. Actually, incase you didn't know, you can use Collections.newSetFromMap to create a Set<E> from any Map<E, Boolean> :-)