The Oracle JDK Javadoc for AtomicBoolean states:
A boolean value that may be updated atomically. See the
java.util.concurrent.atomic package specification for description of
the properties of atomic variables. An AtomicBoolean is used in
applications such as atomically updated flags, and cannot be used as a
replacement for a Boolean.
Boolean is the wrapper class around the primitive
boolean. It may be automatically created from a
boolean by the compiler (boxing conversion) or converted to a boolean (unboxing conversion). This is not the case for
AtomicBoolean where it is a separate class designed for concurrency purposes.
Hence the two classes have different semantics at the language level:
Boolean b = new Boolean(true); AtomicBoolean ab = new AtomicBoolean(true); System.out.println(true == b); // automatic unboxing of Boolean variable System.out.println(true == ab); // compiler error