i tried personList.contains()
Make sure you override Object.equals()
and Object.hashCode()
for Person class. But you have to have equality check on telephone number assuming telephone number unique. This would not be a solution but a workaround. Use bellum's answer. Mark it as correct answer.