SessionDaoImpl implements SessionDao { @Override public void removeDevice(final String deviceId) { sessions.remove(deviceId); } SessionDaoImpl(); @Override void initSession(final String deviceId, final String contentUrl, final String contentName); @Override void updateSessionStatus(final String deviceId, final SessionStatus status); @Override void updateSessionPosition(final String deviceId, final Long position, final Long duration); @Override void removeDevice(final String deviceId); @Override StreamingSession getSession(final String deviceId); @Override Map<String, StreamingSession> getSessions();  }
@Test public void testRemoveDevice() throws UnknownSessionException { SessionDaoImpl sessionDao = new SessionDaoImpl(); sessionDao.initSession("deviceId", "contentUrl", "contentName"); Map<String, StreamingSession> sessions = sessionDao.getSessions(); assertNotNull(sessions); assertEquals(1, sessions.size()); sessionDao.removeDevice("deviceId"); sessions = sessionDao.getSessions(); assertEquals(0, sessions.size()); }