Map<String, String> restrictions = Maps.newHashMap();
assertEquals(1,
countHits(new DocumentHitIterator.ElementMatcher(
apiView, ElementType.ATTACHMENT, Collections.<String, String>emptyMap(), -1)));
Restriction restriction = Attachment.restrictByAttachmentId("nR_0YFT75");
assertEquals(1,
countHits(new DocumentHitIterator.ElementMatcher(apiView, ElementType.ATTACHMENT,
ImmutableMap.of(restriction.getKey(), restriction.getValue()), -1)));
restriction = Attachment.restrictByAttachmentId("nR_0YFT76");
assertEquals(0,
countHits(new DocumentHitIterator.ElementMatcher(apiView, ElementType.ATTACHMENT,
ImmutableMap.of(restriction.getKey(), restriction.getValue()), -1)));
}