@Override
    public boolean equals(Object o) {
        if (this == o) return true;
        if (o == null || getClass() != o.getClass()) return false;
        DocumentPut that = (DocumentPut) o;
        return document.equals(that.document) &&
               (createIfNonExistent == that.createIfNonExistent) &&
               Objects.equals(getCondition(), that.getCondition());
    }
Base this DocumentPut on another, but use newDocument as the Document.
document/src/main/java/com/yahoo/document/DocumentPut.java