/*
Non-Synchronizable: counter is "replaced" with the input value. Caller should synchronize.
771242
public void set(long lowWaterMark, long highWaterMark, long current, double integral,
                    long startTime, long lastSampleTime) {
        this.current = current;
        this.integral = integral;
        this.lowWaterMark = lowWaterMark;
        this.highWaterMark = highWaterMark;
        this.startTime = startTime;
        this.lastSampleTime = lastSampleTime;
    }
1025823
@Override
    public void accept(double value)
    {
        writeLock.lock();
        try
        {
            eliminate();
            endIncr();
            PrimitiveIterator.OfInt rev = modReverseIterator();
            int e = rev.nextInt();
            assign(e, value);
            while (rev.hasNext())
            {
                e = rev.nextInt();
                if (exceedsBounds(e, value))
                {
                    assign(e, value);
                }
                else
                {
                    break;
                }
            }
        }
        finally
        {
            writeLock.unlock();
        }
    }
790957
public void add(Counter<? extends T> counter) {
        for (Map.Entry<? extends T,Integer> e : counter) {
            T t = e.getKey();
            Integer cur = counts.get(t);
            counts.put(t, (cur == null) ? e.getValue() : cur + e.getValue());
        }
    }
1006094
final public void incrementWithoutSync(long curTime, long val) {
        if (enabled) {
            lastSampleTime = updateIntegral(curTime);
            current += val;
            updateWaterMark();
        } else {
            current += val;
        }
    }
202929
protected void updateNotifier(Notifier value, String xmlTag, Counter counter, Element element)
   {
      Element root = element;
      Counter innerCount = new Counter(counter.getDepth() + 1);
      findAndReplaceSimpleElement(innerCount, root, "type", value.getType(), "mail");
      findAndReplaceSimpleElement(innerCount, root, "sendOnError",
               (value.isSendOnError() == true) ? null : String.valueOf(value.isSendOnError()), "true");
      findAndReplaceSimpleElement(innerCount, root, "sendOnFailure",
               (value.isSendOnFailure() == true) ? null : String.valueOf(value.isSendOnFailure()), "true");
      findAndReplaceSimpleElement(innerCount, root, "sendOnSuccess",
               (value.isSendOnSuccess() == true) ? null : String.valueOf(value.isSendOnSuccess()), "true");
      findAndReplaceSimpleElement(innerCount, root, "sendOnWarning",
               (value.isSendOnWarning() == true) ? null : String.valueOf(value.isSendOnWarning()), "true");
      findAndReplaceSimpleElement(innerCount, root, "address", value.getAddress(), null);
      findAndReplaceProperties(innerCount, root, "configuration", value.getConfiguration());
   }
856397
protected void updatePatternSet(PatternSet value, String xmlTag, Counter counter, Element element)
   {
      boolean shouldExist = value != null;
      Element root = updateElement(counter, element, xmlTag, shouldExist);
      if (shouldExist)
      {
         Counter innerCount = new Counter(counter.getDepth() + 1);
         findAndReplaceSimpleLists(innerCount, root, value.getIncludes(), "includes", "include");
         findAndReplaceSimpleLists(innerCount, root, value.getExcludes(), "excludes", "exclude");
      }
   }
948149
public static int setSynchronized(int modifier, boolean b) {
        if (b) {
            return (modifier | SYNCHRONIZED) &
                (~VOLATILE & ~TRANSIENT & ~INTERFACE);
        }
        else {
            return modifier & ~SYNCHRONIZED;
        }
    }
816217
@ObjectiveCName("changeWithValue:")
    public boolean change(@Nullable T value) {
        if (this.value != null && value != null && value.equals(this.value)) {
            return false;
        }

        // No need in sync. We are not expected complex sync of value models
        this.value = value;

        notify(value);

        return true;
    }
276889
@Override
    public void accept(double value)
    {
        writeLock.lock();
        try
        {
            eliminate();
            int count = count();
            if (count >= size)
            {
                grow();
            }
            assign(endMod(), value);
            endIncr();
        }
        finally
        {
            writeLock.unlock();
        }
    }
101973
@Override
  public void onThreadBegin()
  {
    _threadCount.incrementAndGet();
    
    int startCount = _startingCount.decrementAndGet();

    if (startCount < 0) {
      _startingCount.set(0);
      
      new IllegalStateException().printStackTrace();
    }

    _createCountTotal.incrementAndGet();
    
    update();
  }
528317
function(syncIt) {
	/* global setInterval */
	this._syncIt = syncIt;
	this._instructions = [];
	this._current = null;
	setInterval(function() {
		var args, c;
		if ((this._current === null) && this._instructions.length) {
			this._current = this._instructions.shift();
			args = Array.prototype.slice.call(this._current.a);
			args.push(function(e) {
				if (e !== SyncItConstant.Error.UNABLE_TO_PROCESS_BECAUSE_LOCKED) {
					c = this._current.c;
					this._current = null;
					c.apply(
						this._syncIt,
						arguments
					);
				}
			}.bind(this));
			this._current.f.apply(this._syncIt, args);
		}
	}.bind(this), 50);
}
733665
protected void updateFileSet(FileSet value, String xmlTag, Counter counter, Element element)
   {
      boolean shouldExist = value != null;
      Element root = updateElement(counter, element, xmlTag, shouldExist);
      if (shouldExist)
      {
         Counter innerCount = new Counter(counter.getDepth() + 1);
         findAndReplaceSimpleElement(innerCount, root, "directory", value.getDirectory(), null);
         findAndReplaceSimpleLists(innerCount, root, value.getIncludes(), "includes", "include");
         findAndReplaceSimpleLists(innerCount, root, value.getExcludes(), "excludes", "exclude");
      }
   }
934002
@Override
    public void onNext(final T t) {

        Objects.requireNonNull(t);
        counter.added++;
        queue.add(t);





    }
669126
function Counter() {
  this.total = 0;
  this.executed = 0;
  this.passed = 0;
  this.error = 0;
  this.failed = 0;
  this.timeout = 0;
  this.aborted = 0;
  this.inconclusive = 0;
  this.passedButRunAborted = 0;
  this.notRunnable = 0;
  this.notExecuted = 0;
  this.disconnected = 0;
  this.warning = 0;
  this.completed = 0;
  this.inProgress = 0;
  this.pending = 0;
}
1040641
public void increment(String name, int value) {
		Counter counter = get(name, CounterType.Increment);
		counter.setCount(counter.getCount() != null ? counter.getCount() + value : value);
		update();
	}
304407
function(input, callback) {
  // Handle non-function `input`.
  if (!_.isFunction(input)) {
    callback(null, input)
    return
  }

  // Handle asynchronous `input` function.
  if (input.length) {
    input(callback)
    return
  }

  // Handle synchronous `input` function.
  var results = null
  var err = null
  try {
    results = input()
  } catch (e) {
    err = e
  }

  callback(err, results)
}
654071
public double setCount(F first, S second, double value) {
        Counter<S> counter = maps.get(first);
        if (counter == null) {
            counter = new Counter<S>();
            maps.put(first, counter);
        }

        return counter.setCount(second, value);
    }