### Question:
StoreFiles { public boolean isEmpty( File storeDir, Collection<File> filesToLookFor ) throws IOException { File[] files = fs.listFiles( storeDir, fileFilter ); if ( files != null ) { for ( File file : files ) { if ( filesToLookFor.contains( file ) ) { return false; } } } Iterable<FileHandle> fileHandles = acceptedPageCachedFiles( storeDir )::iterator; for ( FileHandle fh : fileHandles ) { if ( filesToLookFor.contains( fh.getFile() ) ) { return false; } } return true; } StoreFiles( FileSystemAbstraction fs, PageCache pageCache );  StoreFiles( FileSystemAbstraction fs, PageCache pageCache, FilenameFilter fileFilter ); void delete( File storeDir, LogFiles logFiles ); void moveTo( File source, File target, LogFiles logFiles ); boolean isEmpty( File storeDir, Collection<File> filesToLookFor ); StoreId readStoreId( DatabaseLayout databaseLayout );  }### Answer:
@Test public void isEmptyMustFindFilesBothOnFileSystemAndPageCache() throws Exception { File dir = getBaseDir(); File ignore = new File( dir, "ignore" ); File a = new File( dir, "a" ); File c = new File( dir, "c" ); createOnFileSystem( a ); createOnFileSystem( c ); createOnFileSystem( ignore ); FilenameFilter filter = ( directory, name ) -> !name.startsWith( "ignore" ); storeFiles = new StoreFiles( fs, pageCache, filter ); List<File> filesOnFilesystem = asList( a, c ); List<File> fileOnFilesystem = singletonList( a ); List<File> ignoredList = singletonList( ignore ); assertFalse( storeFiles.isEmpty( dir, filesOnFilesystem ) ); assertFalse( storeFiles.isEmpty( dir, fileOnFilesystem ) ); assertTrue( storeFiles.isEmpty( dir, Collections.emptyList() ) ); assertTrue( storeFiles.isEmpty( dir, ignoredList ) ); }