Fault { @Override public boolean equals(Object obj) { if (obj == null) { return false; } if (getClass() != obj.getClass()) { return false; } final Fault other = (Fault) obj; return Objects.equals(this.classname, other.classname); } Fault(Throwable t, int stacktracelength); String getMessage(); String getClassname(); String[] getStacktrace(); Throwable getThrowable(); static Fault createFromJson(String json); String toJson(); @Override String toString(); @Override int hashCode(); @Override boolean equals(Object obj);  }
@Test public void testEquals() { System.out.println("testEquals"); try { throw new Exception("Message"); } catch (Exception e) { Fault instance = new Fault(e, 5); Fault test = null; assertThat(instance.equals(test)).isFalse(); assertThat(instance.equals("NotSameClass")).isFalse(); test = new Fault(null, 5); assertThat(instance.equals(test)).isFalse(); test = new Fault(e, 5); assertThat(instance.equals(test)).isTrue(); } }