I want to implement a circular counter in Java. The counter on each request should increment (atomically) and on reaching an upper limit should roll over to 0.

What would be the best way to implement this and are there any existing implementations?

Edit
Report