@SuppressWarnings( "deprecation" )
@Test
public void shouldNotReturnNodesWithNoPropertyForLikeCriterion() throws Exception {

    String xpath = "/jcr:root/Cars//*[jcr:like(@car:wheelbaseInInches, '%')]";
    Query query = session.getWorkspace().getQueryManager().createQuery(xpath, Query.XPATH);
    QueryResult result = query.execute();
    validateQuery().rowCount(1).hasColumns("jcr:primaryType", "jcr:path", "jcr:score").onEachRow(new Predicate() {
        @Override
        public void validate( int rowNumber,
                              Row row ) throws RepositoryException {
            assertThat(row.getNode().hasProperty("car:wheelbaseInInches"), is(true));
        }
    }).validate(query, result);
}