### Question:
ZKLogStreamMetadataStore implements LogStreamMetadataStore { static CompletableFuture<LogMetadataForWriter> getLog(final URI uri, final String logName, final String logIdentifier, final ZooKeeperClient zooKeeperClient, final boolean ownAllocator, final boolean createIfNotExists) { final String logRootPath = LogMetadata.getLogRootPath(uri, logName, logIdentifier); try { PathUtils.validatePath(logRootPath); } catch (IllegalArgumentException e) { LOG.error("Illegal path value {} for stream {}", logRootPath, logName, e); return FutureUtils.exception(new InvalidStreamNameException(logName, "Log name is invalid")); } try { final ZooKeeper zk = zooKeeperClient.get(); return checkLogMetadataPaths(zk, logRootPath, ownAllocator) .thenCompose(metadatas -> { CompletableFuture<List<Versioned<byte[]>>> promise = new CompletableFuture<List<Versioned<byte[]>>>(); createMissingMetadata( zk, uri.getPath(), logRootPath, metadatas, zooKeeperClient.getDefaultACL(), ownAllocator, createIfNotExists, promise); return promise; }).thenCompose(metadatas -> { try { return FutureUtils.value( processLogMetadatas( uri, logName, logIdentifier, metadatas, ownAllocator)); } catch (UnexpectedException e) { return FutureUtils.exception(e); } }); } catch (ZooKeeperClient.ZooKeeperConnectionException e) { return FutureUtils.exception( new ZKException("Encountered zookeeper connection issue on creating log " + logName, KeeperException.Code.CONNECTIONLOSS)); } catch (InterruptedException e) { Thread.currentThread().interrupt(); return FutureUtils.exception(new DLInterruptedException("Interrupted on creating log " + logName, e)); } } ZKLogStreamMetadataStore(String clientId,
                                    DistributedLogConfiguration conf,
                                    ZooKeeperClient zkc,
                                    OrderedScheduler scheduler,
                                    StatsLogger statsLogger); @Override void close(); @Override LogSegmentMetadataStore getLogSegmentMetadataStore(); @Override PermitManager getPermitManager(); @Override Transaction<Object> newTransaction(); @Override CompletableFuture<Void> logExists(URI uri, final String logName); @Override DistributedLock createWriteLock(LogMetadataForWriter metadata); @Override CompletableFuture<DistributedLock> createReadLock(final LogMetadataForReader metadata,
                                                  Optional<String> readerId); @Override CompletableFuture<LogMetadataForWriter> getLog(final URI uri,
                                               final String logName,
                                               final boolean ownAllocator,
                                               final boolean createIfNotExists); @Override CompletableFuture<Void> deleteLog(URI uri, final String logName); @Override CompletableFuture<Void> renameLog(URI uri, String oldStreamName, String newStreamName);  }### Answer:
@Test(timeout = 60000, expected = LogNotFoundException.class) public void testCreateLogMetadataWithCreateIfNotExistsSetToFalse() throws Exception { String logName = testName.getMethodName(); String logIdentifier = "<default>"; Utils.ioResult(getLog(uri, logName, logIdentifier, zkc, true, false)); }