public int executeAddedHooks(){
  List<Thread> list=removeNewHooks();
  if (list == null || list.isEmpty()) {
    return 0;
  }
  for (  Thread t : list) {
    t.run();
  }
  return list.size();
}

public int executeAddedHooks ( ) { List < Thread > list = removeNewHooks ( ) ; if ( list == null || list . isEmpty ( ) ) { return 0 ; } for ( Thread t : list ) { t . run ( ) ; } return list . size ( ) ; }
execute all added shutdown hooks on this thread . they are removed from the jvm .
