}
}
protected void assertByteSequencesEqual(String message, ByteSequence expected, Object actualValue) {
assertTrue(message + ". Actual value should be a ByteSequence but was: " + actualValue, actualValue instanceof ByteSequence);
ByteSequence actual = (ByteSequence)actualValue;
int length = expected.getLength();
assertEquals(message + ". Length", length, actual.getLength());
int offset = expected.getOffset();
assertEquals(message + ". Offset", offset, actual.getOffset());
byte[] data = expected.getData();
byte[] actualData = actual.getData();
for (int i = 0; i < length; i++) {
assertEquals(message + ". Offset " + i, data[offset + i], actualData[offset + i]);
}
}