### Question:
KsqlResource { private KsqlTopicsList listRegisteredTopics(String statementText) { return KsqlTopicsList.build(statementText, getKsqlTopics()); } KsqlResource(
      KsqlEngine ksqlEngine,
      CommandStore commandStore,
      StatementExecutor statementExecutor,
      long distributedCommandResponseTimeout
  ); @POST Response handleKsqlStatements(KsqlRequest request); List<String> getStatementStrings(String ksqlString); KsqlEngine getKsqlEngine();  }### Answer:
@Test public void testListRegisteredTopics() throws Exception { KsqlResource testResource = TestKsqlResourceUtil.get(ksqlEngine); final String ksqlString = "LIST REGISTERED TOPICS;"; final ListRegisteredTopics ksqlStatement = new ListRegisteredTopics(Optional.empty()); KsqlTopicsList ksqlTopicsList = makeSingleRequest( testResource, ksqlString, Collections.emptyMap(), KsqlTopicsList.class ); Collection<KsqlTopicInfo> testTopics = ksqlTopicsList.getTopics(); Collection<KsqlTopicInfo> expectedTopics = testResource.getKsqlEngine().getMetaStore() .getAllKsqlTopics().values().stream() .map(KsqlTopicInfo::new) .collect(Collectors.toList()); assertEquals(expectedTopics.size(), testTopics.size()); for (KsqlTopicInfo testTopic : testTopics) { assertTrue(expectedTopics.contains(testTopic)); } for (KsqlTopicInfo expectedTopic : expectedTopics) { assertTrue(testTopics.contains(expectedTopic)); } }