question: public void addURL ( final String url ) { while ( currentIndex < history . size ( ) - 1 ) { history . remove ( currentIndex + 1 ) ; } history . add ( url ) ; currentIndex = history . size ( ) - 1 ; }
target:  Add a new URL to the browsing history. Adding a new URL causes all items beyond the current position to be eliminated from the history. The newly added URL will be at the end of the browser history upon return.