### Question:
WebSocketWrapper { public boolean isOpen() { return webSocket != null && webSocket.isOpen(); } WebSocketWrapper(ChargingStationId chargingStationId, WebSocket webSocket, WampMessageHandler wampMessageHandler,
                            Gson gson); WebSocket getWebSocket(); boolean isOpen(); void close(); void sendMessage(WampMessage wampMessage); void sendResultMessage(WampMessage wampMessage);  }### Answer:
@Test public void isOpenShouldReturnWebSocketStatus() { WebSocket mockWebSocket = getMockWebSocket(); WebSocketWrapper wrapper = new WebSocketWrapper(CHARGING_STATION_ID, mockWebSocket, mock(WampMessageHandler.class), gson); when(mockWebSocket.isOpen()).thenReturn(false); assertFalse(wrapper.isOpen()); when(mockWebSocket.isOpen()).thenReturn(true); assertTrue(wrapper.isOpen()); wrapper = new WebSocketWrapper(CHARGING_STATION_ID, null, mock(WampMessageHandler.class), gson); assertFalse(wrapper.isOpen()); }