Skip to content

Commit

Permalink
Use toList()
Browse files Browse the repository at this point in the history
  • Loading branch information
dwalluck committed Nov 20, 2024
1 parent 0f93d36 commit aefc631
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -118,7 +118,7 @@ void testMapping() throws IOException {
List<String> excludes = bc.getExcludes()
.stream()
.map(Pattern::pattern)
.collect(Collectors.toUnmodifiableList());
.toList();

assertThat(excludes).containsExactly(Pattern.compile("^(?!.*/pom\\.xml$).*/.*\\.xml$").pattern());
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,7 @@ void testType(@TempDir File folder) throws IOException {
@Test
void testCacheClearance(@TempDir File folder) throws IOException {
try (Stream<Path> stream = Files.walk(folder.toPath())) {
Collection<Path> ls = stream.collect(Collectors.toUnmodifiableList());
Collection<Path> ls = stream.toList();
assertThat(ls).hasSize(1);
}

Expand All @@ -115,7 +115,7 @@ void testCacheClearance(@TempDir File folder) throws IOException {
da.checksumFiles();

try (Stream<Path> stream = Files.walk(folder.toPath())) {
Collection<Path> files = stream.collect(Collectors.toUnmodifiableList());
Collection<Path> files = stream.toList();
assertThat(files).hasSize(1);
}
}
Expand Down

0 comments on commit aefc631

Please sign in to comment.