void add(int start,int end){
  final Map.Entry<Integer,Integer> floor=mIntervals.floorEntry(start);
  final Map.Entry<Integer,Integer> endFloor=mIntervals.lowerEntry(end);
  final int actualStart;
  final int actualEnd;
  if (floor != null && start >= floor.getKey() && end <= floor.getValue()) {
    return;
  }
  if (floor == null || start > floor.getValue()) {
    actualStart=start;
  }
 else {
    actualStart=Math.min(floor.getKey(),start);
  }
  if (endFloor == null) {
    actualEnd=end;
  }
 else {
    actualEnd=Math.max(endFloor.getValue(),end);
  }
  removeContainedBy(actualStart,actualEnd);
  mIntervals.put(actualStart,actualEnd);
}

void add ( int start , int end ) { final Map . Entry < Integer , Integer > floor = mIntervals . floorEntry ( start ) ; final Map . Entry < Integer , Integer > endFloor = mIntervals . lowerEntry ( end ) ; final int actualStart ; final int actualEnd ; if ( floor != null && start >= floor . getKey ( ) && end <= floor . getValue ( ) ) { return ; } if ( floor == null || start > floor . getValue ( ) ) { actualStart = start ; } else { actualStart = Math . min ( floor . getKey ( ) , start ) ; } if ( endFloor == null ) { actualEnd = end ; } else { actualEnd = Math . max ( endFloor . getValue ( ) , end ) ; } removeContainedBy ( actualStart , actualEnd ) ; mIntervals . put ( actualStart , actualEnd ) ; }
add a new region to the set
