AddBlockPoolException extends RuntimeException { public boolean hasExceptions() { return !unhealthyDataDirs.isEmpty(); } AddBlockPoolException(Map<FsVolumeSpi, IOException>
      unhealthyDataDirs);  AddBlockPoolException(); void mergeException(AddBlockPoolException e); boolean hasExceptions(); Map<FsVolumeSpi, IOException> getFailingVolumes(); @Override String toString();  }
@Test public void testHasExeceptionsReturnsCorrectValue() { AddBlockPoolException e = new AddBlockPoolException(); assertFalse(e.hasExceptions()); FsVolumeImpl fakeVol = mock(FsVolumeImpl.class); ConcurrentHashMap<FsVolumeSpi, IOException> vols = new ConcurrentHashMap<FsVolumeSpi, IOException>(); vols.put(fakeVol, new IOException("Error 1")); e = new AddBlockPoolException(vols); assertTrue(e.hasExceptions()); }