title: How does contains-Method in HashSets work?
body: <p>How does the contains-method find out if a certain object is/is not in a HashSet? I created a class with two instance variables. Then I put a few instances into a HashSet. I created the same instances again (with same instance variable values) and used them as the input for the contains-method. Although it were the same objects, "contains" returned false every time.
  So, I'm wondering if only the references are checked, or the values of the objects. If I have to identical objects and I put one into the HashSet and call the the "contains" method with the other object will the method return true or false?
  If false, what do I have to do, so that it returns true?</p>