public static <DOC extends Document> DOC deepCopy(
        DOC document,
        Function<Map<String, Object>, DOC> constructor) {

        return constructor.apply(deepCopyMap(document.getData()));
    }
Creates a deep copy of the raw map in the specified document and wrap it
in a new typed document using the specified constructor.

@param <DOC>        the document type
@param document     the document
@param constructor  the document constructor
@return             the copy
runtime-parent/runtime-config/src/main/java/com/speedment/runtime/config/util/DocumentUtil.java