### Question:
OpenSessions { public void closeSession(String desktopId) { Session session = sessions.remove(desktopId); if (session != null) { session.close(); } } OpenSessions(SessionFactory sessionFactory); void openSession(String desktopId); void unbindSession(); void closeSession(String desktopId);  }### Answer:
@Test public void closeSessionThatNonExistsShouldDoNothing() throws Exception { sut.closeSession("non-existing-id"); }
@Test public void closeSession() throws Exception { Session session = givenSutWithSession(sut, "desktop-id"); sut.closeSession("desktop-id"); verify(session).close(); }