@Test
@FixFor( "MODE-2247" )
public void shouldBeAbleToExecuteIntersectOperationWithJoinCriteria() throws RepositoryException {

    String sql = "SELECT category.[jcr:path] AS p FROM [nt:unstructured] AS category "
                 + " INTERSECT  "
                 + "SELECT category.[jcr:path] AS p FROM [nt:unstructured] AS category JOIN [car:Car] AS cars ON ISCHILDNODE(cars,category) WHERE cars.[jcr:name]='Land Rover LR3'";
    Query query = session.getWorkspace().getQueryManager().createQuery(sql, Query.JCR_SQL2);
    QueryResult result = query.execute();
    validateQuery().rowCount(1).hasColumns("p").hasNodesAtPaths("/Cars/Utility").validate(query, result);
}