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));