ModernRouterNavigator implements RouterNavigator<StateT> { @Nullable @Override public StateT peekState() { RouterAndState<StateT> top = peekCurrentRouterAndState(); if (top == null) { return null; } return top.getState(); } 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();  }
@Test public void peekState() { assertThat(routerNavigator.peekState()).isNull(); routerNavigator.pushRetainedState(TestState.STATE_1, attachTransitionOne, detachTransitionOne); assertThat(routerNavigator.peekState()).isEqualTo(TestState.STATE_1); routerNavigator.popState(); assertThat(routerNavigator.peekState()).isNull(); }