StackFrame implements CharSequence, GenericStackElement { @Override public int hashCode() { return hash; } StackFrame(StackTraceElement ste);  StackFrame(String classPrefix, String className, String methodName, String fileName, int lineNumber); String getClassName(); String getMethodName(); String getSourceFile(); int getLineNumber(); boolean isNative(); StackFrame internSymbols(); @Override int length(); @Override char charAt(int index); @Override CharSequence subSequence(int start, int end); @Override int hashCode(); @Override boolean equals(Object obj); StackFrame withoutSource(); StackTraceElement toStackTraceElement(); @Override String toString(); void toString(StringBuilder builder); static StackFrame parseFrame(String line); static final Comparator<StackFrame> COMPARATOR; }
@Test public void test_simple_equality() { StackFrame frame1 = new StackFrame("mypackage", "MyClass", "myMethod", "MyClass.java", 15); StackFrame frame2 = new StackFrame("mypackage", "MyClass", "myMethod", "MyClass.java", 15); Assert.assertEquals(frame1, frame2); Assert.assertEquals(frame2, frame1); Assert.assertEquals(frame1.hashCode(), frame2.hashCode()); }
@Test public void test_equality_with_prefix_mismatch() { StackFrame frame1 = new StackFrame(null, "mypackage.MyClass", "myMethod", "MyClass.java", 15); StackFrame frame2 = new StackFrame("mypackage", "MyClass", "myMethod", "MyClass.java", 15); Assert.assertEquals(frame1, frame2); Assert.assertEquals(frame2, frame1); Assert.assertEquals(frame1.hashCode(), frame2.hashCode()); }