code: private static Set<BioPAXElement> convertQueryResult(
  		Set<GraphObject> resultWrappers, Graph graph, boolean removeDisconnected)
  	{
  		Set<Object> result = graph.getWrappedSet(resultWrappers);
  
  		Set<BioPAXElement> set = new HashSet<BioPAXElement>();
  		for (Object o : result)
  		{
  			set.add((BioPAXElement) o);
  		}
  
  		// remove disconnected simple physical entities
  		if (removeDisconnected)
  		{
  			Set<BioPAXElement> remove = new HashSet<BioPAXElement>();
  
  			for (BioPAXElement ele : set)
  			{
  				if (ele instanceof SimplePhysicalEntity &&
  					isDisconnected((SimplePhysicalEntity) ele, set))
  				{
  					remove.add(ele);
  				}
  			}
  			set.removeAll(remove);
  		}
  		
  		return set;
  	}
docs: Converts the query result from wrappers to wrapped BioPAX elements.
  @param resultWrappers Wrappers of the result set
  @param graph Queried graph
  @param removeDisconnected whether to remove disconnected non-complex type physical entities
  @return Set of elements in the result