class KafkaOperations implements AutoCloseable {

    public TopicList getAvailableTopics() {
        final List<org.sourcelab.kafka.webview.ui.manager.kafka.dto.TopicListing> topicListings = new ArrayList<>();

        try {
            // We want to show all topics, including internal topics.
            final ListTopicsOptions listTopicsOptions = new ListTopicsOptions().listInternal(true);

            final Collection<TopicListing> results = adminClient
                .listTopics(listTopicsOptions)
                .listings()
                .get();

            for (final TopicListing entry: results) {
                topicListings.add(
                    new org.sourcelab.kafka.webview.ui.manager.kafka.dto.TopicListing(entry.name(), entry.isInternal())
                );
            }
            return new TopicList(topicListings);
        } catch (final ExecutionException e) {
            throw handleExecutionException(e);
        } catch (final InterruptedException e) {
            // TODO Handle
            throw new RuntimeException(e.getMessage(), e);
        }
    }

    public  KafkaOperations(final AdminClient adminClient, final KafkaConsumer<String, String> consumerClient);

}