just an idea but maybe we could get rid of the AtomicInteger here and just back both ints into a long and return it. This way we not need to create a new Object and also the volatile etc stuff of AtomicInteger is not needed at all.