| 5 | import java.util.concurrent.atomic.*; |
| 6 | |
| 7 | public class GuardedIDField implements HasID { |
| 8 | private static AtomicInteger counter = |
| 9 | new AtomicInteger(); |
| 10 | private int id = counter.getAndIncrement(); |
| 11 | @Override public int getID() { return id; } |
| 12 | public static void main(String[] args) { |
| 13 | IDChecker.test(GuardedIDField::new); |
| 14 | } |
| 15 | } |
| 16 | /* Output: |
| 17 | 0 |
| 18 | */ |
nothing calls this directly
no outgoing calls
no test coverage detected