Collections.frequency(codeList, element)
字符串element,在codeList集合中重复的次数。
List<String> repList = new ArrayList<>();
for (String element : codeList) {
if (Collections.frequency(codeList, element) > 1 && Collections.frequency(repList, element) ==0) {
repList.add(element);
}
}