public void CutomIntervalCompare() { var interval1 = new VariantAnnotation.DataStructures.CustomInterval("chr1", 1000, 2000, "test", new Dictionary <string, string> { ["k1"] = "v1" }, null); var interval2 = new VariantAnnotation.DataStructures.CustomInterval("chr1", 1000, 2000, "test", new Dictionary <string, string> { ["k1"] = "v1" }, null); var interval3 = new VariantAnnotation.DataStructures.CustomInterval("chr1", 1010, 2000, "test", new Dictionary <string, string> { ["k1"] = "v1" }, null); var interval4 = new VariantAnnotation.DataStructures.CustomInterval("chr2", 1010, 2000, "test", new Dictionary <string, string> { ["k1"] = "v1" }, null); Assert.True(interval1.Equals(interval2)); Assert.Equal(-1, interval1.CompareTo(interval3)); Assert.Equal(-1, interval1.CompareTo(interval4)); var intervalHash = new HashSet <VariantAnnotation.DataStructures.CustomInterval> { interval4, interval1 }; Assert.Equal(2, intervalHash.Count); }