Query subQuery = Search.getSearchManager(cache).buildQueryBuilderForClass(NumericType.class).get().keyword()
.wildcard().onField("name").matching("*string*").createQuery();
Query query = Search.getSearchManager(cache).buildQueryBuilderForClass(NumericType.class).get().all().except().createQuery();
CacheQuery cacheQuery = Search.getSearchManager(cache).getQuery(query);
List<Object> found = cacheQuery.list();
Assert.assertEquals(3, found.size());
assert found.contains(type1);
assert found.contains(type2);
assert found.contains(type3);
query = Search.getSearchManager(cache).buildQueryBuilderForClass(NumericType.class).get().all().except(subQuery).createQuery();
cacheQuery = Search.getSearchManager(cache).getQuery(query);
found = cacheQuery.list();
Assert.assertEquals(0, found.size());
}