private static void updateFeedItems(AdWordsServices adWordsServices, AdWordsSession session,
Long feedId, FeedAttribute line1Attribute, FeedAttribute line2Attribute,
Map<Long, String[]> feedItemDescriptions) throws Exception {
FeedItemServiceInterface feedItemService =
adWordsServices.get(session, FeedItemServiceInterface.class);
Selector itemSelector = new Selector();
itemSelector.setFields(new String[] {"FeedId", "FeedItemId", "AttributeValues"});
List<String> feedItemIds = Lists.newArrayList(
Iterables.transform(feedItemDescriptions.keySet(), Functions.toStringFunction()));
itemSelector.setPredicates(new Predicate[] {
// Limit FeedItems to the feed.
new Predicate("FeedId", PredicateOperator.EQUALS, new String[] {feedId.toString()}),
// Limit FeedItems to the items in the feedItemDescriptions map.
new Predicate("FeedItemId", PredicateOperator.IN, feedItemIds.toArray(new String[0]))});