@Test public void resume_notSuspended_returnsFalse() { FakeAsyncResponse response = new FakeAsyncResponse(); response.resume("foobar"); assertFalse(response.resume("foobar")); assertFalse(response.resume(new IllegalArgumentException())); }
@Override public synchronized boolean resume(Object response) { if (!isSuspended()) { return false; } state = State.DONE; value = response; return true; }
FakeAsyncResponse implements AsyncResponse { @Override public synchronized boolean resume(Object response) { if (!isSuspended()) { return false; } state = State.DONE; value = response; return true; } }
FakeAsyncResponse implements AsyncResponse { @Override public synchronized boolean resume(Object response) { if (!isSuspended()) { return false; } state = State.DONE; value = response; return true; }  }
FakeAsyncResponse implements AsyncResponse { @Override public synchronized boolean resume(Object response) { if (!isSuspended()) { return false; } state = State.DONE; value = response; return true; }  @Nullable Object getValue(); @Nullable Throwable getException(); @Override synchronized boolean resume(Object response); @Override synchronized boolean resume(Throwable response); @Override synchronized boolean cancel(); @Override synchronized boolean cancel(int retryAfter); @Override synchronized boolean cancel(Date retryAfter); @Override synchronized boolean isSuspended(); @Override synchronized boolean isCancelled(); @Override synchronized boolean isDone(); @Override synchronized boolean setTimeout(long time, TimeUnit unit); @Override void setTimeoutHandler(TimeoutHandler handler); @Override Collection<Class<?>> register(Class<?> callback); @Override Map<Class<?>, Collection<Class<?>>> register(Class<?> callback, Class<?>... callbacks); @Override Collection<Class<?>> register(Object callback); @Override Map<Class<?>, Collection<Class<?>>> register(Object callback, Object... callbacks); }
FakeAsyncResponse implements AsyncResponse { @Override public synchronized boolean resume(Object response) { if (!isSuspended()) { return false; } state = State.DONE; value = response; return true; }  @Nullable Object getValue(); @Nullable Throwable getException(); @Override synchronized boolean resume(Object response); @Override synchronized boolean resume(Throwable response); @Override synchronized boolean cancel(); @Override synchronized boolean cancel(int retryAfter); @Override synchronized boolean cancel(Date retryAfter); @Override synchronized boolean isSuspended(); @Override synchronized boolean isCancelled(); @Override synchronized boolean isDone(); @Override synchronized boolean setTimeout(long time, TimeUnit unit); @Override void setTimeoutHandler(TimeoutHandler handler); @Override Collection<Class<?>> register(Class<?> callback); @Override Map<Class<?>, Collection<Class<?>>> register(Class<?> callback, Class<?>... callbacks); @Override Collection<Class<?>> register(Object callback); @Override Map<Class<?>, Collection<Class<?>>> register(Object callback, Object... callbacks);  }