private static Collection<FGEdge> getEdgesForStartVertex(
			BidiMap<CodeBlock, FGVertex> blockToVertexMap, FGVertex startVertex,
			FGController controller, TaskMonitor monitor) throws CancelledException {

		List<FGEdge> edges = new ArrayList<>();
		CodeBlock codeBlock = blockToVertexMap.getKey(startVertex);
		CodeBlockReferenceIterator destinations = codeBlock.getDestinations(monitor);
		for (; destinations.hasNext();) {
			CodeBlockReference reference = destinations.next();
			CodeBlock destinationBlock = reference.getDestinationBlock();
			FGVertex destinationVertex = blockToVertexMap.get(destinationBlock);
			if (destinationVertex == null) {
				continue;// no vertex means the code block is not in our function
			}

			edges.add(new FGEdgeImpl(startVertex, destinationVertex, reference.getFlowType(),
				controller.getFunctionGraphOptions()));
		}
		return edges;
	}
Creates a new function graph for the given function

@param function the function to graph
@param controller the controller needed by the function graph
@param program the function's program
@param monitor the task monitor
@return the new graph
@throws CancelledException if the task is cancelled via the monitor
Ghidra/Features/FunctionGraph/src/main/java/ghidra/app/plugin/core/functiongraph/graph/FunctionGraphFactory.java