Set<ITestNGMethod> keySet = testResultsPerMethod.keySet();
for( ITestNGMethod method : keySet )
{
TestSet testSet = new TestSet();
List<ITestResult> testResults = testResultsPerMethod.get( method );
testSet.setPlan( new Plan(testResults.size()) );
for ( ITestResult testResult : testResults )
{
TestResult tapTestResult = TestNGTAPUtils.generateTAPTestResult( testResult, testSet.getNumberOfTestResults()+1 );
testSet.addTestResult( tapTestResult );
}
File output = new File(testContext.getOutputDirectory(), method.getTestClass().getName()+"#"+method.getMethodName()+".tap");
tapProducer.dump(testSet, output);
}