@Test
public void catchesAndShowsErrorsWhenSerializing() {

    ThrowingClass tc = new ThrowingClass();
    NodeMapper mapper = new NodeMapper();
    NodeSerializationException e = Assertions.assertThrows(
            NodeSerializationException.class,
            () -> mapper.serialize(tc)
    );
    assertThat(e.getMessage(), equalTo(
            "Error serializing `throws` field of software.amazon.smithy.model.node.NodeMapperTest$ThrowingClass "
            + "using getThrows(): Nope!"));
}