DefaultQueryDslPredicateExecutor extends PagingAndSortingSupport implements DataStoreAware { public boolean exists(Predicate predicate) { return ((CollQuery) CollQueryFactory.from(alias, dataStore.retrieveAll()).where(predicate)).fetchCount() > 0; }  Object findOne(Predicate predicate); Iterable findAll(Predicate predicate); Iterable findAll(Predicate predicate, Sort sort); Page findAll(Predicate predicate, Pageable pageable); long count(Predicate predicate); boolean exists(Predicate predicate); Iterable findAll(OrderSpecifier... orders); Iterable findAll(Predicate predicate, OrderSpecifier... orders); @Override void setDataStore(DataStore dataStore);  }
@Test public void testExists() { dataStore.save("1", new Person().setId("1").setAge(30)); dataStore.save("2", new Person().setId("2").setAge(25)); dataStore.save("3", new Person().setId("3").setAge(20)); dataStore.save("4", new Person().setId("4").setAge(15)); dataStore.save("5", new Person().setId("5").setAge(10)); final Person person = alias(Person.class); assertThat(executor.exists($(person.getAge()).gt(20).or($(person.getAge()).eq(20))), is(true)); assertThat(executor.exists($(person.getAge()).lt(20).or($(person.getAge()).eq(20))), is(true)); assertThat(executor.exists($(person.getAge()).lt(10).or($(person.getAge()).eq(10))), is(true)); assertThat(executor.exists($(person.getAge()).lt(5).or($(person.getAge()).eq(5))), is(false)); }