code: private boolean currentGateLeadsToOtherStage(final TraversalEntry te, final boolean forward) {
  
  		final ManagementGroupVertex groupVertex = te.getManagementVertex().getGroupVertex();
  
  		if (forward) {
  
  			if (te.getCurrentGate() >= groupVertex.getNumberOfForwardEdges()) {
  				return false;
  			}
  
  			final ManagementGroupEdge edge = groupVertex.getForwardEdge(te.getCurrentGate());
  			if (edge.getTarget().getStageNumber() == groupVertex.getStageNumber()) {
  				return false;
  			}
  
  		} else {
  
  			if (te.getCurrentGate() >= groupVertex.getNumberOfBackwardEdges()) {
  				return false;
  			}
  
  			final ManagementGroupEdge edge = groupVertex.getBackwardEdge(te.getCurrentGate());
  			if (edge.getSource().getStageNumber() == groupVertex.getStageNumber()) {
  				return false;
  			}
  		}
  
  		return true;
  	}
docs: Checks if the current gate leads to another stage or not.
  
  @param te
  the current traversal entry
  @param forward
  <code>true</code> if the graph should be traversed in correct order, <code>false</code> to traverse it in
  reverse order
  @return <code>true</code> if current gate leads to another stage, otherwise <code>false</code>