chore: use Collections.emptyList() instead of new ArrayList()

This commit is contained in:
Arnaud Roques 2024-02-24 12:03:21 +01:00
parent 3cc68235dd
commit f385bc0dba
3 changed files with 6 additions and 4 deletions

View File

@ -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<TValue> empty = new ArrayList<>();
final List<TValue> empty = Collections.emptyList();
final TValue tValue = cut.executeReturnFunction(null, null, null, empty, null);
assertThat(tValue.toString()).contains("archimate", "aws", "tupadr3");
}

View File

@ -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<TValue> empty = new ArrayList<>();
final List<TValue> empty = Collections.emptyList();
final TValue tValue = cut.executeReturnFunction(null, null, null, empty, null);
assertThat(tValue.toString()).contains("_none_", "amiga", "vibrant");
}

View File

@ -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<TValue> empty = new ArrayList<>();
final List<TValue> empty = Collections.emptyList();
final TValue tValue = cut.executeReturnFunction(null, null, null, empty, null);
assertThat(tValue.toInt()).isIn(0, 1);
}