### Question:
PByteBufTableImpl implements PTable<ByteBuf, ByteBuf> { public CompletableFuture<PTable<ByteBuf, ByteBuf>> initialize() { return this.clientManager .openMetaRangeClient(props) .getActiveDataRanges() .thenComposeAsync((ranges) -> refreshRangeSpaces(ranges), executor); } PByteBufTableImpl(String streamName,
                             StreamProperties props,
                             StorageServerClientManager clientManager,
                             ScheduledExecutorService executor,
                             Backoff.Policy backoffPolicy);  PByteBufTableImpl(String streamName,
                             StreamProperties props,
                             StorageServerClientManager clientManager,
                             ScheduledExecutorService executor,
                             TableRangeFactory<ByteBuf, ByteBuf> factory,
                             Optional<RangeRouter<ByteBuf>> rangeRouterOverride); @Override OpFactory<ByteBuf, ByteBuf> opFactory(); CompletableFuture<PTable<ByteBuf, ByteBuf>> initialize(); @Override CompletableFuture<RangeResult<ByteBuf, ByteBuf>> get(ByteBuf pKey,
                                                                ByteBuf lKey,
                                                                RangeOption<ByteBuf> option); @Override CompletableFuture<PutResult<ByteBuf, ByteBuf>> put(ByteBuf pKey,
                                                              ByteBuf lKey,
                                                              ByteBuf value,
                                                              PutOption<ByteBuf> option); @Override CompletableFuture<DeleteResult<ByteBuf, ByteBuf>> delete(ByteBuf pKey,
                                                                    ByteBuf lKey,
                                                                    DeleteOption<ByteBuf> option); @Override CompletableFuture<IncrementResult<ByteBuf, ByteBuf>> increment(ByteBuf pKey,
                                                                          ByteBuf lKey,
                                                                          long amount,
                                                                          IncrementOption<ByteBuf> option); @Override Txn<ByteBuf, ByteBuf> txn(ByteBuf pKey); @Override void close();  }### Answer:
@Test public void testInitializeFailureOnGetActiveRanges() { ClientException cause = new ClientException("test-cause"); when(mockMetaRangeClient.getActiveDataRanges()) .thenReturn(FutureUtils.exception(cause)); PByteBufTableImpl table = new PByteBufTableImpl( runtime.getMethodName(), streamProps, mockClientManager, scheduler.chooseThread(1), ClientConstants.DEFAULT_INFINIT_BACKOFF_POLICY); try { FutureUtils.result(table.initialize()); fail("Should fail initializing the table with exception " + cause); } catch (Exception e) { assertEquals(cause, e); } }