@Override
    public Collection<DatabasePacket> execute() throws SQLException {
        new BackendTransactionManager(connectionSession.getDatabaseConnectionManager()).rollback();
        connectionSession.setAutoCommit(true);
        connectionSession.setDefaultIsolationLevel(null);
        connectionSession.setIsolationLevel(null);
        connectionSession.getServerPreparedStatementRegistry().clear();
        return Collections.singleton(new MySQLOKPacket(ServerStatusFlagCalculator.calculateFor(connectionSession)));
    }
@Test
    void assertExecute() throws SQLException {
        ConnectionSession connectionSession = mock(ConnectionSession.class);
        ProxyDatabaseConnectionManager databaseConnectionManager = mock(ProxyDatabaseConnectionManager.class);
        when(connectionSession.getDatabaseConnectionManager()).thenReturn(databaseConnectionManager);
        when(connectionSession.getTransactionStatus()).thenReturn(new TransactionStatus());
        when(connectionSession.getServerPreparedStatementRegistry()).thenReturn(new ServerPreparedStatementRegistry());
        int statementId = 1;
        connectionSession.getServerPreparedStatementRegistry().addPreparedStatement(statementId, new MySQLServerPreparedStatement("", null, new HintValueContext(), Collections.emptyList()));
        Collection<DatabasePacket> actual = new MySQLComResetConnectionExecutor(connectionSession).execute();
        assertThat(actual.size(), is(1));
        assertThat(actual.iterator().next(), instanceOf(MySQLOKPacket.class));
        verify(connectionSession).setAutoCommit(true);
        verify(connectionSession).setDefaultIsolationLevel(null);
        verify(connectionSession).setIsolationLevel(null);
        assertNull(connectionSession.getServerPreparedStatementRegistry().getPreparedStatement(statementId));
    }