```Java
private static final AtomicInteger counter = new AtomicInteger(0);
// ...
setAttribute(REBIND_COUNTER, counter.incrementAndGet());
// ...
int getCounter() { return counter.get(); }
```