public static List<Interval> merge(List<Interval> intervals) {
		Collections.sort(intervals, new Comparator<Interval>() {
			@Override
			public int compare(Interval o1, Interval o2) {
				// TODO Auto-generated method stub
				return o1.start-o2.start;
			}
			
		});
		for (int i = 0; i < intervals.size() - 1; i++) {
			Interval o1 = intervals.get(i);
			Interval o2 = intervals.get(i + 1);
			if (o1.end < o2.start) continue;
			if (o1.end >= o2.start && o1.end <= o2.end) {
				Interval o = new Interval(o1.start, o2.end);
				intervals.add(i, o);
				intervals.remove(i + 1);
				intervals.remove(i + 1);
				i--;
			} else {
				intervals.remove(i + 1);
				i--;
			}
		}
		return intervals;
	}