### Question:
KsqlRestClient implements Closeable, AutoCloseable { public RestResponse<QueryStream> makeQueryRequest(String ksql) { KsqlRequest jsonRequest = new KsqlRequest(ksql, localProperties); Response response = makePostRequest("query", jsonRequest); if (response.getStatus() == Response.Status.OK.getStatusCode()) { return RestResponse.successful(new QueryStream(response)); } else { return RestResponse.erroneous(response.readEntity(KsqlErrorMessage.class)); } } KsqlRestClient(final String serverAddress);  KsqlRestClient(final String serverAddress, final Properties properties);  KsqlRestClient(String serverAddress, Map<String, Object> localProperties);   KsqlRestClient(Client client, String serverAddress); void setupAuthenticationCredentials(String userName, String password); boolean hasUserCredentials(); String getServerAddress(); void setServerAddress(String serverAddress); RestResponse<ServerInfo> makeRootRequest(); RestResponse<ServerInfo> getServerInfo(); RestResponse<T> makeRequest(String path, Class<T> type); RestResponse<KsqlEntityList> makeKsqlRequest(String ksql); RestResponse<CommandStatuses> makeStatusRequest(); RestResponse<CommandStatus> makeStatusRequest(String commandId); RestResponse<QueryStream> makeQueryRequest(String ksql); RestResponse<InputStream> makePrintTopicRequest(
      String ksql
  ); @Override void close(); Map<String, Object> getLocalProperties(); Object setProperty(String property, Object value); boolean unsetProperty(String property);  }### Answer:
@Test public void testStreamRowFromServer() throws InterruptedException { MockStreamedQueryResource sqr = mockApplication.getStreamedQueryResource(); RestResponse<KsqlRestClient.QueryStream> queryResponse = ksqlRestClient.makeQueryRequest ("Select *"); Assert.assertNotNull(queryResponse); Assert.assertTrue(queryResponse.isSuccessful()); List<MockStreamedQueryResource.TestStreamWriter> writers = sqr.getWriters(); Assert.assertEquals(1, writers.size()); MockStreamedQueryResource.TestStreamWriter writer = writers.get(0); try { writer.enq("hello"); KsqlRestClient.QueryStream queryStream = queryResponse.getResponse(); Thread t = new Thread(() -> queryStream.hasNext()); t.setDaemon(true); t.start(); t.join(10000); Assert.assertFalse(t.isAlive()); Assert.assertTrue(queryStream.hasNext()); StreamedRow sr = queryStream.next(); Assert.assertNotNull(sr); GenericRow row = sr.getRow(); Assert.assertEquals(1, row.getColumns(). size()); Assert.assertEquals("hello", row.getColumns(). get(0)); } finally { writer.finished(); } }