public static int calculateFor(final ConnectionSession connectionSession) {
        int result = 0;
        result |= connectionSession.isAutoCommit() ? MySQLStatusFlag.SERVER_STATUS_AUTOCOMMIT.getValue() : 0;
        result |= connectionSession.getTransactionStatus().isInTransaction() ? MySQLStatusFlag.SERVER_STATUS_IN_TRANS.getValue() : 0;
        return result;
    }
@Test
    void assertAutoCommitInTransaction() {
        when(connectionSession.isAutoCommit()).thenReturn(true);
        when(connectionSession.getTransactionStatus().isInTransaction()).thenReturn(true);
        assertThat(ServerStatusFlagCalculator.calculateFor(connectionSession), is(MySQLStatusFlag.SERVER_STATUS_IN_TRANS.getValue() | MySQLStatusFlag.SERVER_STATUS_AUTOCOMMIT.getValue()));
    }