protected void gatherBestRouteCoverages() {

        // get a de-duplicated list of the routes
        testResults.forEach(testResult -> {

            List<Route> routeList = testResult.getCamelContextRouteCoverage().getRoutes().getRouteList();
            routeList.forEach(route -> {

                String routeId = route.getId();

                Route mappedRoute = routeMap.get(routeId);
                if (mappedRoute == null) {
                    // if the route only appears once, this will handle it
                    routeMap.put(routeId, route);
                    mappedRoute = routeMap.get(routeId);
                }

                // if the route appears multiple times in the test results,
                // look for the route with the best coverage of EIPs
                try {
                    if (route.getExchangesTotal() > mappedRoute.getExchangesTotal()) {
                        routeMap.put(routeId, route);
                    }
                } catch (Exception t) {
                    // this is an edge case that needs to be identified. Log some useful debugging information.
                    System.out.println(t.getClass().toString());
                    System.out.printf("routeID: %s%n", routeId);
                    System.out.printf("route: %s%n", route);
                    System.out.printf("mappedRoute: %s%n", mappedRoute != null ? mappedRoute.toString() : "null");
                }
            });
        });
    }
@Test
    public void testGatherBestRouteCoverages() throws IllegalAccessException, IOException {

        @SuppressWarnings("unchecked")
        List<TestResult> testResults = (List<TestResult>) FieldUtils.readDeclaredField(processor, "testResults", true);
        @SuppressWarnings("unchecked")
        Map<String, Route> result = (Map<String, Route>) FieldUtils.readDeclaredField(processor, "routeMap", true);

        processor.parseAllTestResults(xmlPath());
        testResults.add(TestUtil.testResult());

        assertAll(
                () -> assertNotNull(result),
                () -> assertEquals(0, result.size()));

        processor.gatherBestRouteCoverages();
        assertAll(
                () -> assertNotNull(result),
                () -> assertEquals(7, result.size()));
    }