question: public void optimize ( ) { for ( int i = operations . size ( ) - 1 ; i >= 0 ; i -- ) { Operation o = operations . get ( i ) ; if ( o instanceof ClearOperation ) { while ( i > 0 ) { operations . remove ( i ) ; i -- ; } return ; } } }
target:  Optimize will remove any changes that are done before a clear()