code: public void navigate(final HistoryRewriter historyRewriter, NavigationType navType, Direction direction) {
      navigate(direction, navType, new Runnable() {
        @Override
        public void run() {
          historyRewriter.rewriteHistory(backStack);
        }
      });
    }
docs: Navigates to the screen on top of the back stack after the HistoryRewriter has rewritten the back stack history.
  
  Animates the navigation according to the NavigationType parameter, in the direction specified by the Direction
  parameter.
  
  @param historyRewriter  manipulates the back stack during navigation
  @param navType  controls how the new screen is displayed to the user
  @param direction  controls the direction in which the new screen moves in and old screen moves out during navigation