The Collection.contains() method check if a collection contains a given object, using the .equals() method to perform the comparison.
.equals()
From Java7 Javadoc
When you create a class you should override at least equals (and hashCode) methods. If you implement your equals method to compare by reference you will achieve your goal.
equals
hashCode