private static boolean instanceOfAny(Object o,Collection<Class> classes){
  for (  Class c : classes) {
    if (c.isInstance(o))     return true;
  }
  return false;
}

private static boolean instanceOfAny ( Object o , Collection < Class > classes ) { for ( Class c : classes ) { if ( c . isInstance ( o ) ) return true ; } return false ; }
returns true if the object ' o ' is an instance of any class in the collection
