code: public synchronized int waitForAndKillPrimaryMaster(int timeoutMs)
        throws TimeoutException, InterruptedException {
      int index = getPrimaryMasterIndex(timeoutMs);
      mMasters.get(index).close();
      return index;
    }
docs: Kills the primary master.
  
  If no master is currently primary, this method blocks until a primary has been elected, then
  kills it.
  
  @param timeoutMs maximum amount of time to wait, in milliseconds
  @return the ID of the killed master