### Question:
Val implements Future<V> { public final void set(V value) { if (f != null) throw new IllegalStateException("Cannot set a value because a function has been set"); set0(value); } Val(final SuspendableCallable<V> f);  Val(FiberScheduler scheduler, final SuspendableCallable<V> f);  Val(); final void set(V value); final void setException(Throwable t); @Override boolean isDone(); @Override @Suspendable V get(); @Override @Suspendable V get(long timeout, TimeUnit unit); @Suspendable V get(Timeout timeout); @Override boolean cancel(boolean mayInterruptIfRunning); @Override boolean isCancelled();  }### Answer:
@Test(expected = IllegalStateException.class) public void whenValIsSetTwiceThenThrowException() throws Exception { final Val<String> val = new Val<>(); val.set("hello"); val.set("goodbye"); }