### Question:
LocalDatabase implements Lifecycle { public boolean isAvailable() { return currentRequirement == null; } LocalDatabase( DatabaseLayout databaseLayout,
            StoreFiles storeFiles,
            LogFiles logFiles,
            DataSourceManager dataSourceManager,
            Supplier<DatabaseHealth> databaseHealthSupplier,
            AvailabilityGuard availabilityGuard,
            LogProvider logProvider ); @Override void init(); @Override synchronized void start(); @Override void stop(); void stopForStoreCopy(); boolean isAvailable(); @Override void shutdown(); synchronized StoreId storeId(); void panic( Throwable cause ); void assertHealthy( Class<EXCEPTION> cause ); void delete(); boolean isEmpty(); DatabaseLayout databaseLayout(); NeoStoreDataSource dataSource(); void registerCommitProcessDependencies( TransactionAppender appender, StorageEngine applier ); TransactionCommitProcess getCommitProcess();  }### Answer:
@Test public void availabilityGuardRaisedOnCreation() { DatabaseAvailabilityGuard guard = newAvailabilityGuard(); assertTrue( guard.isAvailable() ); LocalDatabase localDatabase = newLocalDatabase( guard ); assertNotNull( localDatabase ); assertDatabaseIsStoppedAndUnavailable( guard ); }