### Question:
SbeMessageBufferEncoder implements Encoder<UnsafeBuffer, T> { @Override public void store(final UnsafeBuffer buffer, final int offset, final T value) { final int encodedLength = value.encodedLength(); if (encodedLength > maxMessageLength) { throw new IllegalArgumentException("Unable to encode message of length " + encodedLength); } buffer.putBytes(offset, value.buffer(), value.offset(), encodedLength); } SbeMessageBufferEncoder(final int maxMessageLength); @Override void store(final UnsafeBuffer buffer, final int offset, final T value);  }### Answer:
@Test void shouldThrowExceptionIfEncodedLengthExceedMaxMessageLength() { final CarDecoder carDecoder = new CarDecoder(); carDecoder.wrap(new UnsafeBuffer(new byte[64]), 0, carDecoder.sbeBlockLength(), 0); Assertions.assertThrows(IllegalArgumentException.class, () -> encoder.store(new UnsafeBuffer(new byte[0]), 0, carDecoder), "Unable to encode message of length 49"); }