### Question:
SW360Constants { public static Collection<AttachmentType> allowedAttachmentTypes(String documentType) { Set<AttachmentType> types = newHashSet(AttachmentType.values()); if (TYPE_COMPONENT.equals(documentType)) { return Sets.filter(types, not(equalTo(AttachmentType.CLEARING_REPORT))); } else { return types; } } private  SW360Constants(); static Collection<AttachmentType> allowedAttachmentTypes(String documentType); static final String KEY_ID; static final String KEY_REV; static final String PROJECT_VULNERABILITY_RATING_ID_PREFIX; static final String LICENSE_TYPE_GLOBAL; static final String LICENSE_TYPE_OTHERS; static final String NA; static final String LICENSE_NAME_UNKNOWN; static final String OBLIGATION_TOPIC_UNKNOWN; static final String TYPE_OBLIGATION; static final String TYPE_OBLIGATIONS; static final String TYPE_RISKCATEGORY; static final String TYPE_RISK; static final String TYPE_LICENSETYPE; static final String TYPE_LICENSE; static final String TYPE_VENDOR; static final String TYPE_USER; static final String TYPE_COMPONENT; static final String TYPE_RELEASE; static final String TYPE_ATTACHMENT; static final String TYPE_PROJECT; static final String TYPE_PROJECT_OBLIGATION; static final String TYPE_MODERATION; static final String TYPE_CLEARING; static final Map<String, String> MAP_FULLTEXT_SEARCH_NAME; static final Collection<AttachmentType> LICENSE_INFO_ATTACHMENT_TYPES; static final Collection<AttachmentType> SOURCE_CODE_ATTACHMENT_TYPES; static final String CONTENT_TYPE_OPENXML_SPREADSHEET; static final String NOTIFICATION_CLASS_RELEASE; static final String NOTIFICATION_CLASS_MODERATION_REQUEST; static final String NOTIFICATION_CLASS_CLEARING_REQUEST; static final String NOTIFICATION_CLASS_COMPONENT; static final String NOTIFICATION_CLASS_PROJECT; static final Map<String, List<Map.Entry<String, String>>> NOTIFIABLE_ROLES_BY_OBJECT_TYPE; static final List<String> NOTIFICATION_EVENTS_KEYS; }### Answer:
@Test public void testProjectsCanHaveAllAttachmentTypes() throws Exception { Collection<AttachmentType> types = SW360Constants.allowedAttachmentTypes(SW360Constants.TYPE_PROJECT); assertThat(types, containsInAnyOrder(AttachmentType.values())); }
@Test public void testComponentsCanNotHaveReports() throws Exception { Collection<AttachmentType> types = SW360Constants.allowedAttachmentTypes(SW360Constants.TYPE_COMPONENT); for (AttachmentType attachmentType : AttachmentType.values()) { if (attachmentType == AttachmentType.CLEARING_REPORT) { assertThat(types, not(hasItem(equalTo(attachmentType)))); } else { assertThat(types, hasItem(equalTo(attachmentType))); } } }