From fae43cfec3b0d9e70cb02ef2d73fa7e05653d4b6 Mon Sep 17 00:00:00 2001 From: "David P. Baker" Date: Wed, 3 Apr 2024 10:58:10 -0400 Subject: [PATCH] Create singleton `ImmutableSortedSet`s directly instead of using `Lists.partition`. (#169) --- .../java/org/jspecify/conformance/ConformanceTestRunner.java | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/conformance-test-framework/src/main/java/org/jspecify/conformance/ConformanceTestRunner.java b/conformance-test-framework/src/main/java/org/jspecify/conformance/ConformanceTestRunner.java index 1d980f6..ca47664 100644 --- a/conformance-test-framework/src/main/java/org/jspecify/conformance/ConformanceTestRunner.java +++ b/conformance-test-framework/src/main/java/org/jspecify/conformance/ConformanceTestRunner.java @@ -16,7 +16,6 @@ import static com.google.common.base.Strings.nullToEmpty; import static com.google.common.collect.ImmutableSortedSet.toImmutableSortedSet; -import static com.google.common.collect.Lists.partition; import static com.google.common.io.MoreFiles.asCharSink; import static com.google.common.io.MoreFiles.asCharSource; import static com.google.common.truth.Truth.assertThat; @@ -76,10 +75,9 @@ public ConformanceTestReport runTests(Path testDirectory, ImmutableList te directory -> { Stream> groups = javaFileGroups(directory); return directory.equals(testDirectory) - ? groups.flatMap(files -> partition(files.asList(), 1).stream()) + ? groups.flatMap(files -> files.stream().map(ImmutableSortedSet::of)) : groups; }) - .map(ImmutableSortedSet::copyOf) .forEach( files -> report.addFiles(files, analyzer.analyze(testDirectory, files, testDeps))); return report.build();