code: public static void terminateVMIfMust(Throwable t) {
          while(t != null) {
              if(t instanceof VirtualMachineError) {
                  VirtualMachineErrorTerminator.terminateVM(
                          (VirtualMachineError)t);
              }
              t = t.getCause();
          }
      }
docs: Checks if the throwable or any of the causes in its cause chain are a
  virtual machine error, and if so, terminates the virtual machine. If
  neither the throwable nor any of its causes are a virtual machine error,
  then does nothing. Useful in the body of a generic
  <pre>catch(Throwable t)</pre> block.
  @param t the topmost throwable. Can be null.