public BitVector duplicateRange(int from, int to, boolean copy, boolean mutable) {
		if (mutable && !copy && !this.mutable) throw new IllegalStateException("Cannot obtain mutable view of an immutable BitVector");
		if (from < 0) throw new IllegalArgumentException();
		if (to < from) throw new IllegalArgumentException();
		from += start;
		to += start;
		if (to > finish) throw new IllegalArgumentException();
		return duplicateAdj(from, to, copy, mutable);
	}
public BitVector duplicateRange ( int from , int to , boolean copy , boolean mutable ) { if ( mutable && ! copy && ! this . mutable ) throw new IllegalStateException ( "Cannot obtain mutable view of an immutable BitVector" ) ; if ( from < 0 ) throw new IllegalArgumentException ( ) ; if ( to < from ) throw new IllegalArgumentException ( ) ; from += start ; to += start ; if ( to > finish ) throw new IllegalArgumentException ( ) ; return duplicateAdj ( from , to , copy , mutable ) ; }
Duplicates a range of the {@link BitVector}.

@param from
the (inclusive) position at which the range begins
@param to
the (exclusive) position at which the range ends
@param copy
true if the duplicated range should be a detached copy, false
if it should be a view, backed by the same bit data.
@param mutable
whether the duplicated range should be mutable
@return a duplicate of this BitVector
@see #duplicate(boolean, boolean)