### Question:
ThriftKeySyncClientImp extends ThriftBalancerAbstractClient<I, ThriftSyncClient<I, T>> implements ThriftKeySyncClient<K, I> { @Override public I get() throws TTransportException{ Optional<NodeStatus<I, ThriftSyncClient<I, T>>> statusOpt = balancer.get(); if (!statusOpt.isPresent()) { throw new TTransportException( "No nodes available. Failed nodes: " + balancer.getFailedNodes().collect(Collectors.toList()) ); } return createProxy(statusOpt.get()); } ThriftKeySyncClientImp(
            ThriftKeyLoadBalancer<K, I, ThriftSyncClient<I, T>> balancer,
            ThriftKeyBalancerConfig config,
            Class<I> interfaceClass
    ); @Override I get(); I get(K key); @Override Stream<I> getQuorum(K key);  }### Answer:
@Test(groups = "unit") public void get() throws Exception { DemoServer.Iface client = keyClient.get("testKey"); MapResult result = client.request("testVal", 42); assertEquals(result, mapResult); }
@Test(groups = "unit", expectedExceptions = TTransportException.class) public void getMissing() throws Exception { when(balancer.get("testKey")).thenReturn(Optional.empty()); DemoServer.Iface client = keyClient.get("testKey"); }