public boolean verify(ApplicationSpec app, List<String> errors) {
        if (verify) {
            // Verify and count hops.
            Map<String, Integer> hopNames = new HashMap<String, Integer>();
            for (HopSpec hop : hops) {
                String name = hop.getName();
                int count = hopNames.containsKey(name) ? hopNames.get(name) : 0;
                hopNames.put(name, count + 1);
                hop.verify(app, this, errors);
            }
            for (Map.Entry<String, Integer> entry : hopNames.entrySet()) {
                int count = entry.getValue();
                if (count > 1) {
                    errors.add("Hop '" + entry.getKey() + "' in routing table '" + protocol + "' is defined " +
                               count + " times.");
                }
            }

            // Verify and count routes.
            Map<String, Integer> routeNames = new HashMap<String, Integer>();
            for (RouteSpec route : routes) {
                String name = route.getName();
                int count = routeNames.containsKey(name) ? routeNames.get(name) : 0;
                routeNames.put(name, count + 1);
                route.verify(app, this, errors);
            }
            for (Map.Entry<String, Integer> entry : routeNames.entrySet()) {
                int count = entry.getValue();
                if (count > 1) {
                    errors.add("Route '" + entry.getKey() + "' in routing table '" + protocol + "' is defined " +
                               count + " times.");
                }
            }
        }
        return errors.isEmpty();
    }
Verifies the content of this against the given application.

@param app    The application to verify against.
@param errors The list of errors found.
@return True if no errors where found.
messagebus/src/main/java/com/yahoo/messagebus/routing/RoutingTableSpec.java