public function testSubPredicates()
{
$pred = $this->getPredicate()->where('region', '==', 'Europe')->andWhere('population', '<', 40000)->andWhere(function ($query) {
$query->where('language.0', '==', 'Italian')->orWhere('language.0', '==', 'English');
});
$qe = new QueryExecuter($this->getRepo('countries'), $pred, array(), array());
$result = $qe->run();
$this->assertEquals(3, $result->total());
$this->assertEquals('San Marino', $result->first()->name);
$this->assertEquals('Vatican City', $result[1]->name);
$this->assertEquals('Gibraltar', $result[2]->name);
}