&gt; It&#x27;s perfectly okay to use object identity when comparing immutable data structures, but it&#x27;s usually a bug if the data structure is mutable.<p>I don&#x27;t understand this statement. The only thing immutability provides here is the ability to know that an object didn&#x27;t change by knowing that it&#x27;s the same object. There&#x27;s no guarantee of value equality from identity unless all objects are interned.