protected List<E> list(CriteriaQuery<E> criteria) throws HibernateException {
        return currentSession().createQuery(requireNonNull(criteria)).getResultList();
    }
@Test
    void returnsUniqueListsFromJpaCriteriaQueries() throws Exception {
        when(session.createQuery(criteriaQuery)).thenReturn(query);
        when(query.getResultList()).thenReturn(Collections.singletonList("woo"));

        assertThat(dao.list(criteriaQuery))
            .containsOnly("woo");
    }