This should really just be versionCounter.set(0);.  This has a race condition that if generateNew method was invoked at the same time it could be possible that the CAS operation doesn't work properly because the get returned a value just before it was incremented but before the CAS occur, causing a missed reset.