ExtendedSettableFuture extends AbstractFuture<V> { @Override public boolean setException(Throwable throwable) { return super.setException(throwable); } private  ExtendedSettableFuture(); static ExtendedSettableFuture<V> create(); @Override boolean set(@Nullable V value); @Override boolean setException(Throwable throwable); void setAsync(ListenableFuture<? extends V> delegate);  }
@Test public void testSetException() { ExtendedSettableFuture<String> future = ExtendedSettableFuture.create(); future.setException(new Exception("")); assertTrue(future.isDone()); assertFalse(future.isCancelled()); assertFalse(future.checkWasInterrupted()); assertThrows(ExecutionException.class, future::get); }