PendingResult implements Cancelable, Future<T> { @Nullable @Override public T get() throws InterruptedException, ExecutionException { synchronized (this) { if (isDone()) { return result; } this.wait(); return result; } }  @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 testGet() throws ExecutionException, InterruptedException { setResultAsync(true); assertTrue(pendingResult.get()); assertTrue(pendingResult.isDone()); assertFalse(pendingResult.isCancelled()); Shadows.shadowOf(looper).runToEndOfTasks(); assertEquals(1, resultCallback.results.size()); assertTrue(resultCallback.results.get(0)); assertTrue(pendingResult.get()); }