code: public <T extends BioPAXElement> Set<T> fetch(final BioPAXElement element, final Class<T> filterByType)
  	{
      	final Set<T> children = new HashSet<T>();
  
  		AbstractTraverser traverser = new AbstractTraverser(editorMap, filters) {
      	    /*
      	     * Adds the BioPAX element into the model and traverses the element's properties
      	     * to collect all dependent/nested elements.
      	     */
      	    protected void visit(Object range, BioPAXElement domain, Model model, PropertyEditor editor)
      		{
     				//by design (see Constructor, filters), it'll visit only object properties.
  				BioPAXElement bpe = (BioPAXElement) range;
  
  				if(filterByType.isInstance(bpe)) {
  					children.add((T) bpe);
  				}
  
  				if(!(skipSubPathways && (bpe instanceof Pathway)))
  					traverse(bpe, null); //(does nothing when bpe has been previously visited)
  			}
      	};
  
      	traverser.traverse(element, null);
      	
      	return children;
  	}
docs: Goes over object type biopax properties to collect nested objects
  (using only properties that pass all the filters set in Constructor,
  and taking #isSkipSubPathways into account)
  of the given biopax element, its children, etc.
  (it also escapes any infinite semantic loops in the biopax model)
  It saves only biopax objects of the given type, incl. sub-types.
  
  Note: this method can eventually return
  different objects with the same URI if these
  are present among child elements.
  
  @param element to fetch child objects from
  @param filterByType biopax type filter
  @param <T> biopax type
  @return set of biopax objects