RouteModel implements Serializable { void removeRoute(String template) { throwIfImmutable(); root.removeSubRoute(template); } private  RouteModel(boolean mutable); private  RouteModel(RouteSegment root, boolean mutable);   }
@Test public void remove_route_target_not_found() { RouteModel root = getRouteModel(); assertNavigation(root, "trunk/branch/12", Branch.class, parameters("id", "12")); root.removeRoute( "trunk/branch/:id(" + RouteParameterRegex.INTEGER + ")"); assertNavigation(root, "trunk/branch/12", BranchChildren.class, parameters("id", "12")); root.removeRoute("trunk/branch/:id(" + RouteParameterRegex.INTEGER + ")/:list*(" + RouteParameterRegex.LONG + ")"); assertNavigation(root, "trunk/branch/12", null, null); }
@Test public void remove_route_url_not_found() { RouteModel root = getRouteModel(); final String expectedUrl = "trunk/branch/12"; final String template = "trunk/branch/:id(" + RouteParameterRegex.INTEGER + ")"; final RouteParameters parameters = parameters("id", "12"); assertUrl(root, expectedUrl, template, parameters); root.removeRoute(template); try { assertUrl(root, expectedUrl, template, parameters); Assert.fail("Route was just removed."); } catch (IllegalArgumentException e) { } }