From 45e22a21d8af8857c87477eb3458fa114a52fe93 Mon Sep 17 00:00:00 2001 From: Looly Date: Tue, 27 Jun 2023 17:13:32 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=94=B9CollUtil.union=E7=AD=89?= =?UTF-8?q?=E6=96=B9=E6=B3=95=E6=B3=9B=E5=9E=8B=EF=BC=8C=E4=BD=BF=E5=85=B6?= =?UTF-8?q?=E6=94=AF=E6=8C=81=E5=A4=9A=E7=A7=8D=E5=AD=90=E7=B1=BBunion?= =?UTF-8?q?=E4=B8=80=E4=B8=AA=E7=88=B6=E7=B1=BB=E9=9B=86=E5=90=88?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../hutool/core/collection/CollUtilTest.java | 20 +++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/hutool-core/src/test/java/org/dromara/hutool/core/collection/CollUtilTest.java b/hutool-core/src/test/java/org/dromara/hutool/core/collection/CollUtilTest.java index 5e0a58bfe..bafe98d16 100644 --- a/hutool-core/src/test/java/org/dromara/hutool/core/collection/CollUtilTest.java +++ b/hutool-core/src/test/java/org/dromara/hutool/core/collection/CollUtilTest.java @@ -1115,7 +1115,7 @@ public class CollUtilTest { @Data static class Cat extends Animal { - public Cat(String name, Integer age) { + public Cat(final String name, final Integer age) { super(name, age); } } @@ -1125,7 +1125,7 @@ public class CollUtilTest { @Data static class Pig extends Animal { - public Pig(String name, Integer age) { + public Pig(final String name, final Integer age) { super(name, age); } } @@ -1204,24 +1204,24 @@ public class CollUtilTest { @Test public void unionExtendTest() { - List dog = Arrays.asList(new Dog("dog1", 12), new Dog("dog2", 12)); - List cat = Arrays.asList(new Cat("cat1", 12), new Cat("cat2", 12)); + final List dog = Arrays.asList(new Dog("dog1", 12), new Dog("dog2", 12)); + final List cat = Arrays.asList(new Cat("cat1", 12), new Cat("cat2", 12)); Assertions.assertEquals(CollUtil.union(dog, cat).size(), dog.size() + cat.size()); } @Test public void unionAllExtendTest() { - List dog = Arrays.asList(new Dog("dog1", 12), new Dog("dog2", 12)); - List cat = Arrays.asList(new Cat("cat1", 12), new Cat("cat2", 12)); - List pig = Arrays.asList(new Pig("pig1", 12), new Pig("pig2", 12)); + final List dog = Arrays.asList(new Dog("dog1", 12), new Dog("dog2", 12)); + final List cat = Arrays.asList(new Cat("cat1", 12), new Cat("cat2", 12)); + final List pig = Arrays.asList(new Pig("pig1", 12), new Pig("pig2", 12)); Assertions.assertEquals(CollUtil.unionAll(dog, cat, pig).size(), dog.size() + cat.size() + pig.size()); } @Test public void unionDistinctExtendTest() { - List dog = Arrays.asList(new Dog("dog1", 12), new Dog("dog1", 12)); // same - List cat = Arrays.asList(new Cat("cat1", 12), new Cat("cat2", 12)); - List pig = Arrays.asList(new Pig("pig1", 12), new Pig("pig2", 12)); + final List dog = Arrays.asList(new Dog("dog1", 12), new Dog("dog1", 12)); // same + final List cat = Arrays.asList(new Cat("cat1", 12), new Cat("cat2", 12)); + final List pig = Arrays.asList(new Pig("pig1", 12), new Pig("pig2", 12)); Assertions.assertEquals(CollUtil.unionDistinct(dog, cat, pig).size(), 5); } }