// Path: src/main/java/com/tomgibara/bits/BitStore.java
// enum Test {
// 
// 	/**
// 	 * Whether two {@link BitStore} have the same pattern of true/false-bits.
// 	 */
// 
// 	EQUALS,
// 
// 	/**
// 	 * Whether there is no position at which both {@link BitStore}s have
// 	 * a true-bit.
// 	 */
// 
// 	EXCLUDES,
// 
// 	/**
// 	 * Whether one {@link BitStore} has true-bits at every position that
// 	 * another does.
// 	 */
// 
// 	CONTAINS,
// 
// 	/**
// 	 * Whether one {@link BitStore} is has zero bits at exactly every
// 	 * position that another has one bits.
// 	 */
// 
// 	COMPLEMENTS;
// 
// 	static final Test[] values = values();
// }
// 
// Path: src/main/java/com/tomgibara/bits/BitStore.java
// interface Tests {
// 
// 	/**
// 	 * The type of tests performed by this object.
// 	 *
// 	 * @return the type of test
// 	 */
// 
// 	Test getTest();
// 
// 	/**
// 	 * Tests a {@link BitStore} against the source.
// 	 *
// 	 * @param store
// 	 *            the bits tested against
// 	 * @return whether the test succeeds
// 	 * @throws IllegalArgumentException
// 	 *             if the store size does not match the size of the source
// 	 */
// 
// 	boolean store(BitStore store);
// 
// 	/**
// 	 * Tests the bits of a long against the source {@link BitStore}. In
// 	 * cases where the size of the source is less than the full 64 bits of
// 	 * the long, the least-significant bits are used.
// 	 *
// 	 * @param bits
// 	 *            the bits tested against
// 	 * @return whether the test succeeds
// 	 * @throws IllegalArgumentException
// 	 *             if the size of the source exceeds 64 bits.
// 	 */
// 
// 	boolean bits(long bits);
// 
// }


import com.tomgibara.bits.BitStore.Test;
import com.tomgibara.bits.BitStore.Tests;
		checkThatSize(size);
		int limit = size & ~63;
		for (int i = 0; i < limit; i += 64) {
			boolean result = testBits(s.getBits(i, 64), store.getBits(i, 64));
			if (!result) return false;
		}
		int rem = size - limit;
		return rem == 0 ? true : testBits(s.getBits(limit, rem), store.getBits(limit, rem), rem);
	}

	abstract boolean testBits(long ourBits, long theirBits);

	abstract boolean testBits(long ourBits, long theirBits, int size);

	private void checkThisSize(int size) {
		if (size > 64) throw new IllegalArgumentException("store size greater than 64 bits");

	}

	private void checkThatSize(int size) {
		if (s.size() != size) throw new IllegalArgumentException("mismatched size");
	}

	static final class Equals extends BitStoreTests {

		Equals(BitStore store) {
			super(store);
		}

		@Override
// Path: src/main/java/com/tomgibara/bits/BitStore.java
// enum Test {
// 
// 	/**
// 	 * Whether two {@link BitStore} have the same pattern of true/false-bits.
// 	 */
// 
// 	EQUALS,
// 
// 	/**
// 	 * Whether there is no position at which both {@link BitStore}s have
// 	 * a true-bit.
// 	 */
// 
// 	EXCLUDES,
// 
// 	/**
// 	 * Whether one {@link BitStore} has true-bits at every position that
// 	 * another does.
// 	 */
// 
// 	CONTAINS,
// 
// 	/**
// 	 * Whether one {@link BitStore} is has zero bits at exactly every
// 	 * position that another has one bits.
// 	 */
// 
// 	COMPLEMENTS;
// 
// 	static final Test[] values = values();
// }
// 
// Path: src/main/java/com/tomgibara/bits/BitStore.java
// interface Tests {
// 
// 	/**
// 	 * The type of tests performed by this object.
// 	 *
// 	 * @return the type of test
// 	 */
// 
// 	Test getTest();
// 
// 	/**
// 	 * Tests a {@link BitStore} against the source.
// 	 *
// 	 * @param store
// 	 *            the bits tested against
// 	 * @return whether the test succeeds
// 	 * @throws IllegalArgumentException
// 	 *             if the store size does not match the size of the source
// 	 */
// 
// 	boolean store(BitStore store);
// 
// 	/**
// 	 * Tests the bits of a long against the source {@link BitStore}. In
// 	 * cases where the size of the source is less than the full 64 bits of
// 	 * the long, the least-significant bits are used.
// 	 *
// 	 * @param bits
// 	 *            the bits tested against
// 	 * @return whether the test succeeds
// 	 * @throws IllegalArgumentException
// 	 *             if the size of the source exceeds 64 bits.
// 	 */
// 
// 	boolean bits(long bits);
// 
// }


// Path: src/main/java/com/tomgibara/bits/BitStoreTests.java
import com.tomgibara.bits.BitStore.Test;
import com.tomgibara.bits.BitStore.Tests;

		checkThatSize(size);
		int limit = size & ~63;
		for (int i = 0; i < limit; i += 64) {
			boolean result = testBits(s.getBits(i, 64), store.getBits(i, 64));
			if (!result) return false;
		}
		int rem = size - limit;
		return rem == 0 ? true : testBits(s.getBits(limit, rem), store.getBits(limit, rem), rem);
	}

	abstract boolean testBits(long ourBits, long theirBits);

	abstract boolean testBits(long ourBits, long theirBits, int size);

	private void checkThisSize(int size) {
		if (size > 64) throw new IllegalArgumentException("store size greater than 64 bits");

	}

	private void checkThatSize(int size) {
		if (s.size() != size) throw new IllegalArgumentException("mismatched size");
	}

	static final class Equals extends BitStoreTests {

		Equals(BitStore store) {
			super(store);
		}

		@Override
		public Test getTest() {