### Question:
WebSocketClient extends org.java_websocket.client.WebSocketClient { @Override public void onClose(int code, String reason, boolean remote) { log.info("Closed WebSocket connection to {}, because of reason: '{}'." + "Conection closed remotely: {}", uri, reason, remote); listener.onClose(); } WebSocketClient(URI serverUri);  WebSocketClient(URI serverUri, Map<String,String> httpHeaders); @Override void onOpen(ServerHandshake serverHandshake); @Override void onMessage(String s); @Override void onClose(int code, String reason, boolean remote); @Override void onError(Exception e); void setListener(WebSocketListener listener);  }### Answer:
@Test public void testNotifyListenerOnClose() throws Exception { client.onClose(1, "reason", true); verify(listener).onClose(); }