### Question:
Framer { public synchronized void frame(final MessageData message, final ByteBuf output) { Preconditions.checkArgument( message.getSize() < LENGTH_MAX_MESSAGE_FRAME, "Message size in excess of maximum length."); if (compressionEnabled) { final byte[] compressed = compressor.compress(message.getData().toArrayUnsafe()); frameMessage(new RawMessage(message.getCode(), Bytes.wrap(compressed)), output); } else { frameMessage(message, output); } } Framer(final HandshakeSecrets secrets); void enableCompression(); void disableCompression(); synchronized MessageData deframe(final ByteBuf buf); synchronized void frame(final MessageData message, final ByteBuf output);  }### Answer:
@Test public void shouldThrowExceptionWhenFramingMessageTooLong() { final byte[] aes = { 0xa, 0x2, 0xa, 0x2, 0xa, 0x2, 0xa, 0x2, 0xa, 0x2, 0xa, 0x2, 0xa, 0x2, 0xa, 0x2, 0xa, 0x2, 0xa, 0x2, 0xa, 0x2, 0xa, 0x2, 0xa, 0x2, 0xa, 0x2, 0xa, 0x2, 0xa, 0x2 }; final byte[] mac = { 0xa, 0x2, 0xa, 0x2, 0xa, 0x2, 0xa, 0x2, 0xa, 0x2, 0xa, 0x2, 0xa, 0x2, 0xa, 0x2, 0xa, 0x2, 0xa, 0x2, 0xa, 0x2, 0xa, 0x2, 0xa, 0x2, 0xa, 0x2, 0xa, 0x2, 0xa, 0x2 }; final byte[] byteArray = new byte[0xFFFFFF]; new Random().nextBytes(byteArray); final MessageData ethMessage = new RawMessage(0x00, Bytes.wrap(byteArray)); final HandshakeSecrets secrets = new HandshakeSecrets(aes, mac, mac); final Framer framer = new Framer(secrets); assertThatExceptionOfType(IllegalArgumentException.class) .isThrownBy(() -> framer.frame(ethMessage, Unpooled.buffer())) .withMessageContaining("Message size in excess of maximum length."); }