code: private Edge findDirectionalEdge(Graph g, int u) {
          List<Edge> edges = g.edges(u);
          if (edges.size() == 1)
              return null;
          Edge first = null;
          for (Edge e : edges) {
              Bond b = e.bond();
              if (b == Bond.UP || b == Bond.DOWN) {
                  if (first == null)
                      first = e;
                  else if (((first.either() == e.either()) == (first.bond() == b)))
                      return null;
              }
          }
          return first;
      }
docs: Utility for find the first directional edge incident to a vertex. If
  there are no directional labels then null is returned.
  
  @param g graph from Beam
  @param u the vertex for which to find
  @return first directional edge (or null if none)