boolean (Throwable o1, Throwable o2) { if (o1 == o2) return true; if (o1 == null || o2 == null) return false; if (!Comparing.equal(o1.getClass(), o2.getClass())) return false; if (!Objects.equals(o1.getMessage(), o2.getMessage())) return false; if (!equals(o1.getCause(), o2.getCause())) return false; Object[] backtrace1 = getBacktrace(o1); Object[] backtrace2 = getBacktrace(o2); if (backtrace1 != null && backtrace2 != null) { return Arrays.deepEquals(backtrace1, backtrace2); } return Arrays.equals(o1.getStackTrace(), o2.getStackTrace()); }