documentation/manual/working/javaGuide/advanced/routing/code/javaguide/advanced/routing/JavaRoutingDsl.java
@Test
  public void createNewRoutingDsl() {
    play.mvc.BodyParser.Default bodyParser =
        app.injector().instanceOf(play.mvc.BodyParser.Default.class);
    JavaContextComponents javaContextComponents =
        app.injector().instanceOf(JavaContextComponents.class);

    // #new-routing-dsl
    RoutingDsl routingDsl = new RoutingDsl(bodyParser, javaContextComponents);
    // #new-routing-dsl
    Router router =
        routingDsl.GET("/hello/:to").routingTo((request, to) -> ok("Hello " + to)).build();

    assertThat(makeRequest(router, "GET", "/hello/world"), equalTo("Hello world"));
  }
@Test
  public void createNewRoutingDsl() {
    play.mvc.BodyParser.Default bodyParser =
        app.injector().instanceOf(play.mvc.BodyParser.Default.class);
    JavaContextComponents javaContextComponents =
        app.injector().instanceOf(JavaContextComponents.class);

    // #new-routing-dsl
    RoutingDsl routingDsl = new RoutingDsl(bodyParser, javaContextComponents);
    // #new-routing-dsl
    Router router =
        routingDsl.GET("/hello/:to").routingTo((request, to) -> ok("Hello " + to)).build();

    assertThat(makeRequest(router, "GET", "/hello/world"), equalTo("Hello world"));
  }
@ Test public void createNewRoutingDsl ( ) { play . mvc . BodyParser . Default bodyParser = app . injector ( ) . instanceOf ( play . mvc . BodyParser . Default . class ) ; JavaContextComponents javaContextComponents = app . injector ( ) . instanceOf ( JavaContextComponents . class ) ; // #new-routing-dsl RoutingDsl routingDsl = new RoutingDsl ( bodyParser , javaContextComponents ) ; // #new-routing-dsl Router router = routingDsl . GET ( "/hello/:to" ) . routingTo ( ( request , to ) -> ok ( "Hello " + to ) ) . build ( ) ; assertThat ( makeRequest ( router , "GET" , "/hello/world" ) , equalTo ( "Hello world" ) ) ; }
#inject
#inject