package ch21concurrent.examples; import ch21concurrent.annotations.*; /** * Sequence * * @author Brian Goetz and Tim Peierls */ @ThreadSafe public class Sequence { @GuardedBy("this") private int nextValue; public synchronized int getNext() { return nextValue++; } }