private static Edge findSimilarEdgeBySources(
      List<Edge> edges, Set<Vertex> sources, String expr, Edge.Type type) {
    for (Edge edge: edges) {
      if (edge.type == type && StringUtils.equals(edge.expr, expr)
          && SetUtils.isEqualSet(edge.sources, sources)) {
        return edge;
      }
    }
    return null;
  }
Find an edge that has the same type, expression, and sources.
ql/src/java/org/apache/hadoop/hive/ql/hooks/LineageLogger.java