@Test
public void invoke_Statement_close_fails() throws Throwable {

  StatementInvocationHandler statementInvocationHandler =
      new StatementInvocationHandler(
          mockRealStatement, TRACE_OPTIONS, mockTraceService, Optional.<String>absent());
  Exception expectedException = new SQLException();
  doThrow(expectedException).when(mockRealStatement).close();
  try {
    statementInvocationHandler.invoke(
            mockProxy, Statement.class.getDeclaredMethod("close"), new Object[0]);
    fail("expected SQLException");
  } catch (Exception actualException) {
    assertThat(actualException).isSameAs(expectedException);
  }
  verify(mockRealStatement).close();
  verifyNoMoreInteractions(mockTraceSpan); // No trace span created.
}