// Path: honeybadger-java/src/main/java/io/honeybadger/reporter/config/ConfigContext.java
// public interface ConfigContext {
//     /** @return name of environment */
//     String getEnvironment();
// 
//     /** @return Honeybadger URL to use */
//     URI getHoneybadgerUrl();
// 
//     /** @return Honeybadger API key to use */
//     String getApiKey();
// 
//     /** @return Set of system properties to not include */
//     Set<String> getExcludedSysProps();
// 
//     /** @return Set of parameters to not include */
//     Set<String> getExcludedParams();
// 
//     /** @return Set of exception classes to ignore */
//     Set<String> getExcludedClasses();
// 
//     /** @return String that maps a package to an application */
//     String getApplicationPackage();
// 
//     /** @return Honeybadger Read API key */
//     String getHoneybadgerReadApiKey();
// 
//     /** @return Do we display the feedback form? */
//     Boolean isFeedbackFormDisplayed();
// 
//     /** @return The path to the feedback form template */
//     String getFeedbackFormPath();
// 
//     /** @return Host of proxy server to send traffic through */
//     String getHttpProxyHost();
// 
//     /** @return Port of proxy server to send traffic through */
//     Integer getHttpProxyPort();
// 
//     /** @return Optional configuration parameter to adjust number of attempts to retry sending an error
//      * report in the event of a network timeout or other transmission exception. Defaults to 3. */
//     Integer getMaximumErrorReportingRetries();
// 
//     /** @return Timeout for socket connection within HTTP client */
//     Integer getSocketTimeout();
// 
//     /** @return Timeout for initial connect within HTTP client */
//     Integer getConnectTimeout();
// }


import io.honeybadger.reporter.config.ConfigContext;
import org.junit.Test;
import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertTrue;
import static org.mockito.Mockito.mock;
        Throwable cause = new RuntimeException("Cause");
        Throwable e = new RuntimeException("Highest level", cause);

        Causes causes = new Causes(config, e);

        assertEquals("There should only be a single cause",
                1, causes.size());
        assertEquals("The cause class should be stored",
                     cause.getMessage(), causes.get(0).getMessage());
    }

    @Test
    public void lastItemInCausesIsTheRootCause() {
        Throwable cause4 = new RuntimeException("Cause 4");
        Throwable cause3 = new RuntimeException("Cause 3", cause4);
        Throwable cause2 = new RuntimeException("Cause 2", cause3);
        Throwable cause1 = new RuntimeException("Cause 1", cause2);

        Throwable e = new RuntimeException("Highest level", cause1);

        Causes causes = new Causes(config, e);

        assertEquals("There should be 4 causes chained",
                4, causes.size());
        assertEquals("The root cause class should be stored last",
                cause1.getMessage(), causes.get(3).getMessage());
        assertEquals("The second cause class should be stored second to last",
                cause2.getMessage(), causes.get(2).getMessage());
        assertEquals("The third cause class should be stored third to last",
                cause3.getMessage(), causes.get(1).getMessage());
// Path: honeybadger-java/src/main/java/io/honeybadger/reporter/config/ConfigContext.java
// public interface ConfigContext {
//     /** @return name of environment */
//     String getEnvironment();
// 
//     /** @return Honeybadger URL to use */
//     URI getHoneybadgerUrl();
// 
//     /** @return Honeybadger API key to use */
//     String getApiKey();
// 
//     /** @return Set of system properties to not include */
//     Set<String> getExcludedSysProps();
// 
//     /** @return Set of parameters to not include */
//     Set<String> getExcludedParams();
// 
//     /** @return Set of exception classes to ignore */
//     Set<String> getExcludedClasses();
// 
//     /** @return String that maps a package to an application */
//     String getApplicationPackage();
// 
//     /** @return Honeybadger Read API key */
//     String getHoneybadgerReadApiKey();
// 
//     /** @return Do we display the feedback form? */
//     Boolean isFeedbackFormDisplayed();
// 
//     /** @return The path to the feedback form template */
//     String getFeedbackFormPath();
// 
//     /** @return Host of proxy server to send traffic through */
//     String getHttpProxyHost();
// 
//     /** @return Port of proxy server to send traffic through */
//     Integer getHttpProxyPort();
// 
//     /** @return Optional configuration parameter to adjust number of attempts to retry sending an error
//      * report in the event of a network timeout or other transmission exception. Defaults to 3. */
//     Integer getMaximumErrorReportingRetries();
// 
//     /** @return Timeout for socket connection within HTTP client */
//     Integer getSocketTimeout();
// 
//     /** @return Timeout for initial connect within HTTP client */
//     Integer getConnectTimeout();
// }


// Path: honeybadger-java/src/test/java/io/honeybadger/reporter/dto/CausesTest.java
import io.honeybadger.reporter.config.ConfigContext;
import org.junit.Test;
import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertTrue;
import static org.mockito.Mockito.mock;

        Throwable cause = new RuntimeException("Cause");
        Throwable e = new RuntimeException("Highest level", cause);

        Causes causes = new Causes(config, e);

        assertEquals("There should only be a single cause",
                1, causes.size());
        assertEquals("The cause class should be stored",
                     cause.getMessage(), causes.get(0).getMessage());
    }

    @Test
    public void lastItemInCausesIsTheRootCause() {
        Throwable cause4 = new RuntimeException("Cause 4");
        Throwable cause3 = new RuntimeException("Cause 3", cause4);
        Throwable cause2 = new RuntimeException("Cause 2", cause3);
        Throwable cause1 = new RuntimeException("Cause 1", cause2);

        Throwable e = new RuntimeException("Highest level", cause1);

        Causes causes = new Causes(config, e);

        assertEquals("There should be 4 causes chained",
                4, causes.size());
        assertEquals("The root cause class should be stored last",
                cause1.getMessage(), causes.get(3).getMessage());
        assertEquals("The second cause class should be stored second to last",
                cause2.getMessage(), causes.get(2).getMessage());
        assertEquals("The third cause class should be stored third to last",
                cause3.getMessage(), causes.get(1).getMessage());
        assertEquals("The fourth cause class should be stored first",