class DataPoint implements CounterDataPoint {

        private final DoubleAdder doubleValue = new DoubleAdder();
        // LongAdder is 20% faster than DoubleAdder. So let's use the LongAdder for long observations,
        // and DoubleAdder for double observations. If the user doesn't observe any double at all,
        // we will be using the LongAdder and get the best performance.
        private final LongAdder longValue = new LongAdder();
        private final long createdTimeMillis = System.currentTimeMillis();
        private final ExemplarSampler exemplarSampler; // null if isExemplarsEnabled() is false

        private DataPoint(ExemplarSampler exemplarSampler) {
            this.exemplarSampler = exemplarSampler;
        }

        /**
         * {@inheritDoc}
         */
        public double get() {
            return longValue.sum() + doubleValue.sum();
        }

        /**
         * {@inheritDoc}
         */
        public long getLongValue() {
            return longValue.sum() + (long) doubleValue.sum();
        }

        /**
         * {@inheritDoc}
         */
        @Override
        public void inc(long amount) {
            validateAndAdd(amount);
            if (isExemplarsEnabled()) {
                exemplarSampler.observe(amount);
            }
        }

        /**
         * {@inheritDoc}
         */
        @Override
        public void inc(double amount) {
            validateAndAdd(amount);
            if (isExemplarsEnabled()) {
                exemplarSampler.observe(amount);
            }
        }

        /**
         * {@inheritDoc}
         */
        @Override
        public void incWithExemplar(long amount, Labels labels) {
            validateAndAdd(amount);
            if (isExemplarsEnabled()) {
                exemplarSampler.observeWithExemplar(amount, labels);
            }
        }

        /**
         * {@inheritDoc}
         */
        @Override
        public void incWithExemplar(double amount, Labels labels) {
            validateAndAdd(amount);
            if (isExemplarsEnabled()) {
                exemplarSampler.observeWithExemplar(amount, labels);
            }
        }

        private void validateAndAdd(long amount) {
            if (amount < 0) {
                throw new IllegalArgumentException("Negative increment " + amount + " is illegal for Counter metrics.");
            }
            longValue.add(amount);
        }

        private void validateAndAdd(double amount) {
            if (amount < 0) {
                throw new IllegalArgumentException("Negative increment " + amount + " is illegal for Counter metrics.");
            }
            doubleValue.add(amount);
        }

        private CounterSnapshot.CounterDataPointSnapshot collect(Labels labels) {<FILL_FUNCTION_BODY>}
    }

            // Read the exemplar first. Otherwise, there is a race condition where you might
            // see an Exemplar for a value that's not counted yet.
            // If there are multiple Exemplars (by default it's just one), use the newest.
            Exemplar latestExemplar = null;
            if (exemplarSampler != null) {
                for (Exemplar exemplar : exemplarSampler.collect()) {
                    if (latestExemplar == null || exemplar.getTimestampMillis() > latestExemplar.getTimestampMillis()) {
                        latestExemplar = exemplar;
                    }
                }
            }
            return new CounterSnapshot.CounterDataPointSnapshot(get(), labels, latestExemplar, createdTimeMillis);
        
<methods>public void clear() ,public io.prometheus.metrics.model.snapshots.MetricSnapshot collect() ,public transient void initLabelValues(java.lang.String[]) ,public transient io.prometheus.metrics.core.datapoints.CounterDataPoint labelValues(java.lang.String[]) ,public transient void remove(java.lang.String[]) <variables>private final ConcurrentHashMap<List<java.lang.String>,io.prometheus.metrics.core.metrics.Counter.DataPoint> data,private volatile io.prometheus.metrics.core.metrics.Counter.DataPoint noLabels