TimeSeriesWriter writer = new MasterTimeSeriesWriter(htsMaster);
writer.writeDataPoints(EXISTING_HTSINFO_EXTERNALID, DATA_SOURCE, DATA_PROVIDER, DATA_FIELD, OBSERVATION_TIME,
newDataPoints);
// Retrieve the hts contents from the master
HistoricalTimeSeriesInfoSearchRequest request = new HistoricalTimeSeriesInfoSearchRequest();
request.setExternalIdSearch(new ExternalIdSearch(EXISTING_HTSINFO_EXTERNALID));
HistoricalTimeSeriesInfoSearchResult result = htsMaster.search(request);
LocalDateDoubleTimeSeries retrievedDataPoints = null;
if (result != null && result.getFirstInfo() != null) {
retrievedDataPoints = htsMaster.getTimeSeries(
htsMaster.get(result.getFirstInfo().getUniqueId()).getInfo().getTimeSeriesObjectId().atLatestVersion()).getTimeSeries();