CheckedDatastoreTransaction extends CheckedDatastoreReaderWriter { void rollback() throws DatastoreIOException { try { tx.rollback(); } catch (DatastoreException e) { throw new DatastoreIOException(e); } } CheckedDatastoreTransaction(CheckedDatastore datastore, Transaction tx);   }
@Test public void rollback() throws DatastoreIOException { sut.rollback(); verify(transaction).rollback(); }
@Test public void rollbackShouldThrowCheckedException() throws DatastoreIOException { doThrow(CAUSE).when(transaction).rollback(); exception.expect(DatastoreIOException.class); exception.expectCause(is(CAUSE)); sut.rollback(); }