### Question:
BufferStreamApi extends BaseStreamApi implements NeovimBufferApi { @Override public CompletableFuture<Boolean> isValid() { return sendWithResponseOfType(prepareMessage(IS_VALID), Boolean.class); } BufferStreamApi(ReactiveRpcStreamer reactiveRpcStreamer,
                           Buffer model); @Override Buffer get(); @Override CompletableFuture<Integer> getLineCount(); @Override CompletableFuture<List<String>> getLines(int start, int end, boolean strictIndexing); @Override CompletableFuture<Void> setLines(int start, int end, boolean strictIndexing, List<String> replacement); @Override CompletableFuture<Integer> getOffset(int index); @Override CompletableFuture<Object> getVar(String name); @Override CompletableFuture<Void> deleteVar(String name); @Override CompletableFuture<Void> setVar(String name, Object value); @Override CompletableFuture<Object> getOption(String name); @Override CompletableFuture<Void> setOption(String name, Object value); @Override CompletableFuture<Integer> getNumber(); @Override CompletableFuture<String> getName(); @Override CompletableFuture<Void> setName(String name); @Override CompletableFuture<Boolean> isLoaded(); @Override CompletableFuture<Boolean> isValid(); @Override CompletableFuture<VimCoords> getMark(String name); @Override CompletableFuture<Object> getChangedTick(); @Override CompletableFuture<List<VimKeyMap>> getKeymap(String mode); @Override CompletableFuture<Void> setKeymap(String mode, String lhs, String rhs, Map<String, Boolean> options); @Override CompletableFuture<Void> deleteKeymap(String mode, String lhs); @Override CompletableFuture<Integer> addHighlight(int srcId, String hlGroup, int line, int colStart, int colEnd); @Override CompletableFuture<Void> clearHighlight(int srcId, int lineStart, int lineEnd); @Override CompletableFuture<Void> clearNamespace(int namespaceId, int lineStart, int lineEnd); @Override CompletableFuture<Integer> setVirtualText(int namespaceId, int line, List<HighlightedText> chunks, Map optionalParams); @Override CompletableFuture<Boolean> attach(boolean loadFullBufferOnStart, Map opts); @Override CompletableFuture<Boolean> detach(); @Override CompletableFuture<Map<String, CommandInfo>> getCommands(GetCommandsOptions commandsOptions); @Override String toString();  }### Answer:
@Test public void isValidTest() throws ExecutionException, InterruptedException { assertNormalBehavior( () -> CompletableFuture.completedFuture(new ResponseMessage(1, null, false)), () -> bufferStreamApi.isValid(), request -> assertMethodAndArguments(request, NeovimBufferApi.IS_VALID, buffer), Assert::assertFalse ); assertErrorBehavior( () -> bufferStreamApi.isValid(), request -> assertMethodAndArguments(request, NeovimBufferApi.IS_VALID, buffer) ); }