From f385bc0dbaff0b8e28c05c8709f6f7c943ee67ec Mon Sep 17 00:00:00 2001 From: Arnaud Roques Date: Sat, 24 Feb 2024 12:03:21 +0100 Subject: [PATCH] chore: use Collections.emptyList() instead of new ArrayList() --- .../net/sourceforge/plantuml/tim/stdlib/GetAllStdlibTest.java | 4 ++-- test/net/sourceforge/plantuml/tim/stdlib/GetAllThemeTest.java | 3 ++- .../sourceforge/plantuml/tim/stdlib/RandomFuntionTest.java | 3 ++- 3 files changed, 6 insertions(+), 4 deletions(-) diff --git a/test/net/sourceforge/plantuml/tim/stdlib/GetAllStdlibTest.java b/test/net/sourceforge/plantuml/tim/stdlib/GetAllStdlibTest.java index e22ebbc20..ab8c23fd3 100644 --- a/test/net/sourceforge/plantuml/tim/stdlib/GetAllStdlibTest.java +++ b/test/net/sourceforge/plantuml/tim/stdlib/GetAllStdlibTest.java @@ -2,8 +2,8 @@ package net.sourceforge.plantuml.tim.stdlib; import static org.assertj.core.api.Assertions.assertThat; -import java.util.ArrayList; import java.util.Arrays; +import java.util.Collections; import java.util.List; import org.junit.jupiter.api.DisplayNameGenerator.ReplaceUnderscores; @@ -25,7 +25,7 @@ class GetAllStdlibTest { @Test void Test_without_Param() throws EaterException { - final List empty = new ArrayList<>(); + final List empty = Collections.emptyList(); final TValue tValue = cut.executeReturnFunction(null, null, null, empty, null); assertThat(tValue.toString()).contains("archimate", "aws", "tupadr3"); } diff --git a/test/net/sourceforge/plantuml/tim/stdlib/GetAllThemeTest.java b/test/net/sourceforge/plantuml/tim/stdlib/GetAllThemeTest.java index 0c6d65ae8..1f79076b4 100644 --- a/test/net/sourceforge/plantuml/tim/stdlib/GetAllThemeTest.java +++ b/test/net/sourceforge/plantuml/tim/stdlib/GetAllThemeTest.java @@ -3,6 +3,7 @@ package net.sourceforge.plantuml.tim.stdlib; import static org.assertj.core.api.Assertions.assertThat; import java.util.ArrayList; +import java.util.Collections; import java.util.List; import org.junit.jupiter.api.DisplayNameGenerator.ReplaceUnderscores; @@ -24,7 +25,7 @@ class GetAllThemeTest { @Test void Test_without_Param() throws EaterException { - final List empty = new ArrayList<>(); + final List empty = Collections.emptyList(); final TValue tValue = cut.executeReturnFunction(null, null, null, empty, null); assertThat(tValue.toString()).contains("_none_", "amiga", "vibrant"); } diff --git a/test/net/sourceforge/plantuml/tim/stdlib/RandomFuntionTest.java b/test/net/sourceforge/plantuml/tim/stdlib/RandomFuntionTest.java index f7b61cfdf..fd8033793 100644 --- a/test/net/sourceforge/plantuml/tim/stdlib/RandomFuntionTest.java +++ b/test/net/sourceforge/plantuml/tim/stdlib/RandomFuntionTest.java @@ -4,6 +4,7 @@ import static org.assertj.core.api.Assertions.assertThat; import java.util.ArrayList; import java.util.Arrays; +import java.util.Collections; import java.util.List; import org.junit.jupiter.api.DisplayNameGenerator.ReplaceUnderscores; @@ -26,7 +27,7 @@ class RandomFunctionTest { @RepeatedTest(value = 10, name = repetitionLabel + cutName + "()") void test_with_no_argument() throws EaterException { - final List empty = new ArrayList<>(); + final List empty = Collections.emptyList(); final TValue tValue = cut.executeReturnFunction(null, null, null, empty, null); assertThat(tValue.toInt()).isIn(0, 1); }