public LegacyDeleteResult<T, K> remove(DBObject query) {
        return new LegacyDeleteResult<>(delegate.deleteMany(new BasicDBObject(query.toMap())));
    }
@Test
    void remove() {
        final var collection = jacksonCollection("simple", Simple.class);
        final var foo = new Simple("000000000000000000000001", "foo");
        final var bar = new Simple("000000000000000000000002", "bar");

        collection.insert(List.of(foo, bar));
        assertThat(collection.remove(DBQuery.is("name", "foo")).getN()).isEqualTo(1);
        assertThat((Iterable<Simple>) collection.find()).containsExactly(bar);

        collection.insert(foo);
        assertThat(collection.remove(DBQuery.is("name", "foo")).getN()).isEqualTo(1);
        assertThat((Iterable<Simple>) collection.find()).containsExactly(bar);

        assertThatThrownBy(() -> collection.remove(DBQuery.empty(), WriteConcern.W2))
                .isInstanceOf(MongoCommandException.class)
                .hasMessageContaining("cannot use 'w' > 1 when a host is not replicated");
    }