public static <X,Y>boolean containsSubclass(Set<? extends Class<? extends Y>> classes,X superclassInstance){
  for (  Class<? extends Y> classs : classes)   if (classs.isInstance(superclassInstance))   return true;
  return false;
}

public static < X , Y > boolean containsSubclass ( Set < ? extends Class < ? extends Y > > classes , X superclassInstance ) { for ( Class < ? extends Y > classs : classes ) if ( classs . isInstance ( superclassInstance ) ) return true ; return false ; }
returns true if given set contains at least one subclass of provided instance .
