From c62e96c1586baff4fcb6ffb71c2166686c6dbb68 Mon Sep 17 00:00:00 2001 From: Pierre Date: Fri, 7 Jul 2023 08:49:05 +0200 Subject: NO-JIRA replace Collectors.toList to Stream.toList --- .../java/org/sonar/duplications/java/JavaStatementBuilderTest.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'sonar-duplications/src') diff --git a/sonar-duplications/src/test/java/org/sonar/duplications/java/JavaStatementBuilderTest.java b/sonar-duplications/src/test/java/org/sonar/duplications/java/JavaStatementBuilderTest.java index 5c5b5c8e677..dde059269ed 100644 --- a/sonar-duplications/src/test/java/org/sonar/duplications/java/JavaStatementBuilderTest.java +++ b/sonar-duplications/src/test/java/org/sonar/duplications/java/JavaStatementBuilderTest.java @@ -323,9 +323,9 @@ public class JavaStatementBuilderTest { @Test public void shouldHandleLambda() { List statements; - statements = chunk("List result = lines.stream().filter(line -> !\"mkyong\".equals(line)).collect(Collectors.toList());"); + statements = chunk("List result = lines.stream().filter(line -> !\"mkyong\".equals(line)).toList();"); assertThat(statements.size()).isOne(); - assertThat(statements).extracting(Statement::getValue).containsExactly("Listresult=lines.stream().filter(line->!$CHARS.equals(line)).collect(Collectors.toList())"); + assertThat(statements).extracting(Statement::getValue).containsExactly("Listresult=lines.stream().filter(line->!$CHARS.equals(line)).toList()"); statements = chunk("items.forEach((k,v)->{System.out.println(\"Item : \" + k + \" Count : \" + v); if(\"E\".equals(k)) { System.out.println(\"Hello E\");}});"); assertThat(statements).hasSize(5); -- cgit v1.2.3