RouterLink extends Component implements HasText, HasComponents,
        HasStyle, AfterNavigationObserver, Focusable<RouterLink> { public void setHighlightAction( HighlightAction<RouterLink> highlightAction) { Objects.requireNonNull(highlightCondition, "HighlightAction may not be null"); this.highlightAction.highlight(this, false); this.highlightAction = highlightAction; } RouterLink();  RouterLink(String text,
            Class<? extends Component> navigationTarget); <T, C extends Component & HasUrlParameter<T>> RouterLink(String text,
            Class<? extends C> navigationTarget, T parameter);  RouterLink(String text, Class<? extends Component> navigationTarget,
            RouteParameters parameters);  RouterLink(Router router, String text,
            Class<? extends Component> navigationTarget); <T, C extends Component & HasUrlParameter<T>> RouterLink(
            Router router, String text, Class<? extends C> navigationTarget,
            T parameter);  RouterLink(Router router, String text,
            Class<? extends Component> navigationTarget,
            RouteParameters parameters); void setRoute(Router router,
            Class<? extends Component> navigationTarget); void setRoute(
            Router router, Class<? extends C> navigationTarget, T parameter); void setRoute(Router router,
            Class<? extends Component> navigationTarget,
            RouteParameters parameters); void setRoute(Class<? extends Component> navigationTarget); void setRoute(
            Class<? extends C> navigationTarget, T parameter); void setRoute(Class<? extends Component> navigationTarget,
            RouteParameters parameters); String getHref(); Optional<QueryParameters> getQueryParameters(); void setQueryParameters(QueryParameters queryParameters); HighlightCondition<RouterLink> getHighlightCondition(); void setHighlightCondition(
            HighlightCondition<RouterLink> highlightCondition); HighlightAction<RouterLink> getHighlightAction(); void setHighlightAction(
            HighlightAction<RouterLink> highlightAction); @Override void afterNavigation(AfterNavigationEvent event);  }
@Test public void routerLinkClearOldHighlightAction() throws InvalidRouteConfigurationException { RouterLink link = new RouterLink(router, "Foo", FooNavigationTarget.class); triggerNavigationEvent(router, link, "foo/bar"); link.setHighlightAction(HighlightActions.toggleClassName("highlight")); triggerNavigationEvent(router, link, "foo/bar/baz"); Assert.assertFalse(link.getElement().hasAttribute("highlight")); }
@Test public void routerLinkClassNameHightlightAction() throws InvalidRouteConfigurationException { RouterLink link = new RouterLink(router, "Foo", FooNavigationTarget.class); link.setHighlightAction(HighlightActions.toggleClassName("highlight")); triggerNavigationEvent(router, link, "foo/bar"); Assert.assertTrue(link.hasClassName("highlight")); triggerNavigationEvent(router, link, "bar"); Assert.assertFalse(link.hasClassName("highlight")); }
@Test public void routerLinkThemeHightlightAction() throws InvalidRouteConfigurationException { RouterLink link = new RouterLink(router, "Foo", FooNavigationTarget.class); link.setHighlightAction(HighlightActions.toggleTheme("highlight")); triggerNavigationEvent(router, link, "foo/bar"); Assert.assertTrue( link.getElement().getThemeList().contains("highlight")); triggerNavigationEvent(router, link, "bar"); Assert.assertFalse( link.getElement().getThemeList().contains("highlight")); }