### Question:
LedgerDirsManager { File pickRandomWritableDir() throws NoWritableLedgerDirException { return pickRandomWritableDir(null); } LedgerDirsManager(ServerConfiguration conf, File[] dirs, DiskChecker diskChecker);  LedgerDirsManager(ServerConfiguration conf, File[] dirs, DiskChecker diskChecker, StatsLogger statsLogger); List<File> getAllLedgerDirs(); List<LedgerDirsListener> getListeners(); long getTotalFreeSpace(List<File> dirs); long getTotalDiskSpace(List<File> dirs); ConcurrentMap<File, Float> getDiskUsages(); List<File> getWritableLedgerDirs(); boolean hasWritableLedgerDirs(); List<File> getWritableLedgerDirsForNewLog(); List<File> getFullFilledLedgerDirs(); boolean isDirFull(File dir); @VisibleForTesting void addToFilledDirs(File dir); void addToWritableDirs(File dir, boolean underWarnThreshold); void addLedgerDirsListener(LedgerDirsListener listener); DiskChecker getDiskChecker();  }### Answer:
@Test public void testPickWritableDirExclusive() throws Exception { try { dirsManager.pickRandomWritableDir(curDir); fail("Should not reach here due to there is no writable ledger dir."); } catch (NoWritableLedgerDirException nwlde) { assertTrue(true); } }