@Test public void getValue_supended_throwsIllegalStateException() { FakeAsyncResponse response = new FakeAsyncResponse(); try { response.getValue(); fail(); } catch (IllegalStateException e) { } }
@Nullable public Object getValue() { if (isSuspended()) { throw new IllegalStateException(); } return value instanceof Response ? ((Response) value).getEntity() : value; }
FakeAsyncResponse implements AsyncResponse { @Nullable public Object getValue() { if (isSuspended()) { throw new IllegalStateException(); } return value instanceof Response ? ((Response) value).getEntity() : value; } }
FakeAsyncResponse implements AsyncResponse { @Nullable public Object getValue() { if (isSuspended()) { throw new IllegalStateException(); } return value instanceof Response ? ((Response) value).getEntity() : value; }  }
FakeAsyncResponse implements AsyncResponse { @Nullable public Object getValue() { if (isSuspended()) { throw new IllegalStateException(); } return value instanceof Response ? ((Response) value).getEntity() : value; }  @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 { @Nullable public Object getValue() { if (isSuspended()) { throw new IllegalStateException(); } return value instanceof Response ? ((Response) value).getEntity() : value; }  @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);  }