StreamReadOnlyException extends RuntimeException { @NotNull public final StreamId getStreamId() { return streamId; } StreamReadOnlyException(@NotNull final StreamId streamId); @NotNull final StreamId getStreamId();  }
@Test public void testGetter() { assertThat(testee.getStreamId()).isEqualTo(STREAM_ID); }
@Test public void testSerializeDeserialize() { final StreamReadOnlyException original = testee; final byte[] data = serialize(original); final StreamReadOnlyException copy = deserialize(data); assertThat(copy.getMessage()).isEqualTo(original.getMessage()); assertThat(copy.getStreamId()).isEqualTo(original.getStreamId()); }