public Mono<UpdateResult> checkAndTransferGroupOwnership(
            @NotEmpty Set<Long> groupIds,
            @NotNull Long successorId,
            boolean quitAfterTransfer) {
        try {
            Validator.notEmpty(groupIds, "groupIds");
            Validator.notNull(successorId, "successorId");
        } catch (ResponseException e) {
            return Mono.error(e);
        }
        int size = groupIds.size();
        List<Mono<Signal<Void>>> monos = new ArrayList<>(size);
        for (Long groupId : groupIds) {
            Mono<Signal<Void>> mono = checkAndTransferGroupOwnership(null,
                    groupId,
                    successorId,
                    quitAfterTransfer,
                    null).materialize();
            monos.add(mono);
        }
        return Flux.merge(monos)
                .collect(CollectorUtil.toList(size))
                .map(signals -> {
                    int matched = 0;
                    long modified = 0;
                    for (Signal<Void> signal : signals) {
                        if (signal.isOnError()) {
                            if (!ThrowableUtil.isStatusCode(signal.getThrowable(),
                                    ResponseStatusCode.TRANSFER_NONEXISTENT_GROUP)) {
                                matched++;
                            }
                        } else if (signal.isOnComplete()) {
                            matched++;
                            modified++;
                        }
                    }
                    return UpdateResult.acknowledged(matched, modified, null);
                });
    }
TODO: remove and keep {@link GroupService#queryGroupTypeIfActiveAndNotDeleted(Long, boolean)}
only.
turms-service/src/main/java/im/turms/service/domain/group/service/GroupService.java