private boolean exceptionsAreEqual(Exception a, Exception b) {
    if (a instanceof RouterException) {
      return ((RouterException) a).getErrorCode().equals(((RouterException) b).getErrorCode());
    } else {
      return a.getClass() == b.getClass() && a.getMessage().equals(b.getMessage());
    }
  }
Check if the given two exceptions are equal.
@return true if the exceptions are equal.
ambry-router/src/test/java/com/github/ambry/router/PutManagerTest.java