### Question:
HibernateSessionDAO extends HibernatePersistentObjectDAO<Session> implements SessionDAO { @Override public Session findBySid(String sid) { try { List<Session> sessions = findByWhere("_entity.sid = ?1", new Object[] { sid }, null, null); for (Session session : sessions) { if (session.getDeleted() == 0) return session; } } catch (PersistenceException e) { log.error(e.getMessage(), e); } return null; } protected  HibernateSessionDAO(); @Override void deleteCurrentNodeSessions(); @Override int countSessions(Long tenantId, Integer status); @Override Session findBySid(String sid); @Override void initialize(Session session); @Override List<Session> findByNode(String node); @Override void cleanOldSessions(int ttl);  }### Answer:
@Test public void testFindBySid() { Session session = dao.findBySid("sid1"); Assert.assertNotNull(session); Assert.assertEquals("addr1", session.getClient().getAddress()); session = dao.findBySid("sid2"); Assert.assertNull(session); }