@Test
    public void providesContextWhenBadGetterIsCalled() {
        RuntimeException e = Assertions.assertThrows(RuntimeException.class, () -> {
            SimpleCodeWriter writer = new SimpleCodeWriter();
            writer.pushState(new MySection());
            writer.write("${bad:L}");
        });

        assertThat(e.getMessage(),
                containsString("Unable to get context 'bad' from a matching method of the current "
                        + "CodeSection: This was bad! "));
        // The debug info contains the class name of the section.
        assertThat(e.getMessage(), containsString(MySection.class.getCanonicalName()));
    }
\n"
                                + " * Foo \"foo!\"\n"
                                + " *\n"
                                + " * \"baz\"!\n"
                                + " * Yap!\n"
                                + " *     This is indented, in flow of parent.\n"
                                + " *     Yap!\n"
                                + " *     Yap?\n"
                                + " *     # Has a prefix\n"
                                + " *     # Yes\n"
                                + "
smithy-utils/src/test/java/software/amazon/smithy/utils/CodeWriterTest.java