private void performQuery(AuditQuery<Audit> query, List<Long> expected) throws SQLException { InMemoryAuditDao dao = new InMemoryAuditDao(); dao.saveAll(getAudits()); List<Audit> result = dao.doQuery(query); Set<Long> ids = new HashSet<>(); for (Audit audit : result) { ids.add(audit.getId()); } assertEquals(new HashSet<>(expected), new HashSet<>(ids)); }