public boolean equals(Object rhs) {
if (rhs instanceof DenseRange == false) {
return false;
}
final DenseRange<T> other = (DenseRange<T>) rhs;
final EqualsBuilder builder = new EqualsBuilder().append(this.sequencer, other.sequencer).
append(this.comparator, other.comparator);
if (!this.iterator().hasNext() && !other.iterator().hasNext()) {
return builder.isEquals();
}
return builder.
append(this.begin, other.begin).
append(this.end, other.end).
isEquals();
}