Override equals() and hashCode() for SingleInterval