### Question:
GlobalAddressResolver implements IAddressResolver { @Override public Single<AddressInformation[]> resolveAsync(RxDocumentServiceRequest request, boolean forceRefresh) { IAddressResolver resolver = this.getAddressResolver(request); return resolver.resolveAsync(request, forceRefresh); } GlobalAddressResolver(
            CompositeHttpClient<ByteBuf, ByteBuf> httpClient,
            GlobalEndpointManager endpointManager,
            Protocol protocol,
            IAuthorizationTokenProvider tokenProvider,
            RxCollectionCache collectionCache,
            RxPartitionKeyRangeCache routingMapProvider,
            UserAgentContainer userAgentContainer,
            GatewayServiceConfigurationReader serviceConfigReader,
            ConnectionPolicy connectionPolicy); @Override Single<AddressInformation[]> resolveAsync(RxDocumentServiceRequest request, boolean forceRefresh); void dispose();  }### Answer:
@Test(groups = "unit") public void resolveAsync() throws Exception { GlobalAddressResolver globalAddressResolver = new GlobalAddressResolver(httpClient, endpointManager, Protocol.Https, authorizationTokenProvider, collectionCache, routingMapProvider, userAgentContainer, serviceConfigReader, connectionPolicy); RxDocumentServiceRequest request; request = RxDocumentServiceRequest.createFromName( OperationType.Read, "dbs/db/colls/coll/docs/doc1", ResourceType.Document); Set<URL> urlsBeforeResolve = globalAddressResolver.addressCacheByEndpoint.keySet(); assertThat(urlsBeforeResolve.size()).isEqualTo(5); assertThat(urlsBeforeResolve.contains(urlforRead3)).isFalse(); assertThat(urlsBeforeResolve.contains(urlforRead2)).isTrue(); URL testUrl = new URL("http: Mockito.when(endpointManager.resolveServiceEndpoint(Matchers.any(RxDocumentServiceRequest.class))).thenReturn(testUrl); globalAddressResolver.resolveAsync(request, true); Set<URL> urlsAfterResolve = globalAddressResolver.addressCacheByEndpoint.keySet(); assertThat(urlsAfterResolve.size()).isEqualTo(5); assertThat(urlsAfterResolve.contains(urlforRead2)).isFalse(); assertThat(urlsBeforeResolve.contains(testUrl)).isTrue(); }