@Test public void testRouteSimilarity2() { String[] urls = new String[]{ "view1", "view2", "view3", "view4", "view5", "view6", "view7", "view8", "view9", "" }; String currentRoutePart = ""; RouteSimilarity r = Arrays.stream(urls) .map(s -> new RouteSimilarity(currentRoutePart, s)) .max(Comparator.comparingInt(RouteSimilarity::getSimilarity)).get(); String result1 = r.getRouteString(); String result2 = urls[9]; Assert.assertEquals(result1, result2); }
public String getRouteString() { return routeString; }
RouteSimilarity { public String getRouteString() { return routeString; } }
RouteSimilarity { public String getRouteString() { return routeString; } RouteSimilarity(RouteData routeData, String currentRoute);  RouteSimilarity(String url, String currentRouteParts); }
RouteSimilarity { public String getRouteString() { return routeString; } RouteSimilarity(RouteData routeData, String currentRoute);  RouteSimilarity(String url, String currentRouteParts); RouteData getRouteData(); Class<? extends Component> getRoute(); String getRouteString(); int getSimilarity(); }
RouteSimilarity { public String getRouteString() { return routeString; } RouteSimilarity(RouteData routeData, String currentRoute);  RouteSimilarity(String url, String currentRouteParts); RouteData getRouteData(); Class<? extends Component> getRoute(); String getRouteString(); int getSimilarity();  }