Code example for AtomicLong

Methods: getAndIncrement

0
public class DoubleObjectFactory implements ObjectFactory<Double> {
 
	private AtomicLong counter = new AtomicLong();
 
	public Double instance() {
		return Double.valueOf(counter.getAndIncrement());
	} 
 
} 
Connect your IDE to all the code out there  Get Codota for Java