private void assignFromFieldValue(ReferenceFieldValue rhs) {
        if (!getDataType().equals(rhs.getDataType())) {
            throw new IllegalArgumentException(String.format(
                    "Can't assign reference of type %s to reference of type %s",
                    rhs.getDataType().getName(), getDataType().getName()));
        }
        rhs.getDocumentId().ifPresent(this::setDocumentId);
    }
Creates a reference pointing to a particular document instance in the document
type referenced by <code>referenceType</code>.

@param referenceType reference target type
@param documentId document ID of the same document type as that given by <code>referenceType</code>
@throws IllegalArgumentException if documentId is not of the expected document type
document/src/main/java/com/yahoo/document/datatypes/ReferenceFieldValue.java