|
22 | 22 | import java.io.File; |
23 | 23 | import java.io.IOException; |
24 | 24 | import java.io.StringReader; |
25 | | -import java.util.Arrays; |
26 | | -import java.util.Collection; |
27 | | -import java.util.HashMap; |
28 | | -import java.util.HashSet; |
29 | | -import java.util.List; |
30 | | -import java.util.Map; |
31 | | -import java.util.Objects; |
| 25 | +import java.util.*; |
32 | 26 |
|
33 | 27 | import org.spdx.core.DefaultModelStore; |
34 | 28 | import org.spdx.core.IModelCopyManager; |
@@ -777,16 +771,17 @@ public void testMatchingStandardLicenseExceptionIdsWithinText() throws InvalidSP |
777 | 771 | String gpl20WithClasspathException20 = gpl20 + "\n\n" + classpathException20; |
778 | 772 | String textWithRandomPrefixAndSuffix = "Some random preamble text.\n\n" + classpathException20 + "\n\nSome random epilogue text."; |
779 | 773 |
|
780 | | - List<String> expectedResultEmpty = Arrays.asList(); |
781 | | - List<String> expectedResultClasspathException20 = Arrays.asList("Classpath-exception-2.0"); |
| 774 | + List<String> expectedResultEmpty = Collections.emptyList(); |
| 775 | + List<String> classPathException20Only = Collections.singletonList("Classpath-exception-2.0"); |
| 776 | + List<String> expectedResultClasspathException20 = Arrays.asList("Classpath-exception-2.0", "Classpath-exception-2.0-short"); |
782 | 777 |
|
783 | 778 | // Note: be cautious about adding too many assertions to this test, as LicenseCompareHelper.matchingStandardLicenseExceptionIdsWithinText can have lengthy runtimes |
784 | 779 | assertListsEqual(expectedResultEmpty, LicenseCompareHelper.matchingStandardLicenseExceptionIdsWithinText(null)); |
785 | 780 | assertListsEqual(expectedResultEmpty, LicenseCompareHelper.matchingStandardLicenseExceptionIdsWithinText("")); |
786 | 781 | assertListsEqual(expectedResultEmpty, LicenseCompareHelper.matchingStandardLicenseExceptionIdsWithinText("Some random text that isn't a standard license exception")); |
787 | 782 |
|
788 | 783 | // Tests for the 2-arg version of matchingStandardLicenseExceptionIdsWithinText (which is faster than the 1-arg version) |
789 | | - assertListsEqual(expectedResultClasspathException20, LicenseCompareHelper.matchingStandardLicenseExceptionIdsWithinText(gpl20WithClasspathException20, Arrays.asList("Classpath-exception-2.0"))); |
| 784 | + assertListsEqual(classPathException20Only, LicenseCompareHelper.matchingStandardLicenseExceptionIdsWithinText(gpl20WithClasspathException20, classPathException20Only)); |
790 | 785 |
|
791 | 786 | if (UnitTestHelper.runSlowTests()) { |
792 | 787 | assertListsEqual(expectedResultClasspathException20, LicenseCompareHelper.matchingStandardLicenseExceptionIdsWithinText(classpathException20)); |
|
0 commit comments