int threadId = 0;
collector.handle(new TraceStart(2, ++threadId));
assertTrue("nothing to profile still", found.isEmpty());
collector.handle(new StackFrame(LINE, 0));
collector.handle(new StackFrame(LINE, 1));
// ..and one unexpected frame
collector.handle(new StackFrame(LINE, 2));
// normal method afterwards
collector.handle(new TraceStart(2, ++threadId));
collector.handle(new StackFrame(LINE, 6));
collector.handle(new StackFrame(LINE, 7));
// and continuation
collector.handle(new TraceStart(20, ++threadId));
assertArrayEquals(new long[] { 2, 7 }, idOfLastMethodInEachThread(found.getLast()));