### Question:
AsyncWriteBehind implements WriteBehind { @Override public void write(Element element) { async.add(new WriteAsyncOperation(element)); } AsyncWriteBehind(final AsyncCoordinator async, final int writeBehindConcurrency); @Override void start(CacheWriter writer); @Override void write(Element element); @Override void delete(CacheEntry entry); @Override void setOperationsFilter(OperationsFilter filter); @Override void stop(); @Override long getQueueSize(); static final ItemScatterPolicy<SingleAsyncOperation> POLICY; }### Answer:
@Test public void testDelegatesWriteToAsyncCoordinator() { final Element element = new Element("foo", "bar"); asyncWriteBehind.write(element); ArgumentCaptor<SingleAsyncOperation> captor = ArgumentCaptor.forClass(SingleAsyncOperation.class); verify(asyncCoordinator).add(captor.capture()); assertThat(captor.getAllValues().size(), is(1)); final SingleAsyncOperation value = captor.getValue(); assertThat(value, instanceOf(WriteAsyncOperation.class)); assertThat(value.getElement(), sameInstance(element)); }