protected <T> T initialize(T proxy) throws HibernateException {
        if (!Hibernate.isInitialized(proxy)) {
            Hibernate.initialize(proxy);
        }
        return proxy;
    }
@Test
    void initializesProxies() throws Exception {
        final LazyInitializer initializer = mock(LazyInitializer.class);
        when(initializer.isUninitialized()).thenReturn(true);
        final HibernateProxy proxy = mock(HibernateProxy.class);
        doCallRealMethod().when(proxy).asHibernateProxy();
        when(proxy.getHibernateLazyInitializer()).thenReturn(initializer);

        dao.initialize(proxy);

        verify(initializer).initialize();
    }