code: public Throwable getMostSpecificCause()
      {
          Throwable rootCause = null;
          Throwable cause = getCause();
          while (cause != null  &&  cause != rootCause) {
              rootCause = cause;
              cause = cause.getCause();
          }
  
          return (rootCause == null ? this : rootCause);
      }
docs: Retrieve the most specific cause of this exception, that is,
  either the innermost cause (root cause) or this exception itself.
  
  @return
  the most specific cause (never <code>null</code>)