code: @GwtIncompatible("incompatible method")
      public static List<Throwable> getThrowableList(Throwable throwable) {
          final List<Throwable> list = new ArrayList<>();
          while (throwable != null && !list.contains(throwable)) {
              list.add(throwable);
              throwable = throwable.getCause();
          }
          return list;
      }
docs: <p>Returns the list of <code>Throwable</code> objects in the
  exception chain.</p>
  
  <p>A throwable without cause will return a list containing
  one element - the input throwable.
  A throwable with one cause will return a list containing
  two elements. - the input throwable and the cause throwable.
  A <code>null</code> throwable will return a list of size zero.</p>
  
  <p>This method handles recursive cause structures that might
  otherwise cause infinite loops. The cause chain is processed until
  the end is reached, or until the next item in the chain is already
  in the result set.</p>
  
  @param throwable  the throwable to inspect, may be null
  @return the list of throwables, never null
  @since Commons Lang 2.2