/** * Checks if the FeedItems of this feed have images that point to the same URL. If two FeedItems * have an image that points to the same URL, the reference of the second item is removed, so * that every image reference is unique. */ private void removeDuplicateImages(Feed feed) { for (int x = 0; x < feed.getItems().size(); x++) { for (int y = x + 1; y < feed.getItems().size(); y++) { FeedItem item1 = feed.getItems().get(x); FeedItem item2 = feed.getItems().get(y); if (item1.hasItemImage() && item2.hasItemImage()) { if (StringUtils.equals( item1.getImage().getDownload_url(), item2.getImage().getDownload_url())) { item2.setImage(null); } } } } }