### Question:
CrashStackTrace implements Iterable<Frame> { @Override public boolean equals(Object o) { if(this == o) { return true; } if(o == null || getClass() != o.getClass()) { return false; } CrashStackTrace stackTrace = (CrashStackTrace) o; return Objects.equals(exceptionClass, stackTrace.exceptionClass) && Objects.equals(errorMessage, stackTrace.errorMessage) && Objects.equals(frames, stackTrace.frames) && Objects.equals(cause, stackTrace.cause); } CrashStackTrace();  CrashStackTrace(String exceptionClass, String errorMessage);  CrashStackTrace(String exceptionClass, String errorMessage, CrashStackTrace cause); String getExceptionClass(); void setExceptionClass(String exceptionClass); String getErrorMessage(); void setErrorMessage(String errorMessage); CrashStackTrace getCause(); void setCause(CrashStackTrace stackTrace); @Override Iterator<Frame> iterator(); Frame removeFrame(int level); void addFrame(Frame frame); int highestFrameLevel(); Frame getFrame(int level); @Override int hashCode(); @Override boolean equals(Object o); @Override String toString();  }### Answer:
@Test public void testEquals() { String exception = "NullPointerOfCourse"; String message = "because why not!"; CrashStackTrace st = new CrashStackTrace(exception, message); CrashStackTrace st2 = new CrashStackTrace(); st2.setExceptionClass(exception); st2.setErrorMessage(message); assertThat(st.equals(st), is(true)); assertThat(st.equals(st2), is(true)); assertThat(st.equals(new CrashStackTrace(exception, message, st2)), is(false)); st.addFrame(new Frame("clazz", "method")); st.addFrame(new Frame("clazz2", "method2")); assertThat(st.equals(st), is(true)); assertThat(st.equals(st2), is(false)); st2.addFrame(new Frame("clazz", "method")); st2.addFrame(new Frame("clazz2", "method2")); assertThat(st.equals(st), is(true)); assertThat(st.equals(st2), is(true)); st.setCause(new CrashStackTrace("except", message)); assertThat(st.equals(st), is(true)); assertThat(st.equals(st2), is(false)); st2.setCause(new CrashStackTrace("except", message)); assertThat(st.equals(st), is(true)); assertThat(st.equals(st2), is(true)); }