### Question:
DatabaseConnection { public void commit() { try { getConnection().commit(); } catch (SQLException e) { SQLUtil.rollbackQuietly(getConnection()); LOG.error(e, "error in commit"); throw ConnectorException.wrap(e); } } DatabaseConnection();  DatabaseConnection(final Connection conn); @SuppressWarnings("deprecation") void dispose(); void test(); Connection getConnection(); void setConnection(final Connection connection); PreparedStatement prepareStatement(final String sql, final List<SQLParam> params); PreparedStatement prepareStatement(DatabaseQueryBuilder query); CallableStatement prepareCall(final String sql, final List<SQLParam> params); void commit();  }### Answer:
@Test public void testCommit() { ExpectProxy<Connection> tp = new ExpectProxy<Connection>(); tp.expect("commit"); DatabaseConnection dbc = new DatabaseConnection(tp.getProxy(Connection.class)); dbc.commit(); assertTrue("commit called", tp.isDone()); }