Returns a view of the portion of this set whose elements range from {@code fromElement} to {@code toElement}. If {@code fromElement} and{@code toElement} are equal, the returned set is empty unless {@code fromExclusive} and {@code toExclusive} are both true. The returned setis backed by this set, so changes in the returned set are reflected in this set, and vice-versa. The returned set supports all optional set operations that this set supports.
The returned set will throw an {@code IllegalArgumentException}on an attempt to insert an element outside its range.
@param fromElement low endpoint of the returned set
@param fromInclusive {@code true} if the low endpointis to be included in the returned view
@param toElement high endpoint of the returned set
@param toInclusive {@code true} if the high endpointis to be included in the returned view
@return a view of the portion of this set whose elements range from{@code fromElement}, inclusive, to {@code toElement}, exclusive
@throws ClassCastException if {@code fromElement} and{@code toElement} cannot be compared to one another using thisset's comparator (or, if the set has no comparator, using natural ordering). Implementations may, but are not required to, throw this exception if {@code fromElement} or{@code toElement} cannot be compared to elements currently inthe set.
@throws NullPointerException if {@code fromElement} or{@code toElement} is null and this set doesnot permit null elements
@throws IllegalArgumentException if {@code fromElement} isgreater than {@code toElement}; or if this set itself has a restricted range, and {@code fromElement} or{@code toElement} lies outside the bounds of the range.