// Path: src/main/java/org/jenkinsci/plugins/ghprb/manager/GhprbBuildManager.java
// public interface GhprbBuildManager {
// 
//     /**
//      * Calculate the build URL of a build
//      *
//      * @param publishedURL the public jenkins url
//      * @return the build URL
//      */
//     String calculateBuildUrl(String publishedURL);
// 
//     /**
//      * Returns downstream builds as an iterator
//      *
//      * @return the iterator
//      */
//     Iterator<?> downstreamProjects();
// 
//     /**
//      * Print tests result of a build in one line.
//      *
//      * @return the tests result
//      */
//     String getOneLineTestResults();
// 
//     /**
//      * Print tests result of a build
//      *
//      * @return the tests result
//      */
//     String getTestResults();
// }
// 
// Path: src/main/java/org/jenkinsci/plugins/ghprb/manager/configuration/JobConfiguration.java
// public final class JobConfiguration {
// 
//     public static PrintStackTrace builder() {
//         return new JobConfigurationBuilder();
//     }
// 
//     private boolean printStacktrace;
// 
//     private JobConfiguration() {
//     }
// 
//     public boolean printStackTrace() {
//         return this.printStacktrace;
//     }
// 
//     public interface PrintStackTrace {
//         Build printStackTrace(boolean print);
//     }
// 
//     public interface Build {
//         JobConfiguration build();
//     }
// 
//     public static final class JobConfigurationBuilder implements Build, PrintStackTrace {
// 
//         private JobConfiguration jobConfiguration = new JobConfiguration();
// 
//         public JobConfiguration build() {
//             return jobConfiguration;
//         }
// 
//         public Build printStackTrace(boolean print) {
//             jobConfiguration.printStacktrace = print;
//             return this;
//         }
//     }
// }


import hudson.model.Job;
import hudson.model.Result;
import hudson.model.Run;
import hudson.tasks.junit.CaseResult;
import hudson.tasks.junit.TestResult;
import hudson.tasks.test.AbstractTestResultAction;
import hudson.tasks.test.AggregatedTestResultAction;
import hudson.tasks.test.AggregatedTestResultAction.ChildReport;
import jenkins.model.Jenkins;
import org.jenkinsci.plugins.ghprb.manager.GhprbBuildManager;
import org.jenkinsci.plugins.ghprb.manager.configuration.JobConfiguration;
import java.io.IOException;
import java.util.ArrayList;
import java.util.Iterator;
import java.util.List;
import java.util.logging.Level;
import java.util.logging.Logger;
            sb.append("<a name='");
            sb.append(project.getFullName());
            sb.append("' />");
            sb.append("<a href='");
            sb.append(baseUrl);
            sb.append("'>");
            sb.append(project.getFullName());
            sb.append("</a>");
            sb.append(": ");
            sb.append("<span class='status-failure'>");
            sb.append(result.getFailCount());
            sb.append("</span></h3>");

            sb.append("<ul>");

            List<CaseResult> failedTests = result.getFailedTests();

            for (CaseResult failedTest : failedTests) {
                sb.append("<li>");
                sb.append("<a href='");
                sb.append(baseUrl);
                sb.append("/");
                sb.append(failedTest.getRelativePathFrom(result));
                sb.append("'>");
                sb.append("<strong>");
                sb.append(failedTest.getFullDisplayName());
                sb.append("</strong>");
                sb.append("</a>");

                if (getJobConfiguration().printStackTrace()) {
// Path: src/main/java/org/jenkinsci/plugins/ghprb/manager/GhprbBuildManager.java
// public interface GhprbBuildManager {
// 
//     /**
//      * Calculate the build URL of a build
//      *
//      * @param publishedURL the public jenkins url
//      * @return the build URL
//      */
//     String calculateBuildUrl(String publishedURL);
// 
//     /**
//      * Returns downstream builds as an iterator
//      *
//      * @return the iterator
//      */
//     Iterator<?> downstreamProjects();
// 
//     /**
//      * Print tests result of a build in one line.
//      *
//      * @return the tests result
//      */
//     String getOneLineTestResults();
// 
//     /**
//      * Print tests result of a build
//      *
//      * @return the tests result
//      */
//     String getTestResults();
// }
// 
// Path: src/main/java/org/jenkinsci/plugins/ghprb/manager/configuration/JobConfiguration.java
// public final class JobConfiguration {
// 
//     public static PrintStackTrace builder() {
//         return new JobConfigurationBuilder();
//     }
// 
//     private boolean printStacktrace;
// 
//     private JobConfiguration() {
//     }
// 
//     public boolean printStackTrace() {
//         return this.printStacktrace;
//     }
// 
//     public interface PrintStackTrace {
//         Build printStackTrace(boolean print);
//     }
// 
//     public interface Build {
//         JobConfiguration build();
//     }
// 
//     public static final class JobConfigurationBuilder implements Build, PrintStackTrace {
// 
//         private JobConfiguration jobConfiguration = new JobConfiguration();
// 
//         public JobConfiguration build() {
//             return jobConfiguration;
//         }
// 
//         public Build printStackTrace(boolean print) {
//             jobConfiguration.printStacktrace = print;
//             return this;
//         }
//     }
// }


// Path: src/main/java/org/jenkinsci/plugins/ghprb/manager/impl/GhprbBaseBuildManager.java
import hudson.model.Job;
import hudson.model.Result;
import hudson.model.Run;
import hudson.tasks.junit.CaseResult;
import hudson.tasks.junit.TestResult;
import hudson.tasks.test.AbstractTestResultAction;
import hudson.tasks.test.AggregatedTestResultAction;
import hudson.tasks.test.AggregatedTestResultAction.ChildReport;
import jenkins.model.Jenkins;
import org.jenkinsci.plugins.ghprb.manager.GhprbBuildManager;
import org.jenkinsci.plugins.ghprb.manager.configuration.JobConfiguration;
import java.io.IOException;
import java.util.ArrayList;
import java.util.Iterator;
import java.util.List;
import java.util.logging.Level;
import java.util.logging.Logger;

            sb.append("<a name='");
            sb.append(project.getFullName());
            sb.append("' />");
            sb.append("<a href='");
            sb.append(baseUrl);
            sb.append("'>");
            sb.append(project.getFullName());
            sb.append("</a>");
            sb.append(": ");
            sb.append("<span class='status-failure'>");
            sb.append(result.getFailCount());
            sb.append("</span></h3>");

            sb.append("<ul>");

            List<CaseResult> failedTests = result.getFailedTests();

            for (CaseResult failedTest : failedTests) {
                sb.append("<li>");
                sb.append("<a href='");
                sb.append(baseUrl);
                sb.append("/");
                sb.append(failedTest.getRelativePathFrom(result));
                sb.append("'>");
                sb.append("<strong>");
                sb.append(failedTest.getFullDisplayName());
                sb.append("</strong>");
                sb.append("</a>");

                if (getJobConfiguration().printStackTrace()) {
                    sb.append("\n```\n");