code: public Set<BioPAXElement> fetch(final BioPAXElement bpe, int depth)
  	{
  		//a sanity check
  		if(depth <= 0) {
  			throw new IllegalArgumentException("fetch(..), not a positive 'depth':" + depth);
  		}
  
  		final Set<BioPAXElement> children = new HashSet<BioPAXElement>();
  
  		//create a simple traverser to collect direct child elements
  		Traverser traverser = new Traverser(editorMap,
  				new Visitor() {
  					@Override
  					public void visit(BioPAXElement domain, Object range, Model model, PropertyEditor<?, ?> editor) {
  							children.add((BioPAXElement) range);
  					}
  				}, filters);
  		//run
  		traverser.traverse(bpe, null);
  
  		if(!children.isEmpty() && --depth > 0) {
  			for (BioPAXElement element : new HashSet<BioPAXElement>(children)) {
  				if(skipSubPathways && (element instanceof Pathway))
  					continue;
  
  				Set<BioPAXElement> nextLevelElements = fetch(element, depth); //recursion goes on
  				children.addAll(nextLevelElements);
  			}
  		}
  
  		//remove itself (if added due to tricky loops in the model...)
  		children.remove(bpe);
  
  		return children;
  	}
docs: Recursively collects unique child objects from
  BioPAX object type properties that pass
  all the filters (as set via Constructor).
  
  The #isSkipSubPathways flag is ignored.
  
  Note: this method might return different objects with the same URI if such
  are present among the child elements for some reason (for a self-integral BioPAX Model, this should not happen).
  
  @param bpe biopax object to traverse into properties of
  @param depth positive int.; 1 means - get only direct children, 2 - include children of children, etc.;
  @return set of child objects
  @throws IllegalArgumentException when depth is less or equals 0