CheckedDatastoreReaderWriter { void update(Entity... entites) throws IOException { run(() -> rw.update(entites)); } CheckedDatastoreReaderWriter(DatastoreReaderWriter rw);   }
@Test public void updateShouldThrowCheckedException() throws IOException { doThrow(CAUSE).when(rw).update(entity1, entity2); exception.expect(IOException.class); exception.expectCause(is((Throwable) CAUSE)); sut.update(entity1, entity2); }
@Test public void update() throws IOException { sut.update(entity1, entity2); verify(rw).update(entity1, entity2); }