public static Set<Interval> mergeIntervalToSet(Set<Interval> intervals,Interval intervalToMerge){
  LinkedHashSet<Interval> copyOfOriginalSet=new LinkedHashSet<>(intervals);
  copyOfOriginalSet.add(intervalToMerge);
  return mergeIntervalSet(copyOfOriginalSet);
}

public static Set < Interval > mergeIntervalToSet ( Set < Interval > intervals , Interval intervalToMerge ) { LinkedHashSet < Interval > copyOfOriginalSet = new LinkedHashSet < > ( intervals ) ; copyOfOriginalSet . add ( intervalToMerge ) ; return mergeIntervalSet ( copyOfOriginalSet ) ; }
merge an interval into the given interval set .
