private static void handleList(DocumentProperty existing, Document proposed, DocumentConstructor constructor, String key, List<Object> list) {
        if (list.isEmpty()) {
            // Make sure the list is initialized.
            existing.observableListOf(key);
        } else {
            final Object first = list.get(0);

            if (first instanceof Map<?, ?>) {
                @SuppressWarnings("unchecked")
                final List<Document> documents = list.stream()
                    .map(data -> (Map<String, Object>) data)
                    .map(data -> new BaseDocument(proposed, data))
                    .collect(toList());

                // Merge the new children into the existing document.
                merge(
                    existing,
                    key,
                    documents,
                    constructor
                );
            } else {
                throw new SpeedmentConfigException(
                    "Only Lists of Maps are supported in the " +
                        "document model."
                );
            }
        }

    }
Merges a single document into an existing one, trying to save as much
information as possible. If new {@link DocumentProperty properties} need
to be created, the specified constructor is used.

@param existing     the document to merge into
@param proposed     the document to merge with
@param constructor  used to create new {@link DocumentProperty}
tool-parent/tool-config/src/main/java/com/speedment/tool/config/util/DocumentMerger.java