Supposing I have an AtomicInteger called x.

Is x.get() equivalent to getAndAdd(0)?

I know getAndAdd(0) is definitely atomic, but it looks pointless at first glance.

I have the same question for set().

I am pretty sure that set is non-atomic, but I want to be sure.