public Edge[] selfEdges(Vertex v) {
		int n = numLoops(v);
		Edge[] answer = new Edge[n];
		Edge e = vertices.getFirstOutgoingEdge(v);
		int i = 0;
		while (e != null) {
			if (v.equals(e.to())) {
				answer[i++] = e;
			}
			e = edges.getNextEdgeWithSameFrom(e);
		}
		return answer;
	}
Returns an array of all edges with the given vertex as both the from
  and to.
Ghidra/Framework/Generic/src/main/java/ghidra/util/graph/DirectedGraph.java