public int decrement(){
  lock.lock();
  int newValue=--value;
  lock.unlock();
  return newValue;
}

public int decrement ( ) { lock . lock ( ) ; int newValue = -- value ; lock . unlock ( ) ; return newValue ; }
decrements the counter by 1 .
