code: public void await() throws InterruptedException, EOFException
      {
          synchronized(this)
          {
              while ( (state.get() == State.STARTED) && !hasLeadership.get() )
              {
                  wait();
              }
          }
          if ( state.get() != State.STARTED )
          {
              throw new EOFException();
          }
      }
docs: <p>Causes the current thread to wait until this instance acquires leadership
  unless the thread is {@linkplain Thread#interrupt interrupted} or {@linkplain #close() closed}.</p>
  <p>If this instance already is the leader then this method returns immediately.</p>
  <p></p>
  <p>Otherwise the current
  thread becomes disabled for thread scheduling purposes and lies
  dormant until one of three things happen:</p>
  <ul>
  <li>This instance becomes the leader</li>
  <li>Some other thread {@linkplain Thread#interrupt interrupts}
  the current thread</li>
  <li>The instance is {@linkplain #close() closed}</li>
  </ul>
  <p>If the current thread:</p>
  <ul>
  <li>has its interrupted status set on entry to this method; or
  <li>is {@linkplain Thread#interrupt interrupted} while waiting,
  </ul>
  <p>then {@link InterruptedException} is thrown and the current thread's
  interrupted status is cleared.</p>
  
  @throws InterruptedException if the current thread is interrupted
  while waiting
  @throws EOFException         if the instance is {@linkplain #close() closed}
  while waiting