private void stopTimer(Timer timer){
  if (timer != null && timer.isRunning()) {
    timer.stop();
  }
}

private void stopTimer ( Timer timer ) { if ( timer != null && timer . isRunning ( ) ) { timer . stop ( ) ; } }
stops the given timer if it is running .
