public List<String> reset(List<String> replace){
  ArrayList<String> copy=new ArrayList<String>(retainedVars.size());
  copy.addAll(retainedVars);
  retainedVars.clear();
  if (replace != null) {
    retainedVars.addAll(replace);
  }
  return copy;
}

public List < String > reset ( List < String > replace ) { ArrayList < String > copy = new ArrayList < String > ( retainedVars . size ( ) ) ; copy . addAll ( retainedVars ) ; retainedVars . clear ( ) ; if ( replace != null ) { retainedVars . addAll ( replace ) ; } return copy ; }
replaces the list of retained vars with the specified list , returning the old list . if no list is specified then a new empty one is used .
