class DefaultRelationManager implements RelationManager {

    private final ReactiveRepository<RelatedEntity, String> relatedRepository;

    private final ReactiveRepository<RelationEntity, String> relationRepository;

    protected final Map<String, RelationObjectProvider> providers = new ConcurrentHashMap<>();

    public void addProvider(RelationObjectProvider provider) {
        providers.put(provider.getTypeId(), provider);
    }

    @Override
    public Mono<ObjectType> getObjectType(String typeId) {<FILL_FUNCTION_BODY>}

    @Override
    public Flux<ObjectType> getObjectTypes() {
        return Flux
            .fromIterable(providers.values())
            .flatMap(RelationObjectProvider::getType);
    }

    @Override
    public Mono<RelationObject> getObject(String objectType,
                                          String objectId) {
        if (!StringUtils.hasText(objectType) || !StringUtils.hasText(objectId)) {
            return Mono.empty();
        }
        return Mono
            .just(
                new DefaultRelationObject(
                    objectType,
                    objectId,
                    relatedRepository,
                    this::getProvider)
            );
    }

    @Override
    public Flux<RelationObject> getObjects(String objectType, Collection<String> objectIds) {
        return Flux.fromIterable(objectIds)
                   .flatMap(id -> getObject(objectType, id));
    }

    private RelationObjectProvider getProvider(String type) {
        RelationObjectProvider provider = providers.get(type);
        if (provider == null) {
            throw new I18nSupportException("error.unsupported_object_type", type);
        }
        return provider;
    }
}

        RelationObjectProvider provider = getProvider(typeId);

        return provider
            .getType()
            .flatMap(type -> relationRepository
                .createQuery()
                .where(RelationEntity::getObjectType, typeId)
                .fetch()
                .collect(Collectors.groupingBy(
                    RelationEntity::getTargetType,
                    Collectors.mapping(SimpleRelation::of, Collectors.toList())))
                .<ObjectType>map(group -> {
                    SimpleObjectType custom = new SimpleObjectType(typeId, type.getName(), type.getDescription());
                    for (Map.Entry<String, List<SimpleRelation>> entry : group.entrySet()) {
                        custom.withRelation(entry.getKey(), entry.getValue());
                    }
                    return new CompositeObjectType(type, custom);
                })
                .defaultIfEmpty(type));
    
<no_super_class>