PendingResult implements Cancelable, Future<T> { @Override public final boolean cancel() { return cancel(false); }  @Override final boolean cancel(); @Override boolean cancel(boolean mayInterruptIfRunning); @RestrictTo(RestrictTo.Scope.LIBRARY_GROUP) void setResult(final @Nullable T result); @Nullable T getResult(); @Override boolean isCancelled(); @Override boolean isDone(); @Nullable @Override T get(); @Nullable @Override T get(long l, @NonNull TimeUnit timeUnit); @NonNull PendingResult<T> addCancelable(@NonNull Cancelable cancelable); @NonNull PendingResult<T> addResultCallback(@NonNull final ResultCallback<T> resultCallback); @NonNull PendingResult<T> addResultCallback(@Nullable Looper looper, @NonNull final ResultCallback<T> resultCallback);  }
@Test public void testCancel() throws ExecutionException, InterruptedException { pendingResult.cancel(); assertTrue(pendingResult.isDone()); assertTrue(pendingResult.isCancelled()); setResultAsync(true); assertNull(pendingResult.get()); assertEquals(0, resultCallback.results.size()); }