### Question:
CommitStateHelper { public boolean hasTxLogs( DatabaseLayout databaseLayout ) throws IOException { return LogFilesBuilder.activeFilesBuilder( databaseLayout, fs, pageCache ).withConfig( config ).build().logFiles().length > 0; } CommitStateHelper( PageCache pageCache, FileSystemAbstraction fs, Config config ); boolean hasTxLogs( DatabaseLayout databaseLayout );  }### Answer:
@Test public void shouldNotHaveTxLogsIfDirectoryDoesNotExist() throws IOException { File txDir = config.get( GraphDatabaseSettings.logical_logs_location ); assertFalse( txDir.exists() ); assertFalse( commitStateHelper.hasTxLogs( databaseLayout ) ); }
@Test public void shouldNotHaveTxLogsIfDirectoryIsEmpty() throws IOException { File txDir = config.get( GraphDatabaseSettings.logical_logs_location ); fsa.mkdir( txDir ); assertFalse( commitStateHelper.hasTxLogs( databaseLayout ) ); }
@Test public void shouldNotHaveTxLogsIfDirectoryHasFilesWithIncorrectName() throws IOException { File txDir = config.get( GraphDatabaseSettings.logical_logs_location ); fsa.mkdir( txDir ); fsa.create( new File( txDir, "foo.bar" ) ).close(); assertFalse( commitStateHelper.hasTxLogs( databaseLayout ) ); }
@Test public void shouldHaveTxLogsIfDirectoryHasTxFile() throws IOException { File txDir = config.get( GraphDatabaseSettings.logical_logs_location ); fsa.mkdir( txDir ); fsa.create( new File( txDir, TransactionLogFiles.DEFAULT_NAME + ".0" ) ).close(); assertTrue( commitStateHelper.hasTxLogs( databaseLayout ) ); }