@Override
    public Map<StatementMetaData, SqlStats> getExecutedStatements(Threads threadMatcher, boolean removeStackTraces) {

        Map<StatementMetaData, SqlStats> executedStatements = new LinkedHashMap<StatementMetaData, SqlStats>();
        for (Map.Entry<StatementMetaData, SqlStats> entry : this.executedStatements.ascendingMap().entrySet()) {

            StatementMetaData statementMetaData = entry.getKey();

            if (removeStackTraces) statementMetaData = new StatementMetaData(
                    statementMetaData.sql, statementMetaData.query, null, statementMetaData.ownerThreadId
            );

            if ( ( (CURRENT == threadMatcher && statementMetaData.ownerThreadId == this.ownerThreadId) ||
                    (OTHERS == threadMatcher && statementMetaData.ownerThreadId != this.ownerThreadId) ||
                    (ANY == threadMatcher || null == threadMatcher) ) ) {
                SqlStats existingSocketStats = executedStatements.get(statementMetaData);
                if (null == existingSocketStats) {
                    executedStatements.put(statementMetaData, new SqlStats(entry.getValue()));
                } else {
                    existingSocketStats.accumulate(entry.getValue());
                }
            }
        }

        return Collections.unmodifiableMap(executedStatements);
    }
@ Override public Map < StatementMetaData , SqlStats > getExecutedStatements ( Threads threadMatcher , boolean removeStackTraces ) { Map < StatementMetaData , SqlStats > executedStatements = new LinkedHashMap < StatementMetaData , SqlStats > ( ) ; for ( Map . Entry < StatementMetaData , SqlStats > entry : this . executedStatements . ascendingMap ( ) . entrySet ( ) ) { StatementMetaData statementMetaData = entry . getKey ( ) ; if ( removeStackTraces ) statementMetaData = new StatementMetaData ( statementMetaData . sql , statementMetaData . query , null , statementMetaData . ownerThreadId ) ; if ( ( ( CURRENT == threadMatcher && statementMetaData . ownerThreadId == this . ownerThreadId ) || ( OTHERS == threadMatcher && statementMetaData . ownerThreadId != this . ownerThreadId ) || ( ANY == threadMatcher || null == threadMatcher ) ) ) { SqlStats existingSocketStats = executedStatements . get ( statementMetaData ) ; if ( null == existingSocketStats ) { executedStatements . put ( statementMetaData , new SqlStats ( entry . getValue ( ) ) ) ; } else { existingSocketStats . accumulate ( entry . getValue ( ) ) ; } } } return Collections . unmodifiableMap ( executedStatements ) ; }
@since 3.1