TrafficEstimatorSelector selector = new TrafficEstimatorSelector();
selector.setCampaignEstimateRequests(campaignEstimateRequests
.toArray(new CampaignEstimateRequest[] {}));
// Get traffic estimates.
TrafficEstimatorResult result = trafficEstimatorService.get(selector);
// Display traffic estimates.
if (result != null && result.getCampaignEstimates() != null) {
KeywordEstimate[] keywordEstimates =
result.getCampaignEstimates()[0].getAdGroupEstimates()[0].getKeywordEstimates();
for (int i = 0; i < keywordEstimates.length; i++) {
Keyword keyword = keywordEstimateRequests.get(i).getKeyword();
KeywordEstimate keywordEstimate = keywordEstimates[i];
if (Boolean.TRUE.equals(keywordEstimateRequests.get(i).getIsNegative())) {
continue;