boolean (String description) { if (myDuplicateDescriptions == null) { myDuplicateDescriptions = new HashSet<>(); Set<String> filter = new HashSet<>(); for (int i = 0; i < myModel.getSize(); i++) { String s = myConverter.apply(myModel.getElementAt(i)).getDescription(); if (!filter.add(s)) myDuplicateDescriptions.add(s); } } return myDuplicateDescriptions.contains(description); }