01: package com.jamonapi; 02: 03: /** Thread safe class for incrementing integers. 04: */ 05: 06: final class Counter { 07: int count; 08: 09: synchronized void increment() { 10: count++; 11: } 12: 13: synchronized void decrement() { 14: count--; 15: } 16: }