protected Stack<Throwable> unfoldExceptions(Throwable exception){
  Stack<Throwable> throwables=new Stack<>();
  Throwable current=exception;
  while (current != null) {
    throwables.push(current);
    current=current.getCause();
  }
  return throwables;
}

protected Stack < Throwable > unfoldExceptions ( Throwable exception ) { Stack < Throwable > throwables = new Stack < > ( ) ; Throwable current = exception ; while ( current != null ) { throwables . push ( current ) ; current = current . getCause ( ) ; } return throwables ; }
creates an iterable to walk the exception from the bottom up ( the last caused by going upwards to the root exception ) .
