Why is InternalCardinality a final class?

I’m wondering if there’s a good reason why the InternalCardinality class in the Elasticsearch java client is final, as it makes it hard to mock it for testing purposes. Especially since many of the other internal aggregations are not final classes (for example, https://github.com/elastic/elasticsearch/blob/master/core/src/main/java/org/elasticsearch/search/aggregations/metrics/valuecount/InternalValueCount.java).

it is not intended to be subclassed and most of the other Internal* classes might be marked final in the future.

Alright, thanks for letting me know!

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.