// Path: src/main/java/com/tomgibara/bits/BitStore.java
// interface BitMatches extends OverlappingMatches, DisjointMatches {
// 
// 	@Override
// 	BitMatches overlapping();
// 
// 	@Override
// 	BitMatches disjoint();
// 
// 	@Override
// 	BitMatches range(int from, int to);
// 
// 	/**
// 	 * Whether the {@link BitStore} consists entirely
// 	 * of the matched bit value.
// 	 *
// 	 * @return true if and only if all bits in the store have the value of
// 	 *         {@link #bit()}
// 	 */
// 
// 	@Override
// 	boolean isAll();
// 
// 	/**
// 	 * Whether none of the bits in the {@link BitStore} have the matched bit
// 	 * value.
// 	 *
// 	 * @return true if and only if none of the bits in the store have the
// 	 *         value of {@link #bit()}
// 	 */
// 
// 	@Override
// 	boolean isNone();
// 
// 	/**
// 	 * Whether 1s are being matched.
// 	 *
// 	 * @return bit value being matched
// 	 */
// 
// 	boolean bit();
// 
// 	/**
// 	 * The matched bit positions as a sorted set. The returned set is a live
// 	 * view over the {@link BitStore} with mutations of the store being
// 	 * reflected in the set and vice versa. Attempting to add integers to
// 	 * the set that lie outside the range of valid bit indexes in the store
// 	 * will fail.
// 	 *
// 	 * @return a set view of the matched bit positions
// 	 */
// 
// 	SortedSet<Integer> asSet();
// 
// }
// 
// Path: src/main/java/com/tomgibara/bits/BitStore.java
// interface Positions extends ListIterator<Integer> {
// 
// 	/**
// 	 * Indicates whether the iterator moves over pattern sequences such that
// 	 * successive matched ranges do not over overlap.
// 	 *
// 	 * @return true if position matches do not overlap, false otherwise
// 	 */
// 
// 	boolean isDisjoint();
// 
// 	/**
// 	 * <p>
// 	 * The next matched position. This is equivalent to {@link #next()} but
// 	 * may be expected to be slightly more efficient, with the differences
// 	 * being that:
// 	 *
// 	 * <ul>
// 	 * <li>The position is returned as a primitive is returned, not a boxed
// 	 * primitive.
// 	 * <li>If there's no position, the value of {@link BitStore#size()} is
// 	 * returned instead of an exception being raised.
// 	 * </ul>
// 	 *
// 	 * <p>
// 	 * Otherwise, the effect of calling the method is the same.
// 	 *
// 	 * @return the next position, or the first invalid index if there is no
// 	 *         further position
// 	 */
// 
// 	int nextPosition();
// 
// 	/**
// 	 * <p>
// 	 * The previous matched position. This is equivalent to
// 	 * {@link #previous()} but may be expected to be slightly more
// 	 * efficient, with the differences being that:
// 	 *
// 	 * <ul>
// 	 * <li>The position is returned as a primitive is returned, not a boxed
// 	 * primitive.
// 	 * <li>If there's no position, the value of {@link BitStore#size()} is
// 	 * returned instead of an exception being raised.
// 	 * </ul>
// 	 *
// 	 * <p>
// 	 * Otherwise, the effect of calling the method is the same.
// 	 *
// 	 * @return the previous position, or -1 if there is no further position
// 	 */
// 
// 	int previousPosition();
// 
// 	/**
// 	 * Replaces the last match returned by the {@link #next()}/
// 	 * {@link #nextPosition()} and {@link #previous()}/
// 	 * {@link #previousPosition()} methods, with the supplied bits.
// 	 *
// 	 * @param replacement
// 	 *            the bits to replace the matched sequence
// 	 * @throws IllegalArgumentException
// 	 *             if the replacement size does not match the matched
// 	 *             sequence size
// 	 * @throws IllegalStateException
// 	 *             if the underlying bit store is immutable, or if no call
// 	 *             to {@link #previous()} or {@link #next()} has been made
// 	 * @see DisjointMatches#replaceAll(BitStore)
// 	 */
// 
// 	void replace(BitStore replacement);
// 
// 	/**
// 	 * Uniformly replaces the bits of last match returned by the
// 	 * {@link #next()}/ {@link #nextPosition()} and {@link #previous()}/
// 	 * {@link #previousPosition()} methods, with the specified bit value.
// 	 *
// 	 * @param bits
// 	 *            the bit value with which to replace the matched bits
// 	 * @throws IllegalStateException
// 	 *             if the underlying bit store is immutable, or if no call
// 	 *             to {@link #previous()} or {@link #next()} has been made
// 	 * @see DisjointMatches#replaceAll(boolean)
// 	 */
// 
// 	void replace(boolean bits);
// }


import java.util.Collections;
import java.util.SortedSet;
import com.tomgibara.bits.BitStore.BitMatches;
import com.tomgibara.bits.BitStore.Positions;
	}
	@Override
	public boolean isAll() {
		return matches.isAll();
	}
	@Override
	public boolean isNone() {
		return matches.isNone();
	}
	@Override
	public int count() {
		return matches.count();
	}
	@Override
	public int first() {
		return matches.first();
	}
	@Override
	public int last() {
		return matches.last();
	}
	@Override
	public int next(int position) {
		return matches.next(position);
	}
	@Override
	public int previous(int position) {
		return matches.previous(position);
	}
	@Override
// Path: src/main/java/com/tomgibara/bits/BitStore.java
// interface BitMatches extends OverlappingMatches, DisjointMatches {
// 
// 	@Override
// 	BitMatches overlapping();
// 
// 	@Override
// 	BitMatches disjoint();
// 
// 	@Override
// 	BitMatches range(int from, int to);
// 
// 	/**
// 	 * Whether the {@link BitStore} consists entirely
// 	 * of the matched bit value.
// 	 *
// 	 * @return true if and only if all bits in the store have the value of
// 	 *         {@link #bit()}
// 	 */
// 
// 	@Override
// 	boolean isAll();
// 
// 	/**
// 	 * Whether none of the bits in the {@link BitStore} have the matched bit
// 	 * value.
// 	 *
// 	 * @return true if and only if none of the bits in the store have the
// 	 *         value of {@link #bit()}
// 	 */
// 
// 	@Override
// 	boolean isNone();
// 
// 	/**
// 	 * Whether 1s are being matched.
// 	 *
// 	 * @return bit value being matched
// 	 */
// 
// 	boolean bit();
// 
// 	/**
// 	 * The matched bit positions as a sorted set. The returned set is a live
// 	 * view over the {@link BitStore} with mutations of the store being
// 	 * reflected in the set and vice versa. Attempting to add integers to
// 	 * the set that lie outside the range of valid bit indexes in the store
// 	 * will fail.
// 	 *
// 	 * @return a set view of the matched bit positions
// 	 */
// 
// 	SortedSet<Integer> asSet();
// 
// }
// 
// Path: src/main/java/com/tomgibara/bits/BitStore.java
// interface Positions extends ListIterator<Integer> {
// 
// 	/**
// 	 * Indicates whether the iterator moves over pattern sequences such that
// 	 * successive matched ranges do not over overlap.
// 	 *
// 	 * @return true if position matches do not overlap, false otherwise
// 	 */
// 
// 	boolean isDisjoint();
// 
// 	/**
// 	 * <p>
// 	 * The next matched position. This is equivalent to {@link #next()} but
// 	 * may be expected to be slightly more efficient, with the differences
// 	 * being that:
// 	 *
// 	 * <ul>
// 	 * <li>The position is returned as a primitive is returned, not a boxed
// 	 * primitive.
// 	 * <li>If there's no position, the value of {@link BitStore#size()} is
// 	 * returned instead of an exception being raised.
// 	 * </ul>
// 	 *
// 	 * <p>
// 	 * Otherwise, the effect of calling the method is the same.
// 	 *
// 	 * @return the next position, or the first invalid index if there is no
// 	 *         further position
// 	 */
// 
// 	int nextPosition();
// 
// 	/**
// 	 * <p>
// 	 * The previous matched position. This is equivalent to
// 	 * {@link #previous()} but may be expected to be slightly more
// 	 * efficient, with the differences being that:
// 	 *
// 	 * <ul>
// 	 * <li>The position is returned as a primitive is returned, not a boxed
// 	 * primitive.
// 	 * <li>If there's no position, the value of {@link BitStore#size()} is
// 	 * returned instead of an exception being raised.
// 	 * </ul>
// 	 *
// 	 * <p>
// 	 * Otherwise, the effect of calling the method is the same.
// 	 *
// 	 * @return the previous position, or -1 if there is no further position
// 	 */
// 
// 	int previousPosition();
// 
// 	/**
// 	 * Replaces the last match returned by the {@link #next()}/
// 	 * {@link #nextPosition()} and {@link #previous()}/
// 	 * {@link #previousPosition()} methods, with the supplied bits.
// 	 *
// 	 * @param replacement
// 	 *            the bits to replace the matched sequence
// 	 * @throws IllegalArgumentException
// 	 *             if the replacement size does not match the matched
// 	 *             sequence size
// 	 * @throws IllegalStateException
// 	 *             if the underlying bit store is immutable, or if no call
// 	 *             to {@link #previous()} or {@link #next()} has been made
// 	 * @see DisjointMatches#replaceAll(BitStore)
// 	 */
// 
// 	void replace(BitStore replacement);
// 
// 	/**
// 	 * Uniformly replaces the bits of last match returned by the
// 	 * {@link #next()}/ {@link #nextPosition()} and {@link #previous()}/
// 	 * {@link #previousPosition()} methods, with the specified bit value.
// 	 *
// 	 * @param bits
// 	 *            the bit value with which to replace the matched bits
// 	 * @throws IllegalStateException
// 	 *             if the underlying bit store is immutable, or if no call
// 	 *             to {@link #previous()} or {@link #next()} has been made
// 	 * @see DisjointMatches#replaceAll(boolean)
// 	 */
// 
// 	void replace(boolean bits);
// }


// Path: src/main/java/com/tomgibara/bits/ImmutableMatches.java
import java.util.Collections;
import java.util.SortedSet;
import com.tomgibara.bits.BitStore.BitMatches;
import com.tomgibara.bits.BitStore.Positions;

	}
	@Override
	public boolean isAll() {
		return matches.isAll();
	}
	@Override
	public boolean isNone() {
		return matches.isNone();
	}
	@Override
	public int count() {
		return matches.count();
	}
	@Override
	public int first() {
		return matches.first();
	}
	@Override
	public int last() {
		return matches.last();
	}
	@Override
	public int next(int position) {
		return matches.next(position);
	}
	@Override
	public int previous(int position) {
		return matches.previous(position);
	}
	@Override
	public Positions positions() {