void setUpAttachment(Object subject, boolean applies, ExternalAttachmentProvider eap) {
attachments.clear();
attachment = control.createMock(PolicyAttachment.class);
attachments.add(attachment);
policy = new Policy();
assertion = new PrimitiveAssertion(TEST_ASSERTION_TYPE);
policy.addAssertion(assertion);
eap.setAttachments(attachments);
if (subject instanceof ServiceInfo) {
EasyMock.expect(attachment.appliesTo((ServiceInfo)subject)).andReturn(applies);
} else if (subject instanceof EndpointInfo) {