@Test
@FixFor( "MODE-2247" )
public void shouldBeAbleToExecuteIntersectOperationWithSimpleCriteria() throws Exception {

    String sql1 = "SELECT car1.[jcr:path] FROM [car:Car] AS car1";
    String sql2 = "SELECT car2.[jcr:path] FROM [car:Car] AS car2 WHERE car2.[car:mpgCity] = 12";
    String queryString = sql1 + " INTERSECT " + sql2;
    List<String> expectedPaths = new ArrayList<>(Arrays.asList("/Cars/Sports/Aston Martin DB9",
                                                               "/Cars/Utility/Land Rover LR3"));
    Query query = session.getWorkspace().getQueryManager().createQuery(queryString, Query.JCR_SQL2);
    NodeIterator nodes = query.execute().getNodes();
    assertEquals(2, nodes.getSize());
    while (nodes.hasNext()) {
        String path = nodes.nextNode().getPath();
        assertTrue(path + " not found", expectedPaths.remove(path));
    }
}