BitmexClientRegistry { public BitmexRestClient getRestClient() { if( restClient == null ) { restClient = new BitmexRestClient(useProduction, apiKeyName, apiKeyValue); } return restClient; } protected  BitmexClientRegistry(); static BitmexClientRegistry getInstance(); static void setTestClientRegistry( BitmexClientRegistry testRegistry ); void setProperties( BitmexProperties properties ); IBitmexClient getBitmexClient(); BitmexRestClient getRestClient(); BitmexWebsocketClient getWebsocketClient();  }
@Test public void testGetRestClient() { registry.apiKeyName = "myApiKey"; registry.apiKeyValue = "myApiValue"; registry.useProduction = true; BitmexRestClient expectedClient = new BitmexRestClient(true, "myApiKey", "myApiValue"); BitmexRestClient actualClient = registry.getRestClient(); assertEquals( expectedClient, actualClient ); assertEquals( actualClient, registry.getRestClient() ); }