### Question:
BKLogReadHandler extends BKLogHandler implements LogSegmentNamesListener { synchronized CompletableFuture<Void> lockStream() { if (null == lockAcquireFuture) { lockAcquireFuture = streamMetadataStore.createReadLock(logMetadataForReader, subscriberId) .thenCompose(lock -> { try { BKLogReadHandler.this.readLock = lock; LOG.info("acquiring readlock {} at {}", getLockClientId(), getReadLockPath()); return acquireLockOnExecutorThread(lock); } catch (LockingException le) { return FutureUtils.exception(le); } }); } return lockAcquireFuture; } BKLogReadHandler(LogMetadataForReader logMetadata,
                     Optional<String> subscriberId,
                     DistributedLogConfiguration conf,
                     DynamicDistributedLogConfiguration dynConf,
                     LogStreamMetadataStore streamMetadataStore,
                     LogSegmentMetadataCache metadataCache,
                     LogSegmentEntryStore entryStore,
                     OrderedScheduler scheduler,
                     AlertStatsLogger alertStatsLogger,
                     StatsLogger statsLogger,
                     StatsLogger perLogStatsLogger,
                     String clientId,
                     AsyncNotification readerStateNotification,
                     boolean isHandleForReading); CompletableFuture<Void> asyncClose(); @Override CompletableFuture<Void> asyncAbort(); @Override void onSegmentsUpdated(final Versioned<List<String>> segments); @Override void onLogStreamDeleted();  }### Answer:
@Test(timeout = 60000) public void testLockStreamWithMissingLog() throws Exception { String streamName = runtime.getMethodName(); BKDistributedLogManager bkdlm = (BKDistributedLogManager) createNewDLM(conf, streamName); BKLogReadHandler readHandler = bkdlm.createReadHandler(); try { Utils.ioResult(readHandler.lockStream()); fail("Should fail lock stream if log not found"); } catch (LogNotFoundException ex) { } BKLogReadHandler subscriberReadHandler = bkdlm.createReadHandler(Optional.of("test-subscriber")); try { Utils.ioResult(subscriberReadHandler.lockStream()); fail("Subscriber should fail lock stream if log not found"); } catch (LogNotFoundException ex) { } }