code: public void closeRun() {
  		if(positionChanges.isEmpty())
  		  return;
  	  		
  		  
  		SortedMap<Integer,Integer> temp=positionChanges;
  		 
  		//adapt old positions to new mapping
  		while(!positionMap.isEmpty()){
  		  Integer key=positionMap.firstKey();
  	  	  Collection<Integer> modifiers=old2NewMap.headMap(key+1).values();
  	  	  Integer newposition=key;    	
  	  	  for(Iterator<Integer> it=modifiers.iterator(); it.hasNext(); newposition+=it.next()){}
  	  	  Integer value=positionMap.get(key);
  	  	  if(positionChanges.containsKey(newposition))
  	  		  value+=positionChanges.get(newposition);
  	  	  positionChanges.put(newposition, value);
  	  	  positionMap.remove(key);
  		}
  
  		positionChanges=positionMap;
  		positionMap=temp;
  		old2NewMap.clear();
  		accumulatedModifier=0;
  		return;
  	}
docs: Closes the current changing run by Merging new position changes into the existing position change map
  after each round (one round=consecutive changes along the text) you need to call closeRun() before submitting more position changes from a new round,
  i.e. whenever you passed the string to be modified once call closeRun() before starting to run over the string again with more replacements
  Do this every time you ran once over the text making changes to be tracked