This content has been marked as final. Show 4 replies
If you want two SelectItems to be equals you need to override equals() to reflect this.
However, another approach is to remove all the SelectItems which have a stringValue() contained in the collection newEntry.
for(iterator<SelectItem> iter = newRes2.iterator(); iter.hasNext();) if (newentry.contains(iter.next().stringValue()) iter.remove();
if SelectItem is a class you created yourself then giving it a proper equals() method could do it, yes.
If for some reason you cannot get it to work, I would just iterate through the list and inspect the object inside it. When you find the index you want to remove, use the Iterator.remove() method to pluck it out.