### Question:
ConsistencyCheck { static void checkUnvisitedPath(FileSystem fs, Path unvisitedMetastorePath) throws IOException { if (fs.exists(unvisitedMetastorePath)) { throw new IllegalStateException( "ABORTING: Metastore path not found in file system scan but does exist: '" + unvisitedMetastorePath + "'."); } } private  ConsistencyCheck();   }### Answer:
@Test void unvisitedPath() throws IOException { Path nonExistent = new Path("/db/table/snapshot/" + RandomStringUtils.randomAlphanumeric(8) + "/partition"); FileSystem fs = nonExistent.getFileSystem(new Configuration(false)); ConsistencyCheck.checkUnvisitedPath(fs, nonExistent); }
@Test void unvisitedPathExists() throws IOException { Path exists = new Path("/tmp"); FileSystem fs = exists.getFileSystem(new Configuration(false)); assertThatExceptionOfType(IllegalStateException.class) .isThrownBy(() -> ConsistencyCheck.checkUnvisitedPath(fs, exists)); }