class KafkaOperations implements AutoCloseable {

    public List<ConsumerGroupIdentifier> listConsumers() {
        // Make request
        final ListConsumerGroupsResult results = adminClient.listConsumerGroups();

        // Generate return list.
        final List<ConsumerGroupIdentifier> consumerIds = new ArrayList<>();

        try {
            // Iterate over results
            results
                .all()
                .get()
                .forEach((result) ->  {
                    consumerIds.add(
                        new ConsumerGroupIdentifier(result.groupId(), result.isSimpleConsumerGroup())
                    );
                });

            // Sort them by consumer Id.
            consumerIds.sort(Comparator.comparing(ConsumerGroupIdentifier::getId));

            // return immutable list.
            return Collections.unmodifiableList(consumerIds);
        } catch (final ExecutionException e) {
            throw handleExecutionException(e);
        } catch (final InterruptedException e) {
            throw new RuntimeException(e.getMessage(), e);
        }
    }

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

}