}
@Test
public void testSearchAddress() throws Exception {
SearchQuery query = new SearchQuery();
query.andCriteria(SearchQuery.address(AddressType.To,FROM_ADDRESS));
Iterator<Long> result = index.search(null, mailbox3, query);
assertEquals(10L, result.next().longValue());
assertFalse(result.hasNext());
query = new SearchQuery();
query.andCriteria(SearchQuery.address(AddressType.To,"Harry"));
result = index.search(null, mailbox3, query);
assertEquals(10L, result.next().longValue());
assertFalse(result.hasNext());
query = new SearchQuery();
query.andCriteria(SearchQuery.address(AddressType.To,"Harry@example.org"));
result = index.search(null, mailbox3, query);
assertEquals(10L, result.next().longValue());
assertFalse(result.hasNext());
}