### Question:
HddsVolume implements Checkable<Boolean, VolumeCheckResult> { public void shutdown() { this.state = VolumeState.NON_EXISTENT; if (volumeInfo != null) { volumeInfo.shutdownUsageThread(); } } private  HddsVolume(Builder b); @Override VolumeCheckResult check(@Nullable Boolean unused); VolumeInfo getVolumeInfo(); void format(String cid); File getHddsRootDir(); StorageType getStorageType(); String getStorageID(); String getClusterID(); String getDatanodeUuid(); long getCTime(); int getLayoutVersion(); VolumeState getStorageState(); long getCapacity(); long getAvailable(); long getUsedSpace(); void setState(VolumeState state); boolean isFailed(); VolumeIOStats getVolumeIOStats(); void failVolume(); void shutdown(); long incCommittedBytes(long delta); long getCommittedBytes(); @Override int hashCode(); @Override boolean equals(Object other); @Override String toString(); static final String HDDS_VOLUME_DIR; }### Answer:
@Test public void testShutdown() throws Exception { long initialUsedSpace = 250; AtomicLong savedUsedSpace = new AtomicLong(initialUsedSpace); SpaceUsagePersistence persistence = inMemory(savedUsedSpace); SpaceUsageSource spaceUsage = fixed(500, 200); long expectedUsedSpace = spaceUsage.getUsedSpace(); SpaceUsageCheckFactory factory = MockSpaceUsageCheckFactory.of( spaceUsage, Duration.ZERO, persistence); volumeBuilder.usageCheckFactory(factory); HddsVolume volume = volumeBuilder.build(); assertEquals(initialUsedSpace, savedUsedSpace.get()); assertEquals(expectedUsedSpace, volume.getUsedSpace()); volume.shutdown(); assertEquals(HddsVolume.VolumeState.NON_EXISTENT, volume.getStorageState()); assertEquals(expectedUsedSpace, savedUsedSpace.get()); assertEquals(spaceUsage.getAvailable(), volume.getAvailable()); }