@Test
    public void canCreateTypedSections() {
        MyWriter writer = new MyWriter();

        // When a section of type MyPojo is encountered, intercept it.
        writer.onSection(new CodeInterceptor<MyPojo, MyWriter>() {
            @Override
            public Class<MyPojo> sectionType() {
                return MyPojo.class;
            }

            @Override
            public void write(MyWriter writer, String previousText, MyPojo section) {
                if (section.name.equals("Thomas")) {
                    section.count++;
                    writer.write("Hi, Thomas!");
                }
                writer.writeInlineWithNoFormatting(previousText);
            }
        });

        // Create a custom typed section value.
        MyPojo myPojo = new MyPojo("Thomas", 0);

        writer.pushState(myPojo);
        writer.write("How are you?");
        writer.popState(); // At this point, intercept the section.

        assertThat(myPojo.count, equalTo(1));
        assertThat(writer.toString(), equalTo("Hi, Thomas!\nHow are you?\n"));
    }
\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/SimpleCodeWriterTest.java