private AddressSet getAddressesForSelectedVertices() {
		if (currentProgram == null) {
			return new AddressSet();
		}

		AddressSet addresses = new AddressSet();
		FGData functionGraphData = controller.getFunctionGraphData();
		if (!functionGraphData.hasResults()) {
			return addresses;
		}

		FunctionGraph functionGraph = functionGraphData.getFunctionGraph();
		Graph<FGVertex, FGEdge> graph = functionGraph;
		Collection<FGVertex> selectedVertices = GraphViewerUtils.getVerticesOfSelectedEdges(graph);
		for (FGVertex vertex : selectedVertices) {
			addresses.add(vertex.getAddresses());
		}
		return addresses;
	}
A construct that allows tests to control the notion of whether this provider has focus
Ghidra/Features/FunctionGraph/src/main/java/ghidra/app/plugin/core/functiongraph/FGProvider.java