public static <T extends Throwable>void throwIfInstanceOf(Throwable t,Class<T> cls) throws T {
  if (cls.isInstance(t)) {
    throw cls.cast(t);
  }
}

public static < T extends Throwable > void throwIfInstanceOf ( Throwable t , Class < T > cls ) throws T { if ( cls . isInstance ( t ) ) { throw cls . cast ( t ) ; } }
throws the given throwable , downcast , if it ' s of the appropriate type
