class LocalDateDoubleTimeSeriesBuilder {

  public LocalDateDoubleTimeSeries build() {

    if (entries.isEmpty()) {
      return LocalDateDoubleTimeSeries.empty();
    }

    // Depending on how dense the data is, judge which type of time series
    // is the best fit
    return density() > DENSITY_THRESHOLD ?
        createDenseSeries() :
        createSparseSeries();
  }

    LocalDateDoubleTimeSeriesBuilder();
    LocalDateDoubleTimeSeriesBuilder(LocalDate[] dates, double[] values);
    LocalDateDoubleTimeSeriesBuilder(Stream<LocalDateDoublePoint> points);

}