public String create(T entity) {
        ensureValidScope(entity);
        return insertedIdAsString(collection.insertOne(entity));
    }
@Test
    void testInvalidScopeFails() {
        // Invalid scopes not registered with the EntityScopeService should not be allowed.
        final ScopedDTO invalidScoped = ScopedDTO.builder().name("test").scope("INVALID").build();
        assertThatThrownBy(() -> scopedEntityMongoUtils.create(invalidScoped))
                .isExactlyInstanceOf(IllegalArgumentException.class);
        assertThat(collection.countDocuments()).isEqualTo(0L);
    }