When return value is of interest, is it possible that in case of AtomicInteger.getAndIncrement()
, two threads who call this method will get the same value?
In case of AtomicInteger.incrementAndGet()
it makes sense two threads will get different value because of the increment happening first.