@Override
    public boolean equals(final Object o) {
        if (this == o) return true;
        if (!(o instanceof LabelledCounter)) return false;

        LabelledCounter that = (LabelledCounter) o;

        if (count != that.count) return false;
        return label != null ? label.equals(that.label) : that.label == null;
    }
Class to track a count associated with a Label
gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/traverser/util/LabelledCounter.java