private void addEdgesForStartVertex(Graph<CodeBlockVertex, CodeBlockEdge> graph,
			Map<CodeBlock, CodeBlockVertex> blockToVertexMap, CodeBlockVertex start,
			TaskMonitor monitor) throws CancelledException {

		CodeBlock codeBlock = start.getCodeBlock();
		CodeBlockReferenceIterator destinations = codeBlock.getDestinations(monitor);
		for (; destinations.hasNext();) {
			monitor.checkCancelled();
			CodeBlockReference reference = destinations.next();
			CodeBlock destinationBlock = reference.getDestinationBlock();
			CodeBlockVertex end = blockToVertexMap.get(destinationBlock);
			if (end == null) {
				continue; // no vertex means the code block is not in our function
			}

			graph.addEdge(new CodeBlockEdge(start, end), start, end);
		}
	}
This plugin class contains the structure needed for the user to select code
blocks that are only reachable by following the flow from the current program
location (they are unreachable from any other starting point).
Ghidra/Features/Base/src/main/java/ghidra/app/plugin/core/select/flow/SelectByScopedFlowPlugin.java