code: public static void fireDeclaredCause(Throwable t, Class... declaredTypes) {
          if (t != null) {
              Throwable cause = t.getCause();
              if (cause == null) {
                  cause = t;
              }
              fireDeclared(cause, declaredTypes);
          }
      }
docs: Throws the cause of the given exception if it is unchecked or an
  instance of any of the given declared types. Otherwise, it is thrown as
  an UndeclaredThrowableException. If the cause is null, then the original
  exception is thrown. This method only returns normally if the exception
  is null.
  
  @param t exception whose cause is to be thrown
  @param declaredTypes if exception is checked and is not an instance of
  any of these types, then it is thrown as an
  UndeclaredThrowableException.