public static synchronized void stopAllTimers(){
  for (  Timer timer : instances) {
    timer.cancel();
  }
  instances.clear();
}

public static synchronized void stopAllTimers ( ) { for ( Timer timer : instances ) { timer . cancel ( ) ; } instances . clear ( ) ; }
as interrupting threads might not work on timer objects , explicitly kill all created instances
