@Test
public void verify_parsing_JavaExceptionThrow() throws IOException {

    JfrEventParser parser = new JfrEventParser();
    CommonEvent event = parser.parseNextEvent(new JsonEventSource() {
        boolean hasNext = true;
        @Override
        public boolean readNext(JsonStreamWriter writer) throws IOException {
            jostart(writer);
                jput(writer, "eventType", "jdk.JavaExceptionThrow");
                jput(writer, "startTime", 1561544945483325579l);
                jostart(writer, "eventThread");
                    jput(writer, "osThreadId", 14804);
                    jput(writer, "javaName", "Local Descriptor Scanner");
                    jput(writer, "javaThreadId", 36);
                    jostart(writer, "group");
                        jput(writer, "parent", null);
                        jput(writer, "name", "main");
                    joend(writer);
                joend(writer);
                jostart(writer, "stackTrace");
                    jput(writer, "truncated", false);
                    jastart(writer, "frames");
                        jframe(writer,
                                "java.lang.Throwable",
                                "<init>",
                                272, 35, "JIT compiled"
                        );
                        jframe(writer,
                                "java.lang.Exception",
                                "<init>",
                                66, 2, "JIT compiled"
                                );
                        jframe(writer,
                                "java.net.URISyntaxException",
                                "<init>",
                                62, 2, "JIT compiled"
                                );
                    jaend(writer);
                joend(writer);
                jput(writer, "message", "Malformed IPv4 address");
                jostart(writer, "thrownClass");
                    jput(writer, "className", "java.net.URISyntaxException");
                joend(writer);
            joend(writer);
            return hasNext | (hasNext = false);
        }
    });
    ThreadSnapshotEvent tevent = (ThreadSnapshotEvent) event;
    Assertions.assertThat(tevent.threadName()).isEqualTo("Local Descriptor Scanner");
    Assertions.assertThat(tevent.threadId()).isEqualTo(36l);
    Assertions.assertThat(tevent.threadState()).isEqualTo(State.RUNNABLE);
    Assertions.assertThat(tevent.tags().firstTagFor("jfr.typeId")).isEqualTo("jdk.JavaExceptionThrow");
    Assertions.assertThat(tevent.stackTrace().depth()).isEqualTo(3);
    Assertions.assertThat(tevent.stackTrace().frameAt(0))
        .isEqualTo(new StackFrame("", "java.lang.Throwable", "<init>", "java", 272));
    Assertions.assertThat(tevent.stackTrace().frameAt(1))
        .isEqualTo(new StackFrame("", "java.lang.Exception", "<init>", "java", 66));
    Assertions.assertThat(tevent.stackTrace().frameAt(2))
        .isEqualTo(new StackFrame("", "java.net.URISyntaxException", "<init>", "java", 62));
}