Insert Interval in Java