// 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));
assertEquals("Intermediate bytes and compressed source must have same size", compressedBytes.length,
intermediateSize);