code: public void goBackToRoot(NavigationType navigationType) {
      navigate(new HistoryRewriter() {
        @Override
        public void rewriteHistory(Deque<Screen> history) {
          while (history.size() > 1) {
            history.pop();
          }
        }
      }, navigationType, BACKWARD);
    }
docs: Navigates from current screen all the way to the root screen in this Navigator's back stack, removing all
  intermediate screen in this Navigator's back stack along the way. The current screen animates out of the view
  according to the animation specified by the NavigationType parameter.
  
  @param navigationType  determines how the navigation event is animated