For example, you can have a trait:
~~~
class VectorRDDStatisticalSummary {
  def mean(): Vector
  def variance(): Vector
}
~~~
Set `computeSummaryStatistics`'s return type to this trait. Let aggregator implement this trait but mark it private.