### Question:
SPDXParser extends LicenseInfoParser { public <T> LicenseInfoParsingResult getLicenseInfo(Attachment attachment, User user, T context) throws TException { AttachmentContent attachmentContent = attachmentContentProvider.getAttachmentContent(attachment); final Optional<SpdxDocument> spdxDocument = openAsSpdx(attachmentContent, user, context); if(! spdxDocument.isPresent()){ return new LicenseInfoParsingResult() .setStatus(LicenseInfoRequestStatus.FAILURE); } return getLicenseInfoFromSpdx(attachmentContent, spdxDocument.get()); } SPDXParser(AttachmentConnector attachmentConnector, AttachmentContentProvider attachmentContentProvider); @Override List<String> getApplicableFileExtensions(); @Override List<LicenseInfoParsingResult> getLicenseInfos(Attachment attachment, User user, T context); LicenseInfoParsingResult getLicenseInfo(Attachment attachment, User user, T context);  }### Answer:
@Test @UseDataProvider("dataProviderAdd") public void testGetLicenseInfo(String exampleFile, List<String> expectedLicenses, int numberOfCoyprights, String exampleCopyright, Set<String> exampleConcludedLicenseIds) throws Exception { Attachment attachment = makeAttachment(exampleFile, Arrays.stream(AttachmentType.values()) .filter(SW360Constants.LICENSE_INFO_ATTACHMENT_TYPES::contains) .findAny() .get()); LicenseInfoParsingResult result = parser.getLicenseInfos(attachment, dummyUser, new Project() .setVisbility(Visibility.ME_AND_MODERATORS) .setCreatedBy(dummyUser.getEmail()) .setAttachments(Collections.singleton(new Attachment().setAttachmentContentId(attachment.getAttachmentContentId())))) .stream() .findFirst() .orElseThrow(()->new RuntimeException("Parser returned empty LisenceInfoParsingResult list")); assertLicenseInfoParsingResult(result); assertIsResultOfExample(result.getLicenseInfo(), exampleFile, expectedLicenses, numberOfCoyprights, exampleCopyright, exampleConcludedLicenseIds); }