Here you can find the source of anyInstance(Throwable t, Class extends Throwable>[] types)
private static boolean anyInstance(Throwable t, Class<? extends Throwable>[] types)
//package com.java2s; //License from project: Apache License public class Main { private static boolean anyInstance(Throwable t, Class<? extends Throwable>[] types) { for (Class<? extends Throwable> type : types) { if (type.isInstance(t)) return true; }/* w w w . j a v a 2 s.co m*/ return false; } }