protected @Nullable E uniqueResult(CriteriaQuery<E> criteriaQuery) throws HibernateException {
        return uniqueElement(
            currentSession()
                .createQuery(requireNonNull(criteriaQuery))
                .getResultList()
        );
    }
@Test
    void returnsUniqueResultsFromQueries() throws Exception {
        when(query.uniqueResult()).thenReturn("woo");

        assertThat(dao.uniqueResult(query))
                .isEqualTo("woo");
    }