### Question:
LicenseInfoParser { public <T> boolean isApplicableTo(Attachment attachmentContent, User user, T context) throws TException { List<String> applicableFileExtensions = getApplicableFileExtensions(); if(applicableFileExtensions.size() == 0){ return true; } String lowerFileName = attachmentContent.getFilename().toLowerCase(); return applicableFileExtensions.stream() .anyMatch(extension -> lowerFileName.endsWith(extension.toLowerCase())); } protected  LicenseInfoParser(AttachmentConnector attachmentConnector, AttachmentContentProvider attachmentContentProvider); abstract List<String> getApplicableFileExtensions(); boolean isApplicableTo(Attachment attachmentContent, User user, T context); abstract List<LicenseInfoParsingResult> getLicenseInfos(Attachment attachment, User user, T context); ObligationParsingResult getObligations(Attachment attachment, User user, T context);  }### Answer:
@Test public void testIsApplicableTo() throws Exception { LicenseInfoParser parser = new LicenseInfoParser(null, null) { @Override public List<String> getApplicableFileExtensions() { return Arrays.asList(".ext1", ".ext2"); } @Override public <T> List<LicenseInfoParsingResult> getLicenseInfos(Attachment attachment, User user, T context) throws TException { return null; } }; Arrays.stream(AttachmentType.values()).filter(SW360Constants.LICENSE_INFO_ATTACHMENT_TYPES::contains) .forEach(attachmentType -> parser.getApplicableFileExtensions().stream().forEach(extension -> { String filename = "filename" + extension; Attachment attachment = makeAttachment(filename, attachmentType); try { assertThat( parser.isApplicableTo(attachment, dummyUser, new Project().setVisbility(Visibility.ME_AND_MODERATORS).setCreatedBy(dummyUser.getEmail()) .setAttachments(Collections.singleton( new Attachment().setAttachmentContentId(attachment.getAttachmentContentId())))), is(true)); } catch (TException e) { e.printStackTrace(); } })); }