### Question:
RootRangeStoreImpl implements RootRangeStore { @Override public CompletableFuture<CreateStreamResponse> createStream(CreateStreamRequest request) { String streamName = request.getName(); String nsName = request.getNsName(); StatusCode code = verifyStreamRequest(nsName, streamName); if (StatusCode.SUCCESS != code) { return FutureUtils.value(CreateStreamResponse.newBuilder().setCode(code).build()); } return createStream(nsName, streamName, request.getStreamConf()); } RootRangeStoreImpl(MVCCAsyncStore<byte[], byte[]> store,
                              StorageContainerPlacementPolicy placementPolicy,
                              ScheduledExecutorService executor); @Override CompletableFuture<CreateNamespaceResponse> createNamespace(CreateNamespaceRequest request); @Override CompletableFuture<DeleteNamespaceResponse> deleteNamespace(DeleteNamespaceRequest request); @Override CompletableFuture<GetNamespaceResponse> getNamespace(GetNamespaceRequest request); @Override CompletableFuture<CreateStreamResponse> createStream(CreateStreamRequest request); @Override CompletableFuture<DeleteStreamResponse> deleteStream(DeleteStreamRequest request); @Override CompletableFuture<GetStreamResponse> getStream(GetStreamRequest request);  }### Answer:
@Test public void testCreateStreamInvalidName() throws Exception { String nsName = name.getMethodName(); String streamName = ""; CompletableFuture<CreateStreamResponse> createFuture = rootRangeStore.createStream( createCreateStreamRequest(nsName, streamName, streamConf)); CreateStreamResponse response = FutureUtils.result(createFuture); assertEquals(StatusCode.INVALID_STREAM_NAME, response.getCode()); }
@Test public void testCreateStreamNamespaceNotFound() throws Exception { String nsName = name.getMethodName(); String streamName = name.getMethodName(); CompletableFuture<CreateStreamResponse> createFuture = rootRangeStore.createStream( createCreateStreamRequest(nsName, streamName, streamConf)); CreateStreamResponse response = FutureUtils.result(createFuture); assertEquals(StatusCode.NAMESPACE_NOT_FOUND, response.getCode()); }
@Test public void testCreateStreamExists() throws Exception { String nsName = name.getMethodName(); String streamName = name.getMethodName(); CreateNamespaceResponse createResp = createNamespaceAndVerify(nsName, 0L); createStreamAndVerify(nsName, streamName, MIN_DATA_STREAM_ID); verifyStreamExists( createResp.getNsProps().getNamespaceId(), streamName, MIN_DATA_STREAM_ID); verifyStreamId(MIN_DATA_STREAM_ID); CreateStreamResponse response2 = FutureUtils.result( rootRangeStore.createStream( createCreateStreamRequest(nsName, streamName, streamConf))); assertEquals(StatusCode.INTERNAL_SERVER_ERROR, response2.getCode()); verifyStreamId(MIN_DATA_STREAM_ID); }