public void replaceHistory(@NonNull final Object key, @NonNull final Direction direction) {
    setHistory(getHistory().buildUpon().clear().push(key).build(), direction);
  }
public void replaceHistory ( @ NonNull final Object key , @ NonNull final Direction direction ) { setHistory ( getHistory ( ) . buildUpon ( ) . clear ( ) . push ( key ) . build ( ) , direction ) ; }
Replaces the history with the given key and dispatches in the given direction.