public void merge(Register r1,Register r2){
  Iterator<LiveIntervalElement> i=iterateLiveIntervals(r2);
  while (i.hasNext()) {
    LiveIntervalElement interval=i.next();
    interval.setRegister(r1);
    addToRegisterMap(r1,interval);
    i.remove();
  }
}

public void merge ( Register r1 , Register r2 ) { Iterator < LiveIntervalElement > i = iterateLiveIntervals ( r2 ) ; while ( i . hasNext ( ) ) { LiveIntervalElement interval = i . next ( ) ; interval . setRegister ( r1 ) ; addToRegisterMap ( r1 , interval ) ; i . remove ( ) ; } }
update the data structures to reflect that all live intervals for r2 are now intervals for r1 .
