class SparseLocalDateDoubleTimeSeries implements ImmutableBean, Serializable, LocalDateDoubleTimeSeries {

  @Override
  public LocalDateDoubleTimeSeries headSeries(int numPoints) {
    ArgChecker.notNegative(numPoints, "numPoints");
    if (numPoints == 0) {
      return EMPTY;
    } else if (numPoints >= size()) {
      return this;
    }
    LocalDate[] datesArray = Arrays.copyOfRange(dates, 0, numPoints);
    double[] valuesArray = Arrays.copyOfRange(values, 0, numPoints);
    return createUnsafe(datesArray, valuesArray);
  }

  @ImmutableConstructor private  SparseLocalDateDoubleTimeSeries(LocalDate[] dates, double[] values);
  private  SparseLocalDateDoubleTimeSeries(LocalDate[] dates, double[] values, boolean trusted);

}