Now using Comparator.compare to identify duplicate items.