synchronized void waitForState(State desiredState) throws InterruptedException {
    while (this.state != desiredState) {
      this.wait();
    }
  }
Blocks until the current state becomes <code>desiredState</code>. Currently only used by tests,
thus package-private.
@param desiredState the desired state.
@throws InterruptedException if the current thread gets interrupted.
hbase-common/src/main/java/org/apache/hadoop/hbase/io/FileChangeWatcher.java