code: public static List<Throwable> getCauseChain(Throwable exception) {
      Assert.notNull(exception);
      List<Throwable> result = new ArrayList<>();
      collectCauseChain(exception, result);
      return result;
    }
docs: Returns a list of all causes of the specified exception. The first element of the
  returned list is the specified exception itself; the last element is its root cause.
  
  @param exception an exception
  
  @return the exception's cause chain