public static boolean isCompatibleWithThrowsClause(Throwable ex,Class<?>[] declaredExceptions){
  if (!isCheckedException(ex))   return true;
  if (declaredExceptions != null)   for (  Class<?> declaredException : declaredExceptions)   if (declaredException.isAssignableFrom(ex.getClass()))   return true;
  return false;
}

public static boolean isCompatibleWithThrowsClause ( Throwable ex , Class < ? > [ ] declaredExceptions ) { if ( ! isCheckedException ( ex ) ) return true ; if ( declaredExceptions != null ) for ( Class < ? > declaredException : declaredExceptions ) if ( declaredException . isAssignableFrom ( ex . getClass ( ) ) ) return true ; return false ; }
check whether the given exception is compatible with the exceptions declared in a throws clause .
