code: @SuppressWarnings("unchecked")
      public static <T> Collection<T> findNextByType(FaceletHandler nextHandler, Class<T> type)
      {
          List<T> found = new ArrayList<T>();
          if (type.isAssignableFrom(nextHandler.getClass()))
          {
              found.add((T)nextHandler);
          }
          else if (nextHandler instanceof javax.faces.view.facelets.CompositeFaceletHandler)
          {
              for (FaceletHandler handler :
                      ((javax.faces.view.facelets.CompositeFaceletHandler)nextHandler).getHandlers())
              {
                  if (type.isAssignableFrom(handler.getClass()))
                  {
                      found.add((T)handler);
                  }
              }
          }
  
          return found;
      }
docs: From TagHandler:
  protected final <T> Iterator<T> findNextByType(Class<T> type)
  
  @param type
  @return