[java] Identify duplicates in a List