@Test
public void testClose() throws Exception {

    underTest.openSocket(ConnectionType.SUBSCRIBER, session);
    verify(session).getId();
    verify(session).setMaxIdleTimeout(0);
    verifyNoMoreInteractions(session);
    assertEquals(1, underTest.numSessions());
    underTest.close(session, new CloseReason(CloseCodes.CANNOT_ACCEPT, "close"));
    verify(session).close();
    verify(session, times(2)).getId();
    verifyNoMoreInteractions(session);
    assertEquals(0, underTest.numSessions());
}