final Set<TaskDto> results = new HashSet<TaskDto>();
// Take a look at http://blogs.planetsoftware.com.au/paul/archive/2010/05/20/exchange-web-services-ews-managed-api-ndash-part-2.aspx
final SearchFilterCollection searchFilterCollection = new SearchFilterCollection(LogicalOperator.Or);
searchFilterCollection.add(new SearchFilter.IsEqualTo(PR_FLAG_STATUS, "1")); // Flagged complete
searchFilterCollection.add(new SearchFilter.IsEqualTo(PR_FLAG_STATUS, "2")); // Flagged
final ItemView itemView = new ItemView(MAX_RESULTS);
itemView.setPropertySet(createEmailPropertySet());
final FindItemsResults<Item> items = getAllItemsFolder().findItems(searchFilterCollection, itemView);
for (final Item email : items.getItems()) {
if (email instanceof EmailMessage) {
results.add(convertToTaskDto((EmailMessage) email));
}