### Question:
ExtendedStackTrace implements Iterable<ExtendedStackTraceElement> { protected Member getMethod(final ExtendedStackTraceElement este) { if (este.getDeclaringClass() == null) return null; Member[] ms = getMethods(este.getDeclaringClass()); Member method = null; for (Member m : ms) { if (este.getMethodName().equals(m.getName())) { if (method == null) method = m; else { method = null; break; } } } if (method == null && este.getLineNumber() >= 0) { try { final AtomicReference<String> descriptor = new AtomicReference<>(); ASMUtil.accept(este.getDeclaringClass(), ClassReader.SKIP_FRAMES, new ClassVisitor(Opcodes.ASM5) { @Override public MethodVisitor visitMethod(int access, String name, final String desc, String signature, String[] exceptions) { MethodVisitor mv = super.visitMethod(access, name, desc, signature, exceptions); if (descriptor.get() == null && este.getMethodName().equals(name)) { mv = new MethodVisitor(api, mv) { int minLine = Integer.MAX_VALUE, maxLine = Integer.MIN_VALUE; @Override public void visitLineNumber(int line, Label start) { if (line < minLine) minLine = line; if (line > maxLine) maxLine = line; } @Override public void visitEnd() { if (minLine <= este.getLineNumber() && maxLine >= este.getLineNumber()) descriptor.set(desc); super.visitEnd(); } }; } return mv; } }); if (descriptor.get() != null) { final String desc = descriptor.get(); for (Member m : ms) { if (este.getMethodName().equals(getName(m)) && desc.equals(getDescriptor(m))) { method = m; break; } } } } catch (Exception e) { if (!(e instanceof UnsupportedOperationException)) e.printStackTrace(); } } return method; } protected  ExtendedStackTrace(Throwable t); static ExtendedStackTrace of(Throwable t); static ExtendedStackTrace here(); @Override Iterator<ExtendedStackTraceElement> iterator(); ExtendedStackTraceElement[] get();  }### Answer:
@Test public void testHotSpot1() { Assume.assumeTrue(isHotSpotSupported()); try { new A().foo(); } catch (Exception e) { ExtendedStackTrace st = new ExtendedStackTraceHotSpot(e); for (ExtendedStackTraceElement este : st) { Member m = este.getMethod(); assertNotNull(este.getClassName() + "." + este.getMethodName(), m); } } }
@Test @Ignore public void testPlain() { try { new A().foo(); } catch (Exception e) { ExtendedStackTrace st = new ExtendedStackTrace(e); for (ExtendedStackTraceElement este : st) { Member m = este.getMethod(); if (!skipJunit(este)) assertNotNull(este.getClassName() + "." + este.getMethodName(), m); } } }
@Test public void testSecurity() { ExtendedStackTrace st = new ExtendedStackTraceClassContext(); for (ExtendedStackTraceElement este : st) { Member m = este.getMethod(); if (!ExtendedStackTraceClassContext.skipSTE(este.getStackTraceElement())) assertNotNull(este.getClassName() + "." + este.getMethodName(), m); } }