private Collection<TestClassResults> flattenResults(List<ISuite> suites)
    {
        Map<IClass, TestClassResults> flattenedResults = new HashMap<IClass, TestClassResults>();
        for (ISuite suite : suites)
        {
            for (ISuiteResult suiteResult : suite.getResults().values())
            {
                // Failed and skipped configuration methods are treated as test failures.
                organiseByClass(suiteResult.getTestContext().getFailedConfigurations().getAllResults(), flattenedResults);
                organiseByClass(suiteResult.getTestContext().getSkippedConfigurations().getAllResults(), flattenedResults);
                // Successful configuration methods are not included.
                
                organiseByClass(suiteResult.getTestContext().getFailedTests().getAllResults(), flattenedResults);
                organiseByClass(suiteResult.getTestContext().getSkippedTests().getAllResults(), flattenedResults);
                organiseByClass(suiteResult.getTestContext().getPassedTests().getAllResults(), flattenedResults);
            }
        }
        return flattenedResults.values();
    }
private Collection < TestClassResults > flattenResults ( List < ISuite > suites ) { Map < IClass , TestClassResults > flattenedResults = new HashMap < IClass , TestClassResults > ( ) ; for ( ISuite suite : suites ) { for ( ISuiteResult suiteResult : suite . getResults ( ) . values ( ) ) { organiseByClass ( suiteResult . getTestContext ( ) . getFailedConfigurations ( ) . getAllResults ( ) , flattenedResults ) ; organiseByClass ( suiteResult . getTestContext ( ) . getSkippedConfigurations ( ) . getAllResults ( ) , flattenedResults ) ; organiseByClass ( suiteResult . getTestContext ( ) . getFailedTests ( ) . getAllResults ( ) , flattenedResults ) ; organiseByClass ( suiteResult . getTestContext ( ) . getSkippedTests ( ) . getAllResults ( ) , flattenedResults ) ; organiseByClass ( suiteResult . getTestContext ( ) . getPassedTests ( ) . getAllResults ( ) , flattenedResults ) ; } } return flattenedResults . values ( ) ; }
Flatten a list of test suite results into a collection of results grouped by test class.
This method basically strips away the TestNG way of organising tests and arranges
the results by test class.