package org.helioviewer.jhv.events;

import javax.annotation.Nonnull;

public class SortedInterval implements Comparable<SortedInterval> {

    public long start;
    public long end;
    private final int id;
    private static int id_gen = Integer.MIN_VALUE;

    public SortedInterval(long _start, long _end) {
        start = _start;
        end = _end;
        id = id_gen++;
    }

    @Override
    public boolean equals(Object o) {
        return o instanceof SortedInterval && compareTo((SortedInterval) o) == 0;
    }

    @Override
    public int hashCode() {
        int result = (int) (start ^ (start >>> 32));
        result = 31 * result + (int) (end ^ (end >>> 32));
        return 31 * result + id;
    }

    @Override
    public int compareTo(@Nonnull SortedInterval o2) {
        if (start < o2.start) {
            return -1;
        }
        if (start == o2.start && end < o2.end) {
            return -1;
        }
        if (start == o2.start && end == o2.end && o2.id < id) {
            return -1;
        }
        if (start == o2.start && end == o2.end && o2.id == id) {
            return 0;
        }
        return 1;
    }

}

@@ -180,85 +180,8 @@
 end;
-%0A    private final int id;%0A    private static int id_gen = Integer.MIN_VALUE;
 %0A%0A  
@@ -278,31 +278,8 @@
 nd;%0A
-        id = id_gen++;%0A
     
@@ -527,22 +527,20 @@
       re
-sult =
+turn
  31 * re
@@ -578,41 +578,8 @@
 ));%0A
-        return 31 * result + id;%0A
     
@@ -789,32 +789,32 @@
 n -1;%0A        %7D%0A
+
         if (star
@@ -847,120 +847,8 @@
 .end
- && o2.id %3C id) %7B%0A            return -1;%0A        %7D%0A        if (start == o2.start && end == o2.end && o2.id == id
 ) %7B%0A

Remove SortedInterval id