CAS written in Java