@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 it exists, remove it, else create it.
            final DocumentProperty existing = (existingIndex < 0)
                ? createWithConstructor()
                : target.remove(existingIndex);
            
            merge(existing, document, constructor);
            target.add(existing);
        }
Merges a document into the source by adding it to the end. If it already
exists, move the existing to the end and merge into it. This is done with
the superior document.
tool-parent/tool-config/src/main/java/com/speedment/tool/config/util/DocumentMerger.java