Use AtomicInteger instead of AtomicReferences