### Question:
ConsistencyReader { ReadMode deduceReadMode(RxDocumentServiceRequest request, ValueHolder<ConsistencyLevel> targetConsistencyLevel, ValueHolder<Boolean> useSessionToken) throws DocumentClientException { targetConsistencyLevel.v = RequestHelper.GetConsistencyLevelToUse(this.serviceConfigReader, request); useSessionToken.v = (targetConsistencyLevel.v == ConsistencyLevel.Session); if (request.getDefaultReplicaIndex() != null) { useSessionToken.v = false; return ReadMode.Primary; } switch (targetConsistencyLevel.v) { case Eventual: return ReadMode.Any; case ConsistentPrefix: return ReadMode.Any; case Session: return ReadMode.Any; case BoundedStaleness: return ReadMode.BoundedStaleness; case Strong: return ReadMode.Strong; default: throw new IllegalStateException("Invalid Consistency Level " + targetConsistencyLevel.v); } } ConsistencyReader(
            Configs configs,
            AddressSelector addressSelector,
            ISessionContainer sessionContainer,
            TransportClient transportClient,
            GatewayServiceConfigurationReader serviceConfigReader,
            IAuthorizationTokenProvider authorizationTokenProvider); Single<StoreResponse> readAsync(RxDocumentServiceRequest entity,
                                           TimeoutHelper timeout,
                                           boolean isInRetry,
                                           boolean forceRefresh); int getMaxReplicaSetSize(RxDocumentServiceRequest entity); int getMinReplicaSetSize(RxDocumentServiceRequest entity);  }### Answer:
@Test(groups = "unit", dataProvider = "deduceReadModeArgProvider") public void deduceReadMode(ConsistencyLevel accountConsistencyLevel, ConsistencyLevel requestConsistency, ReadMode expectedReadMode, ConsistencyLevel expectedConsistencyToUse, boolean expectedToUseSession) throws DocumentClientException { AddressSelector addressSelector = Mockito.mock(AddressSelector.class); ISessionContainer sessionContainer = Mockito.mock(ISessionContainer.class); TransportClient transportClient = Mockito.mock(TransportClient.class); GatewayServiceConfiguratorReaderMock gatewayServiceConfigurationReaderWrapper = GatewayServiceConfiguratorReaderMock.from(accountConsistencyLevel); IAuthorizationTokenProvider authorizationTokenProvider = Mockito.mock(IAuthorizationTokenProvider.class); ConsistencyReader consistencyReader = new ConsistencyReader(configs, addressSelector, sessionContainer, transportClient, gatewayServiceConfigurationReaderWrapper.gatewayServiceConfigurationReader, authorizationTokenProvider); RxDocumentServiceRequest request = RxDocumentServiceRequest.createFromName( OperationType.Read, "/dbs/db/colls/col/docs/docId", ResourceType.Document); if (requestConsistency != null) { request.getHeaders().put(HttpConstants.HttpHeaders.CONSISTENCY_LEVEL, requestConsistency.name()); } ValueHolder<ConsistencyLevel> consistencyLevel = ValueHolder.initialize(null); ValueHolder<Boolean> useSession = ValueHolder.initialize(null); ReadMode readMode = consistencyReader.deduceReadMode(request, consistencyLevel, useSession); assertThat(readMode).isEqualTo(expectedReadMode); assertThat(consistencyLevel.v).isEqualTo(expectedConsistencyToUse); assertThat(useSession.v).isEqualTo(expectedToUseSession); }