tracedsl/src/main/java/io/jaegertracing/analytics/tracequality/UniqueSpanId.java
public static Map<String, List<Span>> computeScore(Graph graph) {
    TraceTraversal<Vertex, Map<Object, Object>> by = Util.traceTraversal(graph).V()
        .group().by(Keys.SPAN_ID);

    Map<String, List<Span>> result = new LinkedHashMap<>();
    while (by.hasNext()) {
      Map<Object, Object> map = by.next();
      for (Map.Entry<Object, Object> entry: map.entrySet()) {
          Collection<Vertex> vertices = (Collection<Vertex>) entry.getValue();
          String id = (String) entry.getKey();
          List<Span> spans = result.get(id);
          if (spans == null) {
            spans = new ArrayList<>(vertices.size());
            result.put(id, spans);
          }
          for (Vertex vertex: vertices) {
            Span span = GraphCreator.toSpan(vertex);
            spans.add(span);
          }
      }
    }
    return result;
  }
/**
   * @return List of spans per spanID
   */
@return List of spans per spanID
@return List of spans per spanID
public static Map<String, List<Span>> computeScore(Graph graph) {
    TraceTraversal<Vertex, Map<Object, Object>> by = Util.traceTraversal(graph).V()
        .group().by(Keys.SPAN_ID);
    Map<String, List<Span>> result = new LinkedHashMap<>();
    while (by.hasNext()) {
      Map<Object, Object> map = by.next();
      for (Map.Entry<Object, Object> entry: map.entrySet()) {
          Collection<Vertex> vertices = (Collection<Vertex>) entry.getValue();
          String id = (String) entry.getKey();
          List<Span> spans = result.get(id);
          if (spans == null) {
            spans = new ArrayList<>(vertices.size());
            result.put(id, spans);
          }
          for (Vertex vertex: vertices) {
            Span span = GraphCreator.toSpan(vertex);
            spans.add(span);
          }
      }
    }
    return result;
  }
public static Map < String , List < Span > > computeScore ( Graph graph ) { TraceTraversal < Vertex , Map < Object , Object > > by = Util . traceTraversal ( graph ) . V ( ) . group ( ) . by ( Keys . SPAN_ID ) ; Map < String , List < Span > > result = new LinkedHashMap < > ( ) ; while ( by . hasNext ( ) ) { Map < Object , Object > map = by . next ( ) ; for ( Map . Entry < Object , Object > entry : map . entrySet ( ) ) { Collection < Vertex > vertices = ( Collection < Vertex > ) entry . getValue ( ) ; String id = ( String ) entry . getKey ( ) ; List < Span > spans = result . get ( id ) ; if ( spans == null ) { spans = new ArrayList < > ( vertices . size ( ) ) ; result . put ( id , spans ) ; } for ( Vertex vertex : vertices ) { Span span = GraphCreator . toSpan ( vertex ) ; spans . add ( span ) ; } } } return result ; }
@return List of spans per spanID
@return List of spans per spanID