code: public void setHistory(@NonNull final History history, @NonNull final Direction direction) {
      move(new PendingTraversal() {
        @Override void doExecute() {
          dispatch(preserveEquivalentPrefix(getHistory(), history), direction);
        }
      });
    }
docs: Replaces the history with the one given and dispatches in the given direction.