code: public EntityType getRefEntity() {
      if (!hasRefEntity()) {
        throw new UnsupportedOperationException(
            String.format("getRefEntity not supported for attribute type '%s'", getDataType()));
      }
      return getEntity(REF_ENTITY_TYPE, EntityType.class);
    }
docs: When getDataType=xref/mref, get other end of xref
  
  @return referenced entity
  @throws UnsupportedOperationException if attribute type is not a reference type