code: public static void fireDeclared(Throwable t, Class... declaredTypes) {
          if (t != null) {
              if (declaredTypes != null) {
                  for (Class declaredType : declaredTypes) {
                      if (declaredType.isInstance(t)) {
                          fire(t);
                      }
                  }
              }
              if (t instanceof RuntimeException) {
                  throw (RuntimeException) t;
              }
              if (t instanceof Error) {
                  throw (Error) t;
              }
              throw new UndeclaredThrowableException(t);
          }
      }
docs: Throws the given exception if it is unchecked or an instance of any of
  the given declared types. Otherwise, it is thrown as an
  UndeclaredThrowableException. This method only returns normally if the
  exception is null.
  
  @param t exception to throw
  @param declaredTypes if exception is checked and is not an instance of
  any of these types, then it is thrown as an
  UndeclaredThrowableException.