The short answer is you don't need AtomicReference here. However, you will need instability.
The reason is that you only write and read from the link (Result) and do not perform any compound operations such as compareAndSet ().
Reads and writes are atomic for reference variables and for most primitive variables (all types except long and double).
Reference, Sun Java Tutorial
https://docs.oracle.com/javase/tutorial/essential/concurrency/atomic.html
Then there is JLS (Java language specification)
Writes and reads of links are always atomic, regardless of whether they are implemented as 32-bit or 64-bit values.
Java 8
http://docs.oracle.com/javase/specs/jls/se8/html/jls-17.html#jls-17.7
Java 7
http://docs.oracle.com/javase/specs/jls/se7/html/jls-17.html#jls-17.7
Java 6
http://docs.oracle.com/javase/specs/jls/se6/html/memory.html#17.7
Source: https://docs.oracle.com/javase/tutorial/essential/concurrency/atomic.html
Atomic actions cannot alternate, so they can be used without fear of flow interference. However, this does not eliminate the need for synchronization of atomic actions, since memory matching errors are still possible. The use of volatile variables reduces the risk of memory consistency errors, since any write to a mutable variable establishes a connection between events and subsequent readings of the same variable . This means that changes in a mutable variable are always visible to other threads. What else, it also means that when a stream reads a volatile variable, it sees not only the last change in volatiles, but also side effects of the code that led to the change.
Since you have only one write / read operation and it is atomic, which makes the volatile variable sufficient.
Regarding the use of CountDownLatch, he was waiting for the completion of n operations in other threads. Since you have only one operation, you can use Condition rather than CountDownLatch.
If you are interested in using AtomicReference, you can check out Java Concurrency in Practice (Page 326), find the following book:
https://github.com/HackathonHackers/programming-ebooks/tree/master/Java
Or the same example used by @Binita Bharti in the next StackOverflow answer
When to use AtomicReference in Java?