code: public static <T extends BioPAXElement> Set<T> searchAndCollect(
  		Model model, Pattern pattern, int index, Class<T> c)
  	{
  		return searchAndCollect(model.getObjects(pattern.getStartingClass()), pattern, index, c);
  	}
docs: Searches a model for the given pattern, then collects the specified elements of the matches
  and returns.
  
  @param <T> BioPAX type
  @param model model to search in
  @param pattern pattern to search for
  @param index index of the element in the match to collect
  @param c type of the element to collect
  @return set of the elements at the specified index of the matching results