CheckedDatastoreReaderWriter { void delete(Key... keys) throws IOException { run(() -> rw.delete(keys)); } CheckedDatastoreReaderWriter(DatastoreReaderWriter rw);   }
@Test public void deleteShouldThrowCheckedException() throws IOException { doThrow(CAUSE).when(rw).delete(key1, key2); exception.expect(IOException.class); exception.expectCause(is((Throwable) CAUSE)); sut.delete(key1, key2); }
@Test public void delete() throws IOException { sut.delete(key1, key1); verify(rw).delete(key1, key1); }