title: Discussion - Best way to hash a mix of (CustomClass1, CustomClass2, Collection<CustomClass3>)
body: <p>I was reading the implementation of equals() and hashCode() in Java and came to a conclusion that there is possibility of collision (I never faced the collision in my case) but I was thinking to find a better way to get some unique identifier like GUID for an object that I have -</p>
  <p>I have [CustomClass1 cc1, CustomClass2 cc2 and a Set scc3] coming in from a method and I am wrapping them in an object1 and doing object1.hashCode() and the hashCode() is working fine (handling the order of objects in the SET as well, so I am getting unique hash code even when the order of object in set is different say 1,2,3 or say 2,3,1 as long as they are &quot;1&quot;, &quot;2&quot; and &quot;3&quot; but irrespective of order)</p>
  <p>But I was thinking to find a better way to this - convert object1 to a GUID instead of object1.hashCode().</p>
  <p>Is there a better way? If yes, share your thoughts.</p>