Router { public void replaceAllWith(Screen... screens) { replaceAllWith(Arrays.asList(screens)); } Router();  Router(boolean allowEmptyStack); boolean goBack(); void goTo(Screen nextScreen); void replaceWith(Screen nextScreen); void replaceAllWith(Screen... screens); void replaceAllWith(List<Screen> screens); void resetTo(Screen screen); void resetTo(Screen nextScreen, TransitionDirection direction); boolean hasActiveScreen();  }
@Test public void replaceAllWith() { router = new TestRouter(false); Screen screenA = new ScreenA(); Screen screenB = new ScreenB(); router.goTo(screenA); router.replaceAllWith(screenA, screenB); assertEquals(screenA, router.fromPath.get(0)); assertEquals(screenA, router.toPath.get(0)); assertEquals(screenB, router.toPath.get(1)); assertEquals(2, router.routeChangeCount); }