public static boolean stopThreads(List<Thread> threads){
  boolean status=true;
  threads.forEach(null);
  for (  Thread t : threads) {
    status=joinThread(t) && status;
  }
  return status;
}

public static boolean stopThreads ( List < Thread > threads ) { boolean status = true ; threads . forEach ( null ) ; for ( Thread t : threads ) { status = joinThread ( t ) && status ; } return status ; }
first interrupts all the threads in the specified list and then waits until they have terminated . if any have not terminated after a short delay ( 1000 ms ) , false is returned .
