use of java8.util.concurrent.atomic.DoubleAdder in project streamsupport by stefan-zobel.
the class DoubleAdderTest method testReset.
/**
* reset() causes subsequent sum() to return zero
*/
public void testReset() {
DoubleAdder ai = new DoubleAdder();
ai.add(2.0);
assertEquals(2.0, ai.sum());
ai.reset();
assertEquals(0.0, ai.sum());
}
use of java8.util.concurrent.atomic.DoubleAdder in project streamsupport by stefan-zobel.
the class DoubleAdderTest method testLongValue.
/**
* longValue returns current value.
*/
public void testLongValue() {
DoubleAdder ai = new DoubleAdder();
assertEquals(0, ai.longValue());
ai.add(1.0);
assertEquals(1, ai.longValue());
}
Aggregations