Path titleField = candidate.get("title");
cq.where(cb.equal(titleField, "Bar Book"));
Path isbnField = candidate.get("isbn");
cq.orderBy(cb.desc(isbnField));
Query q = em.createQuery(cq);
List<Book> books = q.getResultList();
assertNotNull(books);
assertEquals(2, books.size());