/**
   * Tests if a the sequence number associated with a particular block location has not changed.
   *
   * @param x the x coordinate
   * @param y the y coordinate
   * @param z the z coordinate
   * @param expected the expected sequence number
   * @return true if the sequence number has not changed and expected is not
   *     DatatableSequenceNumber.ATOMIC
   */
  @Override
  public boolean testSequence(int x, int y, int z, int expected) {

    if (expected == AtomicSequenceNumber.ATOMIC) {
      return false;
    }

    checkCompressing();
    int index = getIndex(x, y, z);
    boolean interrupted = false;
    try {
      checkCompressing();

      int blockId = blockIds.get(index);
      return auxStore.isReserved(blockId) && auxStore.testSequence(blockId, expected);
    } finally {
      if (interrupted) {
        Thread.currentThread().interrupt();
      }
    }
  }