@Override
    public <T> int remove(Class<T> type) {
        final String canonicalName = type.getCanonicalName();
        final WriteResult<ClusterConfig, String> result = dbCollection.remove(DBQuery.is("type", canonicalName));
        return result.getN();
    }
@Test
    public void removeDoesNothingIfConfigDoesNotExist() throws Exception {
        @SuppressWarnings("deprecation")
        final DBCollection collection = mongoConnection.getDatabase().getCollection(COLLECTION_NAME);

        assertThat(collection.count()).isEqualTo(0L);
        assertThat(clusterConfigService.remove(CustomConfig.class)).isEqualTo(0);
    }