### Question:
LocalTransactionHandler implements TransactionHandler { @Override public <R, X extends Exception> R inTransaction(Handle handle, HandleCallback<R, X> callback) throws X { return nonspecial(handle).inTransaction(handle, callback); }  @Override void begin(Handle handle); @Override void commit(Handle handle); @Override void rollback(Handle handle); @Override boolean isInTransaction(Handle handle); @Override void savepoint(Handle handle, String savepointName); @Override void rollbackToSavepoint(Handle handle, String savepointName); @Override void releaseSavepoint(Handle handle, String savepointName); @Override R inTransaction(Handle handle, HandleCallback<R, X> callback); @Override R inTransaction(Handle handle, TransactionIsolationLevel level, HandleCallback<R, X> callback); static LocalTransactionHandler binding();  }### Answer:
@Test public void testThrowError() throws Exception { Error error = new Error("Transaction throws!"); Mockito.when(c.getAutoCommit()).thenReturn(true); Mockito.when(h.getConnection()).thenReturn(c); assertThatThrownBy(() -> new LocalTransactionHandler().inTransaction(h, x -> { throw error; })) .isSameAs(error); }