Fixing null pointer exception in MiscProblems.java#mergeIntervals()