public Mono<UserRelationshipGroup> createRelationshipGroup(
            @NotNull Long ownerId,
            @Nullable Integer groupIndex,
            @NotNull String groupName,
            @Nullable @PastOrPresent Date creationDate,
            @Nullable ClientSession session) {
        try {
            Validator.notNull(ownerId, "ownerId");
            Validator.notNull(groupName, "groupName");
            Validator.pastOrPresent(creationDate, "creationDate");
        } catch (ResponseException e) {
            return Mono.error(e);
        }
        Integer finalGroupIndex = groupIndex == null
                ? RandomUtil.nextPositiveInt()
                : groupIndex;
        if (creationDate == null) {
            creationDate = new Date();
        }
        UserRelationshipGroup group =
                new UserRelationshipGroup(ownerId, finalGroupIndex, groupName, creationDate);
        Mono<UserRelationshipGroup> result = userRelationshipGroupRepository.insert(group, session)
                .thenReturn(group);
        // If groupIndex is null, but the session isn't null and DuplicateKeyException occurs,
        // it is a bug of server because we cannot resume the session.
        // Luckily, we don't have the case now.
        if (groupIndex == null && session == null) {
            Date finalCreationDate = creationDate;
            return result.onErrorResume(DuplicateKeyException.class,
                    t -> createRelationshipGroup(ownerId,
                            null,
                            groupName,
                            finalCreationDate,
                            null));
        }
        return result;
    }
@param userRelationshipService is lazy because: UserRelationshipService ->
                               UserRelationshipGroupService -> UserRelationshipService
turms-service/src/main/java/im/turms/service/domain/user/service/UserRelationshipGroupService.java