@Test
    public void shouldAddLinksAndElements() {
      final FeedPagingProcessor target = feedPagingProcessor();
      final AdapterResponse<Feed> feedResponse = adapterResponse(TOTAL_FEED_ENTRIES);
      final RequestContext rc = requestContext();

      target.process(rc, feedResponse);

      Feed feed = feedResponse.getBody().getAsFeed();
      assertThat("Should set updated element", feed.getUpdated(), notNullValue());
    }
  private void addAtomManagedDatastream(Feed feed, String contentLocation) throws Exception {
    String dsId = "DS";

    Entry dsEntry = feed.addEntry();
    dsEntry.setId(feed.getId().toString() + "/" + dsId);

    Entry dsvEntry = feed.addEntry();
    dsvEntry.setId(dsEntry.getId().toString() + "/" + feed.getUpdatedString());

    dsEntry.setTitle(feed.getTitle());
    dsEntry.setUpdated(feed.getUpdated());
    dsEntry.addLink(dsvEntry.getId().toString(), Link.REL_ALTERNATE);
    dsEntry.addCategory(MODEL.STATE.uri, "A", null);
    dsEntry.addCategory(MODEL.CONTROL_GROUP.uri, "M", null);
    dsEntry.addCategory(MODEL.VERSIONABLE.uri, "true", null);

    dsvEntry.setTitle(feed.getTitle());
    dsvEntry.setUpdated(feed.getUpdated());
    ThreadHelper.addInReplyTo(dsvEntry, dsEntry.getId());
    dsvEntry.setSummary("summary");
    dsvEntry.setContent(new IRI(contentLocation), "text/plain");
  }