BitmexClientRegistry { public BitmexWebsocketClient getWebsocketClient() { if( websocketClient == null ) { websocketClient = new BitmexWebsocketClient(useProduction); websocketClient.connect(apiKeyName, apiKeyValue); } return websocketClient; } protected  BitmexClientRegistry(); static BitmexClientRegistry getInstance(); static void setTestClientRegistry( BitmexClientRegistry testRegistry ); void setProperties( BitmexProperties properties ); IBitmexClient getBitmexClient(); BitmexRestClient getRestClient(); BitmexWebsocketClient getWebsocketClient();  }
@Test public void testGetWebsocketClient() { assertNull( registry.websocketClient ); BitmexWebsocketClient client = registry.getWebsocketClient(); assertEquals(client, registry.websocketClient ); assertTrue( client.isConnected() ); assertEquals(client, registry.getWebsocketClient()); client.disconnect(); }