/** * Adds a collection of items to a property container. Existing values will be replaced. * * @param itemsToAdd items to add */ public void addAllReplaceExisting(Collection<? extends Item<?,?>> itemsToAdd) throws SchemaException { checkMutability(); // Check for conflicts, remove conflicting values // itemsToAdd.forEach(itemToAdd -> addReplaceExisting(itemToAdd)); for (Item<?,?> item : itemsToAdd) { addReplaceExisting(item); // Item<?,?> existingItem = findItem(item.getElementName(), Item.class); // if (existingItem != null && items != null) { // items.remove(existingItem); // } } // addAll(itemsToAdd); }