@Test
public void shouldClosePreparedStatementIfExceptionIsThrownInStatementWithReturnBlock() throws Exception {

    when(mockConnection.prepareStatement(anyString())).thenReturn(mockPreparedStatement);
    final JDBCBase.StatementWithReturnBlock<?> mockStatementWithReturnBlock = mock(JDBCBase.StatementWithReturnBlock.class);
    doThrow(IllegalArgumentException.class).when(mockStatementWithReturnBlock).use(mockPreparedStatement);
    assertThatExceptionIsThrown(new Callable<Void>() {
        @Override
        public Void call() throws Exception {
            jdbcTestSubclass.withStatement(mockConnection, "SOME SQL", mockStatementWithReturnBlock);
            return null;
        }
    }, IllegalArgumentException.class);
    verify(mockPreparedStatement).close();
}