docs: Set<AttributeDescriptor> mappedAttributes(EntityDescriptor entity,
                                                AttributeDescriptor attribute,
                                                EntityDescriptor referenced) {
          String mappedBy = attribute.mappedBy();
          if (Names.isEmpty(mappedBy)) {
              return referenced.attributes().stream()
                  .filter(other -> other.cardinality() != null)
                  .filter(other -> referencingEntity(other).isPresent())
                  .filter(other -> referencingEntity(other)
                          .orElseThrow(IllegalStateException::new) == entity)
                  .collect(Collectors.toSet());
          } else {
              return referenced.attributes().stream()
                  .filter(other -> other.name().equals(mappedBy))
                  .collect(Collectors.toSet());
          }
      }