@SuppressWarnings( "deprecation" )
@Test
public void shouldFindNodeByUuid() throws RepositoryException {

    // Find one of the car nodes ...
    Node nodeA = session.getNode("/Other/NodeA[2]");
    assertThat(nodeA, is(notNullValue()));
    String uuid = nodeA.getUUID(); // throws exception if not referenceable ...
    String sql = "SELECT * FROM [nt:unstructured] WHERE [jcr:uuid] = '" + uuid + "'";
    Query query = session.getWorkspace().getQueryManager().createQuery(sql, Query.JCR_SQL2);
    QueryResult result = query.execute();
    validateQuery().rowCount(1).hasColumns(allColumnNames("nt:unstructured")).validate(query, result);
    sql = "SELECT * FROM nt:unstructured WHERE jcr:uuid = '" + uuid + "'";
    query = session.getWorkspace().getQueryManager().createQuery(sql, Query.SQL);
    result = query.execute();
    validateQuery().rowCount(1).validate(query, result);
}