aboutsummaryrefslogtreecommitdiffstats
path: root/sonar-duplications/src/test
diff options
context:
space:
mode:
authorPierre <pierre.guillot@sonarsource.com>2023-07-07 08:49:05 +0200
committersonartech <sonartech@sonarsource.com>2023-07-17 20:03:45 +0000
commitc62e96c1586baff4fcb6ffb71c2166686c6dbb68 (patch)
tree80c2e1c3e754d179833ebaad2db2c1cefb94db5c /sonar-duplications/src/test
parent470a55b6ae21f203d5f0fa27e4b7d114d3922902 (diff)
downloadsonarqube-c62e96c1586baff4fcb6ffb71c2166686c6dbb68.tar.gz
sonarqube-c62e96c1586baff4fcb6ffb71c2166686c6dbb68.zip
NO-JIRA replace Collectors.toList to Stream.toList
Diffstat (limited to 'sonar-duplications/src/test')
-rw-r--r--sonar-duplications/src/test/java/org/sonar/duplications/java/JavaStatementBuilderTest.java4
1 files changed, 2 insertions, 2 deletions
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<Statement> statements;
- statements = chunk("List<String> result = lines.stream().filter(line -> !\"mkyong\".equals(line)).collect(Collectors.toList());");
+ statements = chunk("List<String> result = lines.stream().filter(line -> !\"mkyong\".equals(line)).toList();");
assertThat(statements.size()).isOne();
- assertThat(statements).extracting(Statement::getValue).containsExactly("List<String>result=lines.stream().filter(line->!$CHARS.equals(line)).collect(Collectors.toList())");
+ assertThat(statements).extracting(Statement::getValue).containsExactly("List<String>result=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);