when(query.setParameterList(Mockito.anyString(), Mockito.anyCollection())).thenReturn(query);
this.session = mock(Session.class);
when(session.getNamedQuery(Mockito.anyString())).thenReturn(query);
this.dao = new AccountDAO(new Provider<Session>() {
@Override
public Session get() {
return session;
}
});