diff --git a/src/main/java/org/apache/commons/lang3/text/translate/NumericEntityUnescaper.java b/src/main/java/org/apache/commons/lang3/text/translate/NumericEntityUnescaper.java index b9da84a98..e765825ab 100644 --- a/src/main/java/org/apache/commons/lang3/text/translate/NumericEntityUnescaper.java +++ b/src/main/java/org/apache/commons/lang3/text/translate/NumericEntityUnescaper.java @@ -19,6 +19,7 @@ package org.apache.commons.lang3.text.translate; import java.io.IOException; import java.io.Writer; import java.util.Arrays; +import java.util.Collections; import java.util.EnumSet; /** @@ -62,7 +63,7 @@ public class NumericEntityUnescaper extends CharSequenceTranslator { if (options.length > 0) { this.options = EnumSet.copyOf(Arrays.asList(options)); } else { - this.options = EnumSet.copyOf(Arrays.asList(OPTION.semiColonRequired)); + this.options = EnumSet.copyOf(Collections.singletonList(OPTION.semiColonRequired)); } } diff --git a/src/test/java/org/apache/commons/lang3/ObjectUtilsTest.java b/src/test/java/org/apache/commons/lang3/ObjectUtilsTest.java index 373f40ca7..aab3a4e77 100644 --- a/src/test/java/org/apache/commons/lang3/ObjectUtilsTest.java +++ b/src/test/java/org/apache/commons/lang3/ObjectUtilsTest.java @@ -243,10 +243,10 @@ public class ObjectUtilsTest { @Test public void testHashCodeMulti_multiple_likeList() { - final List list0 = new ArrayList<>(Arrays.asList()); + final List list0 = new ArrayList<>(Collections.emptyList()); assertEquals(list0.hashCode(), ObjectUtils.hashCodeMulti()); - final List list1 = new ArrayList<>(Arrays.asList("a")); + final List list1 = new ArrayList<>(Collections.singletonList("a")); assertEquals(list1.hashCode(), ObjectUtils.hashCodeMulti("a")); final List list2 = new ArrayList<>(Arrays.asList("a", "b")); diff --git a/src/test/java/org/apache/commons/lang3/reflect/TypeUtilsTest.java b/src/test/java/org/apache/commons/lang3/reflect/TypeUtilsTest.java index eeaaa8c41..d029c088a 100644 --- a/src/test/java/org/apache/commons/lang3/reflect/TypeUtilsTest.java +++ b/src/test/java/org/apache/commons/lang3/reflect/TypeUtilsTest.java @@ -32,7 +32,6 @@ import java.lang.reflect.TypeVariable; import java.lang.reflect.WildcardType; import java.net.URI; import java.util.ArrayList; -import java.util.Arrays; import java.util.Collection; import java.util.Collections; import java.util.HashMap; @@ -504,7 +503,7 @@ public class TypeUtilsTest { assertEquals(Integer.class, typeVarAssigns.get(treeSetTypeVar), "Type argument of Comparable from int: " + typeArg); - final Collection col = Arrays.asList(); + final Collection col = Collections.emptyList(); typeVarAssigns = TypeUtils.getTypeArguments(List.class, Collection.class); treeSetTypeVar = Comparable.class.getTypeParameters()[0]; assertFalse(typeVarAssigns.containsKey(treeSetTypeVar),