@Test
public void verify_parsing_ObjectAllocationInNewTLAB() 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.ObjectAllocationInNewTLAB");
                jput(writer, "startTime", 1561544945483325579l);
                jostart(writer, "eventThread");
                    jput(writer, "osThreadId", 19524);
                    jput(writer, "javaName", "Worker-4: Recording My Recording");
                    jput(writer, "javaThreadId", 76);
                    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.util.Arrays",
                                "copyOfRange",
                                4030, 40, "JIT compiled"
                        );
                        jframe(writer,
                                "java.lang.StringLatin1",
                                "newString",
                                715, 9, "JIT compiled"
                                );
                        jframe(writer,
                                "java.lang.StringLatin1",
                                "trim",
                                541, 68, "JIT compiled"
                                );
                        jframe(writer,
                                "java.lang.String",
                                "trim",
                                2644, 11, "JIT compiled"
                                );
                    jaend(writer);
                joend(writer);
                jostart(writer, "objectClass");
                    jput(writer, "className", "byte[]");
                joend(writer);
                jput(writer, "allocationSize", 24);
                jput(writer, "tlabSize", 15560);
            joend(writer);
            return hasNext | (hasNext = false);
        }
    });
    ThreadSnapshotEvent tevent = (ThreadSnapshotEvent) event;
    Assertions.assertThat(tevent.threadName()).isEqualTo("Worker-4: Recording My Recording");
    Assertions.assertThat(tevent.threadId()).isEqualTo(76l);
    Assertions.assertThat(tevent.threadState()).isEqualTo(State.RUNNABLE);
    Assertions.assertThat(tevent.tags().firstTagFor("jfr.typeId")).isEqualTo("jdk.ObjectAllocationInNewTLAB");
    Assertions.assertThat(tevent.stackTrace().depth()).isEqualTo(4);
    Assertions.assertThat(tevent.stackTrace().frameAt(0))
        .isEqualTo(new StackFrame("", "java.util.Arrays", "copyOfRange", "java", 4030));
    Assertions.assertThat(tevent.stackTrace().frameAt(1))
        .isEqualTo(new StackFrame("", "java.lang.StringLatin1", "newString", "java", 715));
    Assertions.assertThat(tevent.stackTrace().frameAt(2))
        .isEqualTo(new StackFrame("", "java.lang.StringLatin1", "trim", "java", 541));
    Assertions.assertThat(tevent.stackTrace().frameAt(3))
        .isEqualTo(new StackFrame("", "java.lang.String", "trim", "java", 2644));
}