Api { public static Stream<Route<AsyncHandler<Response<ByteString>>>> prefixRoutes( Collection<Route<AsyncHandler<Response<ByteString>>>> routes, Version... versions) { return Stream.of(versions) .flatMap(v -> routes.stream().map(route -> route.withPrefix(v.prefix()))); } private  Api(); static Stream<Route<AsyncHandler<Response<ByteString>>>> prefixRoutes(
      Collection<Route<AsyncHandler<Response<ByteString>>>> routes,
      Version... versions); static Stream<Route<AsyncHandler<Response<ByteString>>>> withCommonMiddleware(
      Stream<Route<AsyncHandler<Response<ByteString>>>> routes,
      RequestAuthenticator authenticator,
      String service); static Stream<Route<AsyncHandler<Response<ByteString>>>> withCommonMiddleware(
      Stream<Route<AsyncHandler<Response<ByteString>>>> routes,
      Supplier<Set<String>> clientBlacklistSupplier,
      RequestAuthenticator authenticator,
      String service);  }
@Test public void shouldPrefixRoutes() { final List<String> prefixedUris = Api.prefixRoutes(ROUTES, Api.Version.V3) .map(Route::uri) .collect(toList()); assertThat(prefixedUris, is(List.of("/api/v3/foo", "/api/v3/bar"))); }