private static boolean isSame(
            final Document first,
            final Document second) {

        requireNonNull(first);
        requireNonNull(second);
        
        final Optional<? extends Document> firstParent  = first.getParent();
        final Optional<? extends Document> secondParent = second.getParent();
        
        if (firstParent.isPresent() ^ secondParent.isPresent()) {
            return false;
        }
        
        final String firstId  = HasId.of(first).getId();
        final String secondId = HasId.of(second).getId();
        final boolean idsEqual = Objects.equals(firstId, secondId);

        return firstParent.map(doc ->
            idsEqual && isSame(doc, secondParent.get())
        ).orElse(idsEqual);
    }
Returns if the two documents corresponds to the same data by first 
comparing if their parents are the same and then comparing if they have
the same value on their {@code id} property. Equality is not used to
determine if two documents are the same since they could have been 
created during different stages and with different data.
<p>
If one or both of the documents does not have an id property specified,
the default value specified by {@link HasName} will be used.

@param first   the first document
@param second  the second document
@return        true if they represent the same data
tool-parent/tool-config/src/main/java/com/speedment/tool/config/util/DocumentMerger.java