@Test public void pushRetained_whenNotInitialPush_shouldRunPreviousDetachRunnerAndRunNewAttachRunnerWithCorrectState() { routerNavigator.pushRetainedState(TestState.STATE_1, attachTransitionOne, detachTransitionOne); verify(attachTransitionOne).willAttachToHost(routerOne, null, TestState.STATE_1, true); verify(hostRouter).attachChild(routerOne); verifyZeroInteractions(detachTransitionOne); routerNavigator.pushRetainedState(TestState.STATE_2, attachTransitionTwo, detachTransitionTwo); verify(detachTransitionOne) .willDetachFromHost(routerOne, TestState.STATE_1, TestState.STATE_2, true); verify(hostRouter).detachChild(routerOne); verify(attachTransitionTwo) .willAttachToHost(routerTwo, TestState.STATE_1, TestState.STATE_2, true); verifyZeroInteractions(detachTransitionTwo); }
@Override public <R extends Router> void pushRetainedState( final StateT newState, final AttachTransition<R, StateT> attachTransition, @Nullable final DetachTransition<R, StateT> detachTransition) { pushInternal(newState, attachTransition, detachTransition, false); }
ModernRouterNavigator implements RouterNavigator<StateT> { @Override public <R extends Router> void pushRetainedState( final StateT newState, final AttachTransition<R, StateT> attachTransition, @Nullable final DetachTransition<R, StateT> detachTransition) { pushInternal(newState, attachTransition, detachTransition, false); } }
ModernRouterNavigator implements RouterNavigator<StateT> { @Override public <R extends Router> void pushRetainedState( final StateT newState, final AttachTransition<R, StateT> attachTransition, @Nullable final DetachTransition<R, StateT> detachTransition) { pushInternal(newState, attachTransition, detachTransition, false); } ModernRouterNavigator(Router<?, ?> hostRouter); }
ModernRouterNavigator implements RouterNavigator<StateT> { @Override public <R extends Router> void pushRetainedState( final StateT newState, final AttachTransition<R, StateT> attachTransition, @Nullable final DetachTransition<R, StateT> detachTransition) { pushInternal(newState, attachTransition, detachTransition, false); } ModernRouterNavigator(Router<?, ?> hostRouter); @SuppressWarnings("unchecked") @Override void popState(); @Override void pushRetainedState(
      final StateT newState,
      final AttachTransition<R, StateT> attachTransition,
      @Nullable final DetachTransition<R, StateT> detachTransition); @Override void pushRetainedState(
      StateT newState, AttachTransition<R, StateT> attachTransition); @Override void pushTransientState(
      final StateT newState,
      final AttachTransition<R, StateT> attachTransition,
      @Nullable final DetachTransition<R, StateT> detachTransition); @Override void pushTransientState(
      StateT newState, AttachTransition<R, StateT> attachTransition); @Nullable @Override Router peekRouter(); @Nullable @Override StateT peekState(); @IntRange(from = 0) @Override int size(); @Override void hostWillDetach(); }
ModernRouterNavigator implements RouterNavigator<StateT> { @Override public <R extends Router> void pushRetainedState( final StateT newState, final AttachTransition<R, StateT> attachTransition, @Nullable final DetachTransition<R, StateT> detachTransition) { pushInternal(newState, attachTransition, detachTransition, false); } ModernRouterNavigator(Router<?, ?> hostRouter); @SuppressWarnings("unchecked") @Override void popState(); @Override void pushRetainedState(
      final StateT newState,
      final AttachTransition<R, StateT> attachTransition,
      @Nullable final DetachTransition<R, StateT> detachTransition); @Override void pushRetainedState(
      StateT newState, AttachTransition<R, StateT> attachTransition); @Override void pushTransientState(
      final StateT newState,
      final AttachTransition<R, StateT> attachTransition,
      @Nullable final DetachTransition<R, StateT> detachTransition); @Override void pushTransientState(
      StateT newState, AttachTransition<R, StateT> attachTransition); @Nullable @Override Router peekRouter(); @Nullable @Override StateT peekState(); @IntRange(from = 0) @Override int size(); @Override void hostWillDetach();  }