LocalDate[] dates = {LocalDate.of(2010,1,1), LocalDate.of(2011,1,1)};
double[] values = {1.0, 2.0};
LocalDateDoubleTimeSeries dataPoints = ImmutableLocalDateDoubleTimeSeries.of(dates, values);
HistoricalTimeSeriesMaster htsMaster = buildHistoricalTimeSeriesMaster(dataPoints);
// Write the new data points to an existing hts
TimeSeriesWriter writer = new MasterTimeSeriesWriter(htsMaster);
writer.writeDataPoints(NEW_HTSINFO_EXTERNALID, DATA_SOURCE, DATA_PROVIDER, DATA_FIELD, OBSERVATION_TIME,
dataPoints);
// Retrieve and check the hts master contents
HistoricalTimeSeriesInfoSearchRequest request = new HistoricalTimeSeriesInfoSearchRequest();
request.setExternalIdSearch(new ExternalIdSearch(NEW_HTSINFO_EXTERNALID));