diff --git a/src/main/java/org/apache/commons/lang3/stream/Streams.java b/src/main/java/org/apache/commons/lang3/stream/Streams.java index cf89da7a5..ef6612dd3 100644 --- a/src/main/java/org/apache/commons/lang3/stream/Streams.java +++ b/src/main/java/org/apache/commons/lang3/stream/Streams.java @@ -425,7 +425,7 @@ public class Streams { * @since 3.13.0 */ @SafeVarargs // Creating a stream from an array is safe - public static Stream of(T... values) { + public static Stream of(final T... values) { return values == null ? Stream.empty() : Stream.of(values); } diff --git a/src/test/java/org/apache/commons/lang3/RandomUtilsTest.java b/src/test/java/org/apache/commons/lang3/RandomUtilsTest.java index 0c8d60992..545e47f11 100644 --- a/src/test/java/org/apache/commons/lang3/RandomUtilsTest.java +++ b/src/test/java/org/apache/commons/lang3/RandomUtilsTest.java @@ -100,7 +100,7 @@ public class RandomUtilsTest { @Test public void testBoolean() { final boolean result = RandomUtils.nextBoolean(); - assertTrue(result == true || result == false); + assertTrue(result || !result); } /** diff --git a/src/test/java/org/apache/commons/lang3/StreamsTest.java b/src/test/java/org/apache/commons/lang3/StreamsTest.java index ce9bbb5df..57de472c6 100644 --- a/src/test/java/org/apache/commons/lang3/StreamsTest.java +++ b/src/test/java/org/apache/commons/lang3/StreamsTest.java @@ -84,8 +84,8 @@ public class StreamsTest { protected FailableConsumer asIntConsumer(final T pThrowable) { return s -> { - final Integer i = Integer.valueOf(s); - if (i.intValue() == 4) { + final int i = Integer.parseInt(s); + if (i == 4) { throw pThrowable; } }; diff --git a/src/test/java/org/apache/commons/lang3/stream/StreamsTest.java b/src/test/java/org/apache/commons/lang3/stream/StreamsTest.java index 0d888f7dc..be9d76f92 100644 --- a/src/test/java/org/apache/commons/lang3/stream/StreamsTest.java +++ b/src/test/java/org/apache/commons/lang3/stream/StreamsTest.java @@ -46,8 +46,8 @@ public class StreamsTest { protected FailableConsumer asIntConsumer(final T pThrowable) { return s -> { - final Integer i = Integer.valueOf(s); - if (i.intValue() == 4) { + final int i = Integer.parseInt(s); + if (i == 4) { throw pThrowable; } };