@Override
        public void execute(ObservableList<DocumentProperty> target) {
            int existingIndex = -1;
            for (int i = 0; i < target.size(); i++) {
                if (isSame(target.get(i), document)) {
                    existingIndex = i;
                    break;
                }
            }
            
            // If the document has not yet been added, add it to the end.
            if (existingIndex < 0) {
                target.add(document);
            
            // If it already exists, merge it into this document and replace it
            // in the list.
            } else {
                final DocumentProperty existing = target.remove(existingIndex);
                merge(document, existing, constructor);
                target.add(existingIndex, document);
            }
        }
Merges a document into the source without moving it if it already exists.
If it does not yet exist in the source, merge it into the end. This is 
done with the submissive document.
tool-parent/tool-config/src/main/java/com/speedment/tool/config/util/DocumentMerger.java