@Test public void testAND() throws Exception { expectsGetSelectedMailbox(); List<SearchKey> keys = new ArrayList<>(); keys.add(SearchKey.buildOn(DAY_MONTH_YEAR)); keys.add(SearchKey.buildOld()); keys.add(SearchKey.buildLarger(SIZE)); List<Criterion> criteria = new ArrayList<>(); criteria.add(SearchQuery.internalDateOn(getDate(DAY, MONTH, YEAR), DateResolution.Day)); criteria.add(SearchQuery.flagIsUnSet(Flag.RECENT)); criteria.add(SearchQuery.sizeGreaterThan(SIZE)); check(SearchKey.buildAnd(keys), SearchQuery.and(criteria)); }
private Criterion and(List<SearchKey> keys, ImapSession session) throws MessageRangeException { final int size = keys.size(); final List<Criterion> criteria = new ArrayList<>(size); for (SearchKey key : keys) { final Criterion criterion = toCriterion(key, session); criteria.add(criterion); } return SearchQuery.and(criteria); }
SearchProcessor extends AbstractMailboxProcessor<SearchRequest> implements CapabilityImplementingProcessor { private Criterion and(List<SearchKey> keys, ImapSession session) throws MessageRangeException { final int size = keys.size(); final List<Criterion> criteria = new ArrayList<>(size); for (SearchKey key : keys) { final Criterion criterion = toCriterion(key, session); criteria.add(criterion); } return SearchQuery.and(criteria); } }
SearchProcessor extends AbstractMailboxProcessor<SearchRequest> implements CapabilityImplementingProcessor { private Criterion and(List<SearchKey> keys, ImapSession session) throws MessageRangeException { final int size = keys.size(); final List<Criterion> criteria = new ArrayList<>(size); for (SearchKey key : keys) { final Criterion criterion = toCriterion(key, session); criteria.add(criterion); } return SearchQuery.and(criteria); } SearchProcessor(ImapProcessor next, MailboxManager mailboxManager, StatusResponseFactory factory,
            MetricFactory metricFactory); }
SearchProcessor extends AbstractMailboxProcessor<SearchRequest> implements CapabilityImplementingProcessor { private Criterion and(List<SearchKey> keys, ImapSession session) throws MessageRangeException { final int size = keys.size(); final List<Criterion> criteria = new ArrayList<>(size); for (SearchKey key : keys) { final Criterion criterion = toCriterion(key, session); criteria.add(criterion); } return SearchQuery.and(criteria); } SearchProcessor(ImapProcessor next, MailboxManager mailboxManager, StatusResponseFactory factory,
            MetricFactory metricFactory); @Override List<Capability> getImplementedCapabilities(ImapSession session); }
SearchProcessor extends AbstractMailboxProcessor<SearchRequest> implements CapabilityImplementingProcessor { private Criterion and(List<SearchKey> keys, ImapSession session) throws MessageRangeException { final int size = keys.size(); final List<Criterion> criteria = new ArrayList<>(size); for (SearchKey key : keys) { final Criterion criterion = toCriterion(key, session); criteria.add(criterion); } return SearchQuery.and(criteria); } SearchProcessor(ImapProcessor next, MailboxManager mailboxManager, StatusResponseFactory factory,
            MetricFactory metricFactory); @Override List<Capability> getImplementedCapabilities(ImapSession session);  }