If you've seen HashSet source, then you should know: HashSet is based on the underlying HashMap implementation. (HashSet source very, very small, because in addition to clone () method, writeObject () method, readObject () method is outside the HashSet themselves having to implement, other methods are methods in HashMap called directly.)