code: public static <T> T getClosestOfClass(final Class<T> clazz, final WComponent comp) {
  		if (comp == null) {
  			return null;
  		}
  
  		if (clazz.isInstance(comp)) {
  			return (T) comp;
  		}
  
  		return getAncestorOfClass(clazz, comp);
  	}
docs: Attempts to find the nearest component (may be the component itself) that is assignable to the given class.
  
  @param clazz the class to look for
  @param comp the component to start at.
  @return the component or matching ancestor, if found, otherwise null.
  
  @param <T> the class to find