@Override
    public Collection<ImmutableMetrics> getMetrics() {
        return positionIndexedMetrics.entrySet().stream().sorted(Map.Entry.comparingByKey()).
                collect(Collectors.toMap(Map.Entry::getKey, Map.Entry::getValue,
                (oldValue, newValue) -> oldValue, LinkedHashMap::new)).values();
    }
This is only a convenient constructor needed for GraphSON deserialization.
gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/util/DefaultTraversalMetrics.java