private void printQueries(
      final List<RunningQuery> queries,
      final String type,
      final String operation
  ) {
    if (!queries.isEmpty()) {
      writer().println(String.format(
          "%n%-20s%n%-20s",
          "Queries that " + operation + " from this " + type,
          "-----------------------------------"
      ));
      for (final RunningQuery writeQuery : queries) {
        writer().println(writeQuery.getId()
            + " (" + writeQuery.getState().orElse("N/A")
            + ") : " + writeQuery.getQuerySingleLine());
      }
      writer().println("\nFor query topology and execution plan please run: EXPLAIN <QueryId>");
    }
  }
@Test
  public void testPrintQueries() {
    // Given:
    final List<RunningQuery> queries = new ArrayList<>();
    queries.add(
        new RunningQuery(
            "select * from t1 emit changes", Collections.singleton("Test"), Collections.singleton("Test topic"), new QueryId("0"), queryStatusCount, KsqlConstants.KsqlQueryType.PUSH));

    final KsqlEntityList entityList = new KsqlEntityList(ImmutableList.of(
        new Queries("e", queries)
    ));

    // When:
    console.printKsqlEntityList(entityList);

    // Then:
    final String output = terminal.getOutputString();
    Approvals.verify(output, approvalOptions);
  }