UberfireBreadcrumbs { Command generateBreadCrumbSelectCommand(final String perspective, final DefaultBreadcrumbsPresenter breadCrumb, final PlaceRequest placeRequest, final Command command) { if (command == null) { return null; } return () -> { removeDeepLevelBreadcrumbsIfNecessary(perspective, breadCrumb); breadCrumb.deactivate(); if (placeRequest != null) { placeManager.goTo(placeRequest); } updateView(); command.execute(); }; } @Inject  UberfireBreadcrumbs(UberfireBreadcrumbsContainer uberfireBreadcrumbsContainer,
                               ManagedInstance<DefaultBreadcrumbsPresenter> breadcrumbsPresenters,
                               PlaceManager placeManager,
                               View view); @PostConstruct void createBreadcrumbs(); void clearBreadcrumbs(final String associatedPerspective); void clearBreadcrumbsAndToolBars(final String associatedPerspective); void addBreadCrumb(final String associatedPerspective,
                              final String breadCrumbLabel,
                              final Command command); void addBreadCrumb(final String associatedPerspective,
                              final String breadCrumbLabel,
                              final Command command,
                              final boolean removeDeepLevelBreadcrumbsAfterActivation); void addBreadCrumb(final String associatedPerspective,
                              final String breadCrumbLabel,
                              final PlaceRequest associatedPlaceRequest); void addBreadCrumb(final String associatedPerspective,
                              final String breadCrumbLabel,
                              final PlaceRequest associatedPlaceRequest,
                              final Command command); void addBreadCrumb(final String associatedPerspective,
                              final String breadCrumbLabel,
                              final PlaceRequest associatedPlaceRequest,
                              final Command command,
                              final boolean removeDeepLevelBreadcrumbsAfterActivation); void addBreadCrumb(final String associatedPerspective,
                              final BreadcrumbPresenter breadCrumbPresenter); void addToolbar(final String associatedPerspective,
                           final Element toolbar);  }
@Test public void generateBreadCrumbSelectCommandTest() { DefaultPlaceRequest placeRequest = new DefaultPlaceRequest("screen"); final Command command = mock(Command.class); uberfireBreadcrumbs.addBreadCrumb("myperspective", "label", placeRequest); List<BreadcrumbPresenter> breadcrumbs = uberfireBreadcrumbs.breadcrumbsPerPerspective.get("myperspective"); DefaultBreadcrumbsPresenter breadcrumb = (DefaultBreadcrumbsPresenter) breadcrumbs.get(0); uberfireBreadcrumbs.generateBreadCrumbSelectCommand("myperspective", breadcrumb, placeRequest, command).execute(); verify(placeManager).goTo(placeRequest); verify(placeManager, never()).goTo(eq(placeRequest), any(HasWidgets.class)); verify(command).execute(); }