### Question:
UriUtil { public static CloudRoute findRoute(List<CloudRoute> routes, String uri) { return routes.stream() .filter(route -> routeMatchesUri(route, uri)) .findAny() .orElseThrow(() -> new NotFoundException(Messages.ROUTE_NOT_FOUND, uri)); } private  UriUtil(); static String stripScheme(String uri); static CloudRoute findRoute(List<CloudRoute> routes, String uri); static boolean routeMatchesUri(CloudRoute route, String uri); static final String DEFAULT_SCHEME_SEPARATOR; static final char DEFAULT_PATH_SEPARATOR; static final char DEFAULT_HOST_DOMAIN_SEPARATOR; static final int STANDARD_HTTP_PORT; static final int STANDARD_HTTPS_PORT; static final String HTTP_PROTOCOL; static final String HTTPS_PROTOCOL; }### Answer:
@Test void testFindRouteWithHostBasedUriWithPort() { List<CloudRoute> routes = List.of(route); Assertions.assertThrows(NotFoundException.class, () -> UriUtil.findRoute(routes, HOST_BASED_URI_WITH_PORT)); }
@Test void testFindRouteWithHostBasedUriWithoutPort() { List<CloudRoute> routes = List.of(route); CloudRoute actualResult = UriUtil.findRoute(routes, HOST_BASED_URI_WITHOUT_PORT); Assertions.assertEquals(route, actualResult); }
@Test void testFindRouteWithPortBasedUri() { List<CloudRoute> routes = List.of(route); Assertions.assertThrows(NotFoundException.class, () -> UriUtil.findRoute(routes, PORT_BASED_URI)); }