LiveUpdateSessionHandler extends TextWebSocketHandler { @Override public void afterConnectionEstablished(final WebSocketSession session) throws Exception { super.afterConnectionEstablished(session); manager.add(new LiveUpdateSession(session)); }  @Override void afterConnectionEstablished(final WebSocketSession session); @Override void afterConnectionClosed(
      final WebSocketSession session, final CloseStatus status);  }
@Test public void testAfterConnectionEstablished() throws Exception { final LiveUpdateService manager = mock(LiveUpdateService.class); final WebSocketSession session = mock(WebSocketSession.class); final LiveUpdateSessionHandler handler = new LiveUpdateSessionHandler(); handler.setManager(manager); handler.afterConnectionEstablished(session); verify(manager).add(any()); }