### Question:
Console implements Closeable { public void printKsqlEntityList(List<KsqlEntity> entityList) throws IOException { switch (outputFormat) { case JSON: printAsJson(entityList); break; case TABULAR: for (KsqlEntity ksqlEntity : entityList) { writer().println(); printAsTable(ksqlEntity); } break; default: throw new RuntimeException(String.format( "Unexpected output format: '%s'", outputFormat.name() )); } } Console(OutputFormat outputFormat, KsqlRestClient restClient); abstract PrintWriter writer(); abstract void flush(); abstract int getWidth(); abstract Terminal.SignalHandler handle(
      Terminal.Signal signal,
      Terminal.SignalHandler signalHandler
  ); void addResult(GenericRow row); void addResult(List<String> columnHeaders, List<List<String>> rowValues); LinkedHashMap<String, CliSpecificCommand> getCliSpecificCommands(); LineReader getLineReader(); void printErrorMessage(KsqlErrorMessage errorMessage); void printError(String shortMsg, String fullMsg); void printStreamedRow(StreamedRow row); void printKsqlEntityList(List<KsqlEntity> entityList); void registerCliSpecificCommand(CliSpecificCommand cliSpecificCommand); void setOutputFormat(String newFormat);  }### Answer:
@Test public void testPrintKSqlEntityList() throws IOException { Map<String, Object> properties = new HashMap<>(); properties.put("k1", 1); properties.put("k2", "v2"); properties.put("k3", true); List<Queries.RunningQuery> queries = new ArrayList<>(); queries.add(new Queries.RunningQuery("select * from t1", "TestTopic", new QueryId("0"))); for (int i = 0; i < 5; i++) { KsqlEntityList entityList = new KsqlEntityList(Arrays.asList( new CommandStatusEntity("e", "topic/1/create", "SUCCESS", "Success Message"), new PropertiesList("e", properties), new Queries("e", queries), new SourceDescription( "e", "TestSource", Collections.EMPTY_LIST, Collections.EMPTY_LIST, buildTestSchema(i), DataSource.DataSourceType.KTABLE.getKqlType(), "key", "2000-01-01", "stats", "errors", false, "avro", "kadka-topic", "topology", "executionPlan", 1, 1, Collections.emptyMap()), new TopicDescription("e", "TestTopic", "TestKafkaTopic", "AVRO", "schemaString"), new StreamsList("e", Arrays.asList(new SourceInfo.Stream("TestStream", "TestTopic", "AVRO"))), new TablesList("e", Arrays.asList(new SourceInfo.Table("TestTable", "TestTopic", "JSON", false))), new KsqlTopicsList("e", Arrays.asList(new KsqlTopicInfo("TestTopic", "TestKafkaTopic", DataSource.DataSourceSerDe.JSON))), new KafkaTopicsList("e", Arrays.asList(new KafkaTopicInfo("TestKafkaTopic", true, ImmutableList.of(1), 1, 1))), new ExecutionPlan("Test Execution Plan") )); terminal.printKsqlEntityList(entityList); } }