code: public boolean subgraphContains(final BioPAXElement root, final String uri, 
      		final Class<? extends BioPAXElement> type) {
      	
      	final AtomicBoolean found = new AtomicBoolean(false);
      	
      	Traverser traverser = new AbstractTraverser(editorMap, filters) {  
      		
      	    @Override
      	    protected void visit(Object range, BioPAXElement domain, Model model, PropertyEditor editor)
      		{
      			if (range instanceof BioPAXElement && !found.get())
      			{
      				if( ((BioPAXElement) range).getUri().equals(uri) )
      					found.set(true); //set global flag; done.
      				else
  						if(!(skipSubPathways && (range instanceof Pathway)))
      						traverse((BioPAXElement)range, model);
      			}
      		}
      	};
  
      	traverser.traverse(root, null);
      	
      	return found.get();
  	}
docs: Iterates over child objects of the given biopax element,
  using BioPAX object-type properties, until the element
  with specified URI and class (including its sub-classes).
  is found.
  
  @param root biopax element to process
  @param uri URI to match
  @param type class to match
  
  @return true if the match found; false - otherwise