Counter { public synchronized void clear() { value=0; } Counter(int startValue); synchronized long decrease(); synchronized long decrease(long amount); synchronized long increase(); synchronized long increase(long amount); synchronized void clear(); synchronized long getValue(); synchronized void setValue(long newValue);  }
@Test public void testClear() throws Exception { Counter c = new Counter(15); c.clear(); assertEquals(0, c.getValue()); }