Counter { public synchronized void setValue(long newValue) { value=newValue; } 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 testSetValue() throws Exception { Counter c = new Counter(15); c.setValue(30); assertEquals(30, c.getValue()); }