}
private static void addMockTestResultAction(final AbstractBuild build, final AbstractBuild... failedSinces) {
final List<CaseResult> failedTests = new LinkedList<CaseResult>();
for (final AbstractBuild failedSince : failedSinces) {
final CaseResult caseResult = PowerMockito.mock(CaseResult.class);
PowerMockito.when(caseResult.getFailedSinceRun()).thenReturn(failedSince);
failedTests.add(caseResult);
}
final TestResultAction testResultAction = PowerMockito.mock(TestResultAction.class);
PowerMockito.when(testResultAction.getFailedTests()).thenReturn(failedTests);
PowerMockito.when(testResultAction.getFailCount()).thenReturn(failedTests.size());