@FixFor( "MODE-790" )
@SuppressWarnings( "deprecation" )
@Test
public void shouldBeAbleToExecuteXPathQueryWithCompoundCriteria() throws Exception {

    String xpath = "/jcr:root/Cars//element(*,car:Car)[@car:year='2008' and jcr:contains(., '\"liters V 12\"')]";
    Query query = session.getWorkspace().getQueryManager().createQuery(xpath, Query.XPATH);
    QueryResult result = query.execute();
    String[] columnNames = {"jcr:primaryType", "jcr:mixinTypes", "jcr:path", "jcr:score", "jcr:created", "jcr:createdBy",
        "jcr:name", "mode:localName", "mode:depth", "mode:id", "car:mpgCity", "car:userRating", "car:mpgHighway",
        "car:engine", "car:model", "car:year", "car:maker", "car:lengthInInches", "car:valueRating", "car:wheelbaseInInches",
        "car:msrp", "car:alternateModels"};
    validateQuery().rowCount(1).hasColumns(columnNames).validate(query, result);
    // Query again with a different criteria that should return no nodes ...
    xpath = "/jcr:root/Cars//element(*,car:Car)[@car:year='2007' and jcr:contains(., '\"liter V 12\"')]";
    query = session.getWorkspace().getQueryManager().createQuery(xpath, Query.XPATH);
    result = query.execute();
    validateQuery().rowCount(0).hasColumns(columnNames).validate(query, result);
}