Object result2 = trans.transform(compressedBytes);
assertTrue("Transformed object should be a Bytes message", result2 instanceof BytesMessage);
// check whether the BytesMessage contains the compressed bytes
BytesMessage intermediate = (BytesMessage)result2;
intermediate.reset();
byte[] intermediateBytes = new byte[(int)(intermediate.getBodyLength())];
int intermediateSize = intermediate.readBytes(intermediateBytes);
assertTrue("Intermediate bytes must be compressed", compressor.isCompressed(intermediateBytes));
assertTrue("Intermediate bytes must be equal to compressed source", Arrays.equals(compressedBytes,
intermediateBytes));