tdunning/t-digest — pull request #34 by jpountz (2014-12-29 17:10:59+00:00)
Title: Remove TDigest.centroidCount() and make centroids() return a Collection instead of an Iterable.

Today we have TDigest.centroids() which returns an iterable and
TDigest.centroidCount() which returns the number of centroids. This is exactly
what a java Collection is: an Iterable whose size is known. So from a usability
perspective I think it'd be more convenient to remove centroidCount() and make
centroids() return a List. This way, TDigest can be used with all methods that
take a Collection but not an Iterable (eg. List.addAll).

The only downside is that now you need to create an object in order to have
access to the number of centroids, but this is something that escape analysis
should easility remove. So I think it's worth exposing this information through
the Collection interface in order to have a nicer API.