### Question:
MonadDeferReference implements Reference<F, A> { @Override public Kind<F, Unit> set(A newValue) { return monadF.exec(() -> value.set(newValue)); } MonadDeferReference(MonadDefer<F> monadF, AtomicReference<A> value); @Override Kind<F, A> get(); @Override Kind<F, Unit> set(A newValue); @Override Kind<F, A> getAndSet(A newValue); @Override Kind<F, A> updateAndGet(Operator1<A> update); @Override Kind<F, A> getAndUpdate(Operator1<A> update); @Override String toString();  }### Answer:
@Test public void set() { Reference<F, String> ref = makeRef("Hello World!"); Kind<F, String> result = doAndThen(ref.set("Something else"), ref.get()); assertEquals("Something else", run(result)); }