@Override
  public void close() throws UnavailableException {
    // JournalContext is closed before block deletion context so that file system master changes
    // are written before block master changes. If a failure occurs between deleting an inode and
    // remove its blocks, it's better to have an orphaned block than an inode with a missing block.
    closeQuietly(mJournalContext);
    closeQuietly(mBlockDeletionContext);

    if (mThrown != null) {
      Throwables.propagateIfPossible(mThrown, UnavailableException.class);
      throw new RuntimeException(mThrown);
    }
  }
@Test
  public void blockDeletionContextThrows() throws Throwable {
    Exception bdcException = new UnavailableException("block deletion context exception");
    doThrow(bdcException).when(mMockBDC).close();
    checkClose(bdcException);
  }