Code example for AtomicLong

Methods: incrementAndGet

0
        return id;
    } 
 
    @PostConstruct 
    public void assignId() { 
        id = seed.incrementAndGet();
    } 
} 
Connect your IDE to all the code out there  Get Codota for Java