You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@commons.apache.org by ah...@apache.org on 2021/08/17 07:08:08 UTC

[commons-rng] branch master updated (eca64d0 -> 42a5151)

This is an automated email from the ASF dual-hosted git repository.

aherbert pushed a change to branch master
in repository https://gitbox.apache.org/repos/asf/commons-rng.git.


    from eca64d0  Update user guide Gaussian performance table
     new 46dbfb2  RNG-163: Update pom dependency JUnit 4 to JUnit 5
     new 6663901  Remove Java 8 profiles from modules
     new 07a6dc9  RNG-163: Replace JUnit 4 Assert with JUnit 5 Assertions
     new 5d4eb72  RNG-163: Replace expected thrown exception with assertThrows
     new ad27ea7  RNG-163: Update parametric tests to JUnit 5 ParameterizedTest
     new c50b678  RNG-163: Update JUnit 4 @Test to JUnit 5 @Test
     new ca203fc  RNG-163: Remove JUnit 4 support
     new 551ecef  RNG-163: Replace try-catch with assertThrows
     new eef475e  Drop redundant array to Arrays.asList
     new 6767b5c  Use diamond operator
     new 2648f67  RNG-163: Make tests and test classes package-private
     new f20d09c  Use diamond operator
     new 42a5151  Remove duplicate ConstantName module

The 13 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails.  The revisions
listed as "add" were already present in the repository and have only
been added to this reference.


Summary of changes:
 commons-rng-client-api/pom.xml                     |  13 -
 commons-rng-core/pom.xml                           |  13 -
 .../apache/commons/rng/core/BaseProviderTest.java  |  40 +-
 .../rng/core/JumpableProvidersParametricTest.java  | 146 +++---
 .../rng/core/Providers32ParametricTest.java        |  29 +-
 .../rng/core/Providers64ParametricTest.java        |  30 +-
 .../rng/core/ProvidersCommonParametricTest.java    | 308 ++++++------
 .../org/apache/commons/rng/core/ProvidersList.java | 140 +++---
 .../org/apache/commons/rng/core/RandomAssert.java  |  94 ++--
 .../rng/core/RandomProviderDefaultStateTest.java   |  10 +-
 .../DotyHumphreySmallFastCounting32Test.java       |   6 +-
 .../commons/rng/core/source32/ISAACRandomTest.java |   6 +-
 .../commons/rng/core/source32/IntProviderTest.java |  14 +-
 .../commons/rng/core/source32/JDKRandomTest.java   |  40 +-
 .../rng/core/source32/JenkinsSmallFast32Test.java  |   6 +-
 .../commons/rng/core/source32/KISSRandomTest.java  |   6 +-
 .../rng/core/source32/MersenneTwisterTest.java     |  14 +-
 .../source32/MiddleSquareWeylSequenceTest.java     |  14 +-
 .../core/source32/MultiplyWithCarry256Test.java    |  10 +-
 .../rng/core/source32/PcgMcgXshRr32Test.java       |   6 +-
 .../rng/core/source32/PcgMcgXshRs32Test.java       |   6 +-
 .../commons/rng/core/source32/PcgXshRr32Test.java  |   8 +-
 .../commons/rng/core/source32/PcgXshRs32Test.java  |   8 +-
 .../commons/rng/core/source32/Well1024aTest.java   |  10 +-
 .../commons/rng/core/source32/Well19937aTest.java  |  10 +-
 .../commons/rng/core/source32/Well19937cTest.java  |  10 +-
 .../commons/rng/core/source32/Well44497aTest.java  |  10 +-
 .../commons/rng/core/source32/Well44497bTest.java  |  10 +-
 .../commons/rng/core/source32/Well512aTest.java    |  10 +-
 .../rng/core/source32/XoRoShiRo64StarStarTest.java |  14 +-
 .../rng/core/source32/XoRoShiRo64StarTest.java     |  14 +-
 .../rng/core/source32/XoShiRo128PlusPlusTest.java  |  18 +-
 .../rng/core/source32/XoShiRo128PlusTest.java      |  18 +-
 .../rng/core/source32/XoShiRo128StarStarTest.java  |  18 +-
 .../DotyHumphreySmallFastCounting64Test.java       |   6 +-
 .../rng/core/source64/JenkinsSmallFast64Test.java  |   6 +-
 .../rng/core/source64/LongProviderTest.java        |  24 +-
 .../rng/core/source64/MersenneTwister64Test.java   |  14 +-
 .../commons/rng/core/source64/PcgRxsMXs64Test.java |   8 +-
 .../commons/rng/core/source64/SplitMix64Test.java  |   6 +-
 .../commons/rng/core/source64/TwoCmresTest.java    |  62 +--
 .../core/source64/XoRoShiRo1024PlusPlusTest.java   |  16 +-
 .../core/source64/XoRoShiRo1024StarStarTest.java   |  16 +-
 .../rng/core/source64/XoRoShiRo1024StarTest.java   |  16 +-
 .../core/source64/XoRoShiRo128PlusPlusTest.java    |  25 +-
 .../rng/core/source64/XoRoShiRo128PlusTest.java    |  18 +-
 .../core/source64/XoRoShiRo128StarStarTest.java    |  18 +-
 .../rng/core/source64/XoShiRo256PlusPlusTest.java  |  18 +-
 .../rng/core/source64/XoShiRo256PlusTest.java      |  18 +-
 .../rng/core/source64/XoShiRo256StarStarTest.java  |  18 +-
 .../rng/core/source64/XoShiRo512PlusPlusTest.java  |  18 +-
 .../rng/core/source64/XoShiRo512PlusTest.java      |  18 +-
 .../rng/core/source64/XoShiRo512StarStarTest.java  |  18 +-
 .../rng/core/source64/XorShift1024StarPhiTest.java |  12 +-
 .../rng/core/source64/XorShift1024StarTest.java    |  12 +-
 .../commons/rng/core/util/NumberFactoryTest.java   | 172 ++++---
 .../commons/rng/examples/stress/HexTest.java       |  26 +-
 .../rng/examples/stress/RngDataOutputTest.java     |  24 +-
 commons-rng-sampling/pom.xml                       |  13 -
 .../rng/sampling/CollectionSamplerTest.java        |  27 +-
 .../rng/sampling/CombinationSamplerTest.java       |  67 +--
 .../rng/sampling/CompositeSamplersTest.java        | 119 +++--
 .../DiscreteProbabilityCollectionSamplerTest.java  | 135 +++---
 .../commons/rng/sampling/ListSamplerTest.java      | 130 ++---
 .../rng/sampling/PermutationSamplerTest.java       |  78 +--
 .../apache/commons/rng/sampling/RandomAssert.java  |  16 +-
 .../rng/sampling/UnitSphereSamplerTest.java        | 118 ++---
 .../AhrensDieterExponentialSamplerTest.java        |  36 +-
 ...AhrensDieterMarsagliaTsangGammaSamplerTest.java |  28 +-
 .../AliasMethodDiscreteSamplerTest.java            |  86 ++--
 .../distribution/BoxMullerGaussianSamplerTest.java |  15 +-
 .../BoxMullerLogNormalSamplerTest.java             |  25 +-
 .../BoxMullerNormalisedGaussianSamplerTest.java    |   6 +-
 .../distribution/ChengBetaSamplerTest.java         |  32 +-
 .../ContinuousSamplerParametricTest.java           |  41 +-
 .../distribution/ContinuousSamplersList.java       |  23 +-
 .../distribution/ContinuousUniformSamplerTest.java |  52 +-
 .../distribution/DirichletSamplerTest.java         |  96 ++--
 .../DiscreteSamplerParametricTest.java             |  53 +--
 .../distribution/DiscreteSamplersList.java         |  29 +-
 .../distribution/DiscreteUniformSamplerTest.java   |  81 ++--
 .../sampling/distribution/GaussianSamplerTest.java |  56 ++-
 .../distribution/GeometricSamplerTest.java         |  44 +-
 .../GuideTableDiscreteSamplerTest.java             | 107 +++--
 .../sampling/distribution/InternalUtilsTest.java   |  54 ++-
 .../InverseTransformContinuousSamplerTest.java     |   6 +-
 .../InverseTransformDiscreteSamplerTest.java       |   6 +-
 .../InverseTransformParetoSamplerTest.java         |  21 +-
 .../KempSmallMeanPoissonSamplerTest.java           |  58 +--
 .../distribution/LargeMeanPoissonSamplerTest.java  |  54 ++-
 .../rng/sampling/distribution/LevySamplerTest.java |  28 +-
 .../distribution/LogNormalSamplerTest.java         |  35 +-
 .../MarsagliaNormalisedGaussianSamplerTest.java    |  12 +-
 .../MarsagliaTsangWangDiscreteSamplerTest.java     | 209 ++++----
 .../distribution/PoissonSamplerCacheTest.java      | 170 +++----
 .../sampling/distribution/PoissonSamplerTest.java  |  14 +-
 .../RejectionInversionZipfSamplerTest.java         |  21 +-
 .../rng/sampling/distribution/SamplerBaseTest.java |  20 +-
 .../distribution/SmallMeanPoissonSamplerTest.java  |  26 +-
 .../sampling/distribution/StableSamplerTest.java   | 523 +++++++++++----------
 .../distribution/UniformLongSamplerTest.java       |  71 +--
 .../ZigguratNormalizedGaussianSamplerTest.java     |  14 +-
 .../sampling/distribution/ZigguratSamplerTest.java |  60 +--
 .../commons/rng/sampling/shape/BoxSamplerTest.java |  83 ++--
 .../rng/sampling/shape/CoordinatesTest.java        |  45 +-
 .../rng/sampling/shape/LineSamplerTest.java        |  95 ++--
 .../rng/sampling/shape/TetrahedronSamplerTest.java | 109 +++--
 .../rng/sampling/shape/TriangleSamplerTest.java    | 153 +++---
 .../rng/sampling/shape/UnitBallSamplerTest.java    |  49 +-
 commons-rng-simple/pom.xml                         |  13 -
 .../commons/rng/simple/JDKRandomBridgeTest.java    |  47 +-
 .../commons/rng/simple/JDKRandomWrapperTest.java   |  52 +-
 .../rng/simple/ProvidersCommonParametricTest.java  | 279 ++++++-----
 .../apache/commons/rng/simple/ProvidersList.java   |  39 +-
 .../apache/commons/rng/simple/RandomAssert.java    |  20 +-
 .../commons/rng/simple/RandomSourceTest.java       |  46 +-
 .../rng/simple/ThreadLocalRandomSourceTest.java    |  44 +-
 .../simple/internal/ByteArray2IntArrayTest.java    |  14 +-
 .../simple/internal/ByteArray2LongArrayTest.java   |  14 +-
 .../simple/internal/IntArray2LongArrayTest.java    |  14 +-
 .../rng/simple/internal/Long2IntArrayTest.java     |  12 +-
 .../rng/simple/internal/Long2LongArrayTest.java    |  10 +-
 .../internal/NativeSeedTypeParametricTest.java     | 131 +++---
 .../rng/simple/internal/NativeSeedTypeTest.java    |  16 +-
 .../rng/simple/internal/NoOpConverterTest.java     |  18 +-
 .../RandomSourceInternalParametricTest.java        | 117 +++--
 .../simple/internal/SeedConverterComposerTest.java |  14 +-
 .../rng/simple/internal/SeedFactoryTest.java       |  94 ++--
 .../commons/rng/simple/internal/SeedUtilsTest.java |  24 +-
 pom.xml                                            |   7 +-
 src/main/resources/checkstyle/checkstyle.xml       |   3 -
 131 files changed, 3029 insertions(+), 3146 deletions(-)

[commons-rng] 03/13: RNG-163: Replace JUnit 4 Assert with JUnit 5 Assertions

Posted by ah...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

aherbert pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/commons-rng.git

commit 07a6dc916a5ab71cc583727c43517cb668c81ad7
Author: Alex Herbert <ah...@apache.org>
AuthorDate: Sun Aug 15 13:55:25 2021 +0100

    RNG-163: Replace JUnit 4 Assert with JUnit 5 Assertions
    
    Tests for float equality with a delta of 0.0 have been updated to remove the delta.
    
    Replace JUnit 4 Assume with JUnit 5 Assumptions
---
 .../apache/commons/rng/core/BaseProviderTest.java  |  18 +-
 .../rng/core/JumpableProvidersParametricTest.java  |  23 +-
 .../rng/core/ProvidersCommonParametricTest.java    |  35 +-
 .../org/apache/commons/rng/core/RandomAssert.java  |  94 +++---
 .../rng/core/RandomProviderDefaultStateTest.java   |   4 +-
 .../commons/rng/core/source32/IntProviderTest.java |   8 +-
 .../commons/rng/core/source32/JDKRandomTest.java   |  25 +-
 .../rng/core/source32/MersenneTwisterTest.java     |   6 +-
 .../source32/MiddleSquareWeylSequenceTest.java     |   4 +-
 .../rng/core/source64/LongProviderTest.java        |  16 +-
 .../rng/core/source64/MersenneTwister64Test.java   |   6 +-
 .../commons/rng/core/source64/TwoCmresTest.java    |  14 +-
 .../commons/rng/core/util/NumberFactoryTest.java   |  80 ++---
 .../commons/rng/examples/stress/HexTest.java       |   6 +-
 .../rng/examples/stress/RngDataOutputTest.java     |   8 +-
 .../rng/sampling/CollectionSamplerTest.java        |   4 +-
 .../rng/sampling/CombinationSamplerTest.java       |  18 +-
 .../rng/sampling/CompositeSamplersTest.java        |  46 +--
 .../DiscreteProbabilityCollectionSamplerTest.java  |  14 +-
 .../commons/rng/sampling/ListSamplerTest.java      |  32 +-
 .../rng/sampling/PermutationSamplerTest.java       |  26 +-
 .../apache/commons/rng/sampling/RandomAssert.java  |  16 +-
 .../rng/sampling/UnitSphereSamplerTest.java        |  39 ++-
 .../AhrensDieterExponentialSamplerTest.java        |   6 +-
 ...AhrensDieterMarsagliaTsangGammaSamplerTest.java |   4 +-
 .../AliasMethodDiscreteSamplerTest.java            |   8 +-
 .../distribution/ChengBetaSamplerTest.java         |   4 +-
 .../ContinuousSamplerParametricTest.java           |   8 +-
 .../distribution/ContinuousUniformSamplerTest.java |  22 +-
 .../distribution/DirichletSamplerTest.java         |  16 +-
 .../DiscreteSamplerParametricTest.java             |   8 +-
 .../distribution/DiscreteUniformSamplerTest.java   |  30 +-
 .../distribution/GeometricSamplerTest.java         |  14 +-
 .../GuideTableDiscreteSamplerTest.java             |   8 +-
 .../sampling/distribution/InternalUtilsTest.java   |  14 +-
 .../KempSmallMeanPoissonSamplerTest.java           |  14 +-
 .../distribution/LargeMeanPoissonSamplerTest.java  |   6 +-
 .../rng/sampling/distribution/LevySamplerTest.java |   6 +-
 .../MarsagliaNormalisedGaussianSamplerTest.java    |   4 +-
 .../MarsagliaTsangWangDiscreteSamplerTest.java     |  42 +--
 .../distribution/PoissonSamplerCacheTest.java      |  94 +++---
 .../sampling/distribution/PoissonSamplerTest.java  |   4 +-
 .../rng/sampling/distribution/SamplerBaseTest.java |  12 +-
 .../distribution/SmallMeanPoissonSamplerTest.java  |   4 +-
 .../sampling/distribution/StableSamplerTest.java   | 358 +++++++++++----------
 .../distribution/UniformLongSamplerTest.java       |  24 +-
 .../sampling/distribution/ZigguratSamplerTest.java |  33 +-
 .../commons/rng/sampling/shape/BoxSamplerTest.java |  28 +-
 .../rng/sampling/shape/CoordinatesTest.java        |  18 +-
 .../rng/sampling/shape/LineSamplerTest.java        |  30 +-
 .../rng/sampling/shape/TetrahedronSamplerTest.java |  74 ++---
 .../rng/sampling/shape/TriangleSamplerTest.java    |  84 ++---
 .../rng/sampling/shape/UnitBallSamplerTest.java    |  12 +-
 .../commons/rng/simple/JDKRandomBridgeTest.java    |  39 ++-
 .../commons/rng/simple/JDKRandomWrapperTest.java   |  36 +--
 .../rng/simple/ProvidersCommonParametricTest.java  |  68 ++--
 .../apache/commons/rng/simple/RandomAssert.java    |  20 +-
 .../commons/rng/simple/RandomSourceTest.java       |  30 +-
 .../rng/simple/ThreadLocalRandomSourceTest.java    |  21 +-
 .../simple/internal/ByteArray2IntArrayTest.java    |   6 +-
 .../simple/internal/ByteArray2LongArrayTest.java   |   6 +-
 .../simple/internal/IntArray2LongArrayTest.java    |   6 +-
 .../rng/simple/internal/Long2IntArrayTest.java     |   6 +-
 .../rng/simple/internal/Long2LongArrayTest.java    |   4 +-
 .../internal/NativeSeedTypeParametricTest.java     |  31 +-
 .../rng/simple/internal/NativeSeedTypeTest.java    |   4 +-
 .../rng/simple/internal/NoOpConverterTest.java     |   6 +-
 .../RandomSourceInternalParametricTest.java        |  36 +--
 .../simple/internal/SeedConverterComposerTest.java |   6 +-
 .../rng/simple/internal/SeedFactoryTest.java       |  50 +--
 .../commons/rng/simple/internal/SeedUtilsTest.java |  16 +-
 71 files changed, 961 insertions(+), 961 deletions(-)

diff --git a/commons-rng-core/src/test/java/org/apache/commons/rng/core/BaseProviderTest.java b/commons-rng-core/src/test/java/org/apache/commons/rng/core/BaseProviderTest.java
index 4b07cea..070f4dc 100644
--- a/commons-rng-core/src/test/java/org/apache/commons/rng/core/BaseProviderTest.java
+++ b/commons-rng-core/src/test/java/org/apache/commons/rng/core/BaseProviderTest.java
@@ -17,8 +17,8 @@
 package org.apache.commons.rng.core;
 
 import org.junit.Test;
-import org.junit.Assert;
-import org.junit.Assume;
+import org.junit.jupiter.api.Assertions;
+import org.junit.jupiter.api.Assumptions;
 
 /**
  * Tests for {@link BaseProvider}.
@@ -33,7 +33,7 @@ public class BaseProviderTest {
     public void testStateSizeTooSmall() {
         final DummyGenerator dummy = new DummyGenerator();
         final int size = dummy.getStateSize();
-        Assume.assumeTrue(size > 0);
+        Assumptions.assumeTrue(size > 0);
         dummy.restoreState(new RandomProviderDefaultState(new byte[size - 1]));
     }
 
@@ -50,15 +50,15 @@ public class BaseProviderTest {
         final int[] seed = {1, 2, 3};
 
         for (int i = 0; i < state.length; i++) {
-            Assert.assertEquals(0, state[i]);
+            Assertions.assertEquals(0, state[i]);
         }
 
         new DummyGenerator().fillState(state, seed);
         for (int i = 0; i < seed.length; i++) {
-            Assert.assertEquals(seed[i], state[i]);
+            Assertions.assertEquals(seed[i], state[i]);
         }
         for (int i = seed.length; i < state.length; i++) {
-            Assert.assertNotEquals(0, state[i]);
+            Assertions.assertNotEquals(0, state[i]);
         }
     }
 
@@ -68,15 +68,15 @@ public class BaseProviderTest {
         final long[] seed = {1, 2, 3};
 
         for (int i = 0; i < state.length; i++) {
-            Assert.assertEquals(0, state[i]);
+            Assertions.assertEquals(0, state[i]);
         }
 
         new DummyGenerator().fillState(state, seed);
         for (int i = 0; i < seed.length; i++) {
-            Assert.assertEquals(seed[i], state[i]);
+            Assertions.assertEquals(seed[i], state[i]);
         }
         for (int i = seed.length; i < state.length; i++) {
-            Assert.assertNotEquals(0, state[i]);
+            Assertions.assertNotEquals(0, state[i]);
         }
     }
 
diff --git a/commons-rng-core/src/test/java/org/apache/commons/rng/core/JumpableProvidersParametricTest.java b/commons-rng-core/src/test/java/org/apache/commons/rng/core/JumpableProvidersParametricTest.java
index 83a5da6..4793b42 100644
--- a/commons-rng-core/src/test/java/org/apache/commons/rng/core/JumpableProvidersParametricTest.java
+++ b/commons-rng-core/src/test/java/org/apache/commons/rng/core/JumpableProvidersParametricTest.java
@@ -16,8 +16,8 @@
  */
 package org.apache.commons.rng.core;
 
-import org.junit.Assert;
-import org.junit.Assume;
+import org.junit.jupiter.api.Assertions;
+import org.junit.jupiter.api.Assumptions;
 import org.junit.Test;
 import org.junit.runner.RunWith;
 import org.junit.runners.Parameterized;
@@ -90,7 +90,7 @@ public class JumpableProvidersParametricTest {
      * @return the jump function
      */
     private TestJumpFunction getLongJumpFunction() {
-        Assume.assumeTrue("No long jump function", generator instanceof LongJumpableUniformRandomProvider);
+        Assumptions.assumeTrue(generator instanceof LongJumpableUniformRandomProvider, "No long jump function");
 
         final LongJumpableUniformRandomProvider rng = (LongJumpableUniformRandomProvider) generator;
         return new TestJumpFunction() {
@@ -124,8 +124,8 @@ public class JumpableProvidersParametricTest {
      */
     private void assertJumpReturnsACopy(TestJumpFunction jumpFunction) {
         final UniformRandomProvider copy = jumpFunction.jump();
-        Assert.assertNotSame("The copy instance should be a different object", generator, copy);
-        Assert.assertEquals("The copy instance should be the same class", generator.getClass(), copy.getClass());
+        Assertions.assertNotSame(generator, copy, "The copy instance should be a different object");
+        Assertions.assertEquals(generator.getClass(), copy.getClass(), "The copy instance should be the same class");
     }
 
     /**
@@ -165,7 +165,7 @@ public class JumpableProvidersParametricTest {
      * @param jumpFunction Jump function to test.
      */
     private void assertCopyMatchesPreJumpState(TestJumpFunction jumpFunction) {
-        Assume.assumeTrue("Not a restorable RNG", generator instanceof RestorableUniformRandomProvider);
+        Assumptions.assumeTrue(generator instanceof RestorableUniformRandomProvider, "Not a restorable RNG");
 
         for (int repeats = 0; repeats < 2; repeats++) {
             // Exercise the generator.
@@ -176,15 +176,15 @@ public class JumpableProvidersParametricTest {
             generator.nextBoolean();
 
             final RandomProviderState preJumpState = ((RestorableUniformRandomProvider) generator).saveState();
-            Assume.assumeTrue("Not a recognised state", preJumpState instanceof RandomProviderDefaultState);
+            Assumptions.assumeTrue(preJumpState instanceof RandomProviderDefaultState, "Not a recognised state");
 
             final UniformRandomProvider copy = jumpFunction.jump();
 
             final RandomProviderState copyState = ((RestorableUniformRandomProvider) copy).saveState();
             final RandomProviderDefaultState expected = (RandomProviderDefaultState) preJumpState;
             final RandomProviderDefaultState actual = (RandomProviderDefaultState) copyState;
-            Assert.assertArrayEquals("The copy instance state should match the state of the original",
-                expected.getState(), actual.getState());
+            Assertions.assertArrayEquals(expected.getState(), actual.getState(),
+                "The copy instance state should match the state of the original");
         }
     }
 
@@ -240,12 +240,13 @@ public class JumpableProvidersParametricTest {
             final RandomProviderState postJumpState = ((RestorableUniformRandomProvider) generator).saveState();
             final byte[] actual = ((RandomProviderDefaultState) postJumpState).getState();
 
-            Assume.assumeTrue("Implementation has removed default state", actual.length >= stateSize);
+            Assumptions.assumeTrue(actual.length >= stateSize, "Implementation has removed default state");
 
             // The implementation requires that any sub-class state is prepended to the
             // state thus the default state is at the end.
             final byte[] defaultState = Arrays.copyOfRange(actual, actual.length - stateSize, actual.length);
-            Assert.assertArrayEquals("The jump should reset the default state to zero", expected, defaultState);
+            Assertions.assertArrayEquals(expected, defaultState,
+                "The jump should reset the default state to zero");
         }
     }
 
diff --git a/commons-rng-core/src/test/java/org/apache/commons/rng/core/ProvidersCommonParametricTest.java b/commons-rng-core/src/test/java/org/apache/commons/rng/core/ProvidersCommonParametricTest.java
index 7119282..8e07603 100644
--- a/commons-rng-core/src/test/java/org/apache/commons/rng/core/ProvidersCommonParametricTest.java
+++ b/commons-rng-core/src/test/java/org/apache/commons/rng/core/ProvidersCommonParametricTest.java
@@ -21,7 +21,7 @@ import java.util.List;
 import java.util.ArrayList;
 import java.util.concurrent.Callable;
 
-import org.junit.Assert;
+import org.junit.jupiter.api.Assertions;
 import org.junit.Test;
 import org.junit.runner.RunWith;
 import org.junit.runners.Parameterized;
@@ -121,7 +121,7 @@ public class ProvidersCommonParametricTest {
             }
         };
 
-        Assert.assertTrue(isUniformNextBytes(buffer, 0, size, nextMethod));
+        Assertions.assertTrue(isUniformNextBytes(buffer, 0, size, nextMethod));
     }
 
     @Test
@@ -140,11 +140,11 @@ public class ProvidersCommonParametricTest {
         };
 
         // Test should pass for the part of the buffer where values are put.
-        Assert.assertTrue(isUniformNextBytes(buffer, offset, offset + size, nextMethod));
+        Assertions.assertTrue(isUniformNextBytes(buffer, offset, offset + size, nextMethod));
 
         // Test must fail for the parts of the buffer where no values are put.
-        Assert.assertFalse(isUniformNextBytes(buffer, 0, offset, nextMethod));
-        Assert.assertFalse(isUniformNextBytes(buffer, offset + size, buffer.length, nextMethod));
+        Assertions.assertFalse(isUniformNextBytes(buffer, 0, offset, nextMethod));
+        Assertions.assertFalse(isUniformNextBytes(buffer, offset + size, buffer.length, nextMethod));
     }
 
     @Test
@@ -234,15 +234,15 @@ public class ProvidersCommonParametricTest {
         final List<Number> listOrig = makeList(n);
         // Discard a few more.
         final List<Number> listDiscard = makeList(n);
-        Assert.assertNotEquals(0, listDiscard.size());
-        Assert.assertNotEquals(listOrig, listDiscard);
+        Assertions.assertNotEquals(0, listDiscard.size());
+        Assertions.assertNotEquals(listOrig, listDiscard);
         // Reset.
         generator.restoreState(state);
         // Replay.
         final List<Number> listReplay = makeList(n);
-        Assert.assertNotSame(listOrig, listReplay);
+        Assertions.assertNotSame(listOrig, listReplay);
         // Check that the restored state is the same as the original.
-        Assert.assertEquals(listOrig, listReplay);
+        Assertions.assertEquals(listOrig, listReplay);
     }
 
     @Test(expected = IllegalStateException.class)
@@ -376,10 +376,9 @@ public class ProvidersCommonParametricTest {
 
         final double actual = Math.abs(walk);
         final double max = Math.sqrt(sampleSize) * 2.576;
-        Assert.assertTrue(generator + ": Walked too far astray: " + actual +
-                          " > " + max +
-                          " (test will fail randomly about 1 in 100 times)",
-                          actual < max);
+        Assertions.assertTrue(actual < max,
+            () -> generator + ": Walked too far astray: " + actual + " > " + max +
+            " (test will fail randomly about 1 in 100 times)");
     }
 
     /**
@@ -516,7 +515,7 @@ public class ProvidersCommonParametricTest {
                 Arrays.fill(observed, 0);
                 for (int j = 0; j < sampleSize; j++) {
                     final long value = nextMethod.call().longValue();
-                    Assert.assertTrue("Range", value >= 0 && value < n);
+                    Assertions.assertTrue(value >= 0 && value < n, "Range");
 
                     for (int k = 0; k < numBins; k++) {
                         if (value < binUpperBounds[k]) {
@@ -552,8 +551,8 @@ public class ProvidersCommonParametricTest {
         // 12    0.00190
 
         if (numFailures > 11) { // Test will fail with 0.5% probability
-            Assert.fail(generator + ": Too many failures for n = " + n +
-                        " (" + numFailures + " out of " + numTests + " tests failed)");
+            Assertions.fail(generator + ": Too many failures for n = " + n +
+                            " (" + numFailures + " out of " + numTests + " tests failed)");
         }
     }
 
@@ -586,8 +585,8 @@ public class ProvidersCommonParametricTest {
         System.arraycopy(b1, b1.length - b3.length, b3, 0, b3.length);
 
         // Sequence of calls must be the same.
-        Assert.assertArrayEquals("chunkSize=" + chunkSize + " numChunks=" + numChunks,
-                                 b2, b3);
+        Assertions.assertArrayEquals(b2, b3,
+            () -> "chunkSize=" + chunkSize + " numChunks=" + numChunks);
     }
 
     /**
diff --git a/commons-rng-core/src/test/java/org/apache/commons/rng/core/RandomAssert.java b/commons-rng-core/src/test/java/org/apache/commons/rng/core/RandomAssert.java
index 7344455..e72b225 100644
--- a/commons-rng-core/src/test/java/org/apache/commons/rng/core/RandomAssert.java
+++ b/commons-rng-core/src/test/java/org/apache/commons/rng/core/RandomAssert.java
@@ -17,7 +17,7 @@
 
 package org.apache.commons.rng.core;
 
-import org.junit.Assert;
+import org.junit.jupiter.api.Assertions;
 
 import java.lang.reflect.Constructor;
 import java.lang.reflect.InvocationTargetException;
@@ -43,7 +43,7 @@ public final class RandomAssert {
      * @param rng Random generator.
      */
     public static void assertEquals(int[] expected, UniformRandomProvider rng) {
-        assertEquals("Value at position ", expected, rng);
+        assertEquals(expected, rng, "Value at position ");
     }
 
     /**
@@ -54,7 +54,7 @@ public final class RandomAssert {
      * @param rng Random generator.
      */
     public static void assertEquals(long[] expected, UniformRandomProvider rng) {
-        assertEquals("Value at position ", expected, rng);
+        assertEquals(expected, rng, "Value at position ");
     }
 
     /**
@@ -62,13 +62,14 @@ public final class RandomAssert {
      * {@link UniformRandomProvider#nextInt()}.
      * The message prefix is prepended to the array index for the assertion message.
      *
-     * @param messagePrefix Message prefix.
      * @param expected Expected output.
      * @param rng Random generator.
+     * @param messagePrefix Message prefix.
      */
-    private static void assertEquals(String messagePrefix, int[] expected, UniformRandomProvider rng) {
+    private static void assertEquals(int[] expected, UniformRandomProvider rng, String messagePrefix) {
         for (int i = 0; i < expected.length; i++) {
-            Assert.assertEquals(messagePrefix + i, expected[i], rng.nextInt());
+            final int index = i;
+            Assertions.assertEquals(expected[i], rng.nextInt(), () -> messagePrefix + index);
         }
     }
 
@@ -77,13 +78,14 @@ public final class RandomAssert {
      * {@link UniformRandomProvider#nextLong()}.
      * The message prefix is prepended to the array index for the assertion message.
      *
-     * @param messagePrefix Message prefix.
      * @param expected Expected output.
      * @param rng Random generator.
+     * @param messagePrefix Message prefix.
      */
-    private static void assertEquals(String messagePrefix, long[] expected, UniformRandomProvider rng) {
+    private static void assertEquals(long[] expected, UniformRandomProvider rng, String messagePrefix) {
         for (int i = 0; i < expected.length; i++) {
-            Assert.assertEquals(messagePrefix + i, expected[i], rng.nextLong());
+            final int index = i;
+            Assertions.assertEquals(expected[i], rng.nextLong(), () -> messagePrefix + index);
         }
     }
 
@@ -100,7 +102,7 @@ public final class RandomAssert {
                 return;
             }
         }
-        Assert.fail("Expected a different nextLong output");
+        Assertions.fail("Expected a different nextLong output");
     }
 
     /**
@@ -124,10 +126,10 @@ public final class RandomAssert {
                                         int[] expectedAfter,
                                         JumpableUniformRandomProvider rng) {
         final UniformRandomProvider copy = rng.jump();
-        Assert.assertNotSame("The copy instance should be a different object", rng, copy);
-        Assert.assertEquals("The copy instance should be the same class", rng.getClass(), copy.getClass());
-        assertEquals("Pre-jump value at position ", expectedBefore, copy);
-        assertEquals("Post-jump value at position ", expectedAfter, rng);
+        Assertions.assertNotSame(rng, copy, "The copy instance should be a different object");
+        Assertions.assertEquals(rng.getClass(), copy.getClass(), "The copy instance should be the same class");
+        assertEquals(expectedBefore, copy, "Pre-jump value at position ");
+        assertEquals(expectedAfter, rng, "Post-jump value at position ");
     }
 
     /**
@@ -151,10 +153,10 @@ public final class RandomAssert {
                                         long[] expectedAfter,
                                         JumpableUniformRandomProvider rng) {
         final UniformRandomProvider copy = rng.jump();
-        Assert.assertNotSame("The copy instance should be a different object", rng, copy);
-        Assert.assertEquals("The copy instance should be the same class", rng.getClass(), copy.getClass());
-        assertEquals("Pre-jump value at position ", expectedBefore, copy);
-        assertEquals("Post-jump value at position ", expectedAfter, rng);
+        Assertions.assertNotSame(rng, copy, "The copy instance should be a different object");
+        Assertions.assertEquals(rng.getClass(), copy.getClass(), "The copy instance should be the same class");
+        assertEquals(expectedBefore, copy, "Pre-jump value at position ");
+        assertEquals(expectedAfter, rng, "Post-jump value at position ");
     }
 
     /**
@@ -178,10 +180,10 @@ public final class RandomAssert {
                                             int[] expectedAfter,
                                             LongJumpableUniformRandomProvider rng) {
         final UniformRandomProvider copy = rng.longJump();
-        Assert.assertNotSame("The copy instance should be a different object", rng, copy);
-        Assert.assertEquals("The copy instance should be the same class", rng.getClass(), copy.getClass());
-        assertEquals("Pre-jump value at position ", expectedBefore, copy);
-        assertEquals("Post-jump value at position ", expectedAfter, rng);
+        Assertions.assertNotSame(rng, copy, "The copy instance should be a different object");
+        Assertions.assertEquals(rng.getClass(), copy.getClass(), "The copy instance should be the same class");
+        assertEquals(expectedBefore, copy, "Pre-jump value at position ");
+        assertEquals(expectedAfter, rng, "Post-jump value at position ");
     }
 
     /**
@@ -205,10 +207,10 @@ public final class RandomAssert {
                                             long[] expectedAfter,
                                             LongJumpableUniformRandomProvider rng) {
         final UniformRandomProvider copy = rng.longJump();
-        Assert.assertNotSame("The copy instance should be a different object", rng, copy);
-        Assert.assertEquals("The copy instance should be the same class", rng.getClass(), copy.getClass());
-        assertEquals("Pre-jump value at position ", expectedBefore, copy);
-        assertEquals("Post-jump value at position ", expectedAfter, rng);
+        Assertions.assertNotSame(rng, copy, "The copy instance should be a different object");
+        Assertions.assertEquals(rng.getClass(), copy.getClass(), "The copy instance should be the same class");
+        assertEquals(expectedBefore, copy, "Pre-jump value at position ");
+        assertEquals(expectedAfter, rng, "Post-jump value at position ");
     }
 
     /**
@@ -221,7 +223,8 @@ public final class RandomAssert {
      */
     public static void assertNextIntEquals(int cycles, UniformRandomProvider rng1, UniformRandomProvider rng2) {
         for (int i = 0; i < cycles; i++) {
-            Assert.assertEquals("Value at position " + i, rng1.nextInt(), rng2.nextInt());
+            final int index = i;
+            Assertions.assertEquals(rng1.nextInt(), rng2.nextInt(), () -> "Value at position " + index);
         }
     }
 
@@ -235,7 +238,8 @@ public final class RandomAssert {
      */
     public static void assertNextLongEquals(int cycles, UniformRandomProvider rng1, UniformRandomProvider rng2) {
         for (int i = 0; i < cycles; i++) {
-            Assert.assertEquals("Value at position " + i, rng1.nextLong(), rng2.nextLong());
+            final int index = i;
+            Assertions.assertEquals(rng1.nextLong(), rng2.nextLong(), () -> "Value at position " + index);
         }
     }
 
@@ -249,7 +253,7 @@ public final class RandomAssert {
      */
     public static void assertNextIntZeroOutput(UniformRandomProvider rng, int cycles) {
         for (int i = 0; i < cycles; i++) {
-            Assert.assertEquals("Expected the generator to output zeros", 0, rng.nextInt());
+            Assertions.assertEquals(0, rng.nextInt(), "Expected the generator to output zeros");
         }
     }
 
@@ -263,7 +267,7 @@ public final class RandomAssert {
      */
     public static void assertNextLongZeroOutput(UniformRandomProvider rng, int cycles) {
         for (int i = 0; i < cycles; i++) {
-            Assert.assertEquals("Expected the generator to output zeros", 0, rng.nextLong());
+            Assertions.assertEquals(0, rng.nextLong(), "Expected the generator to output zeros");
         }
     }
 
@@ -287,7 +291,7 @@ public final class RandomAssert {
                 return;
             }
         }
-        Assert.fail("No non-zero output after " + (warmupCycles + testCycles) + " cycles");
+        Assertions.fail("No non-zero output after " + (warmupCycles + testCycles) + " cycles");
     }
 
     /**
@@ -308,7 +312,7 @@ public final class RandomAssert {
         try {
             assertNextLongNonZeroOutput(rng, warmupCycles, testCycles);
         } catch (AssertionError ex) {
-            Assert.fail("No non-zero output after " + (warmupCycles + testCycles) + " cycles. " +
+            Assertions.fail("No non-zero output after " + (warmupCycles + testCycles) + " cycles. " +
                         "Seed element [" + seedElement + "], bit=" + bit);
         }
     }
@@ -360,16 +364,11 @@ public final class RandomAssert {
                         return;
                     }
                 }
-                Assert.assertEquals("Seed element was not reset", 0, seed[i]);
+                Assertions.assertEquals(0, seed[i], "Seed element was not reset");
             }
-        } catch (IllegalAccessException ex) {
-            Assert.fail(ex.getMessage());
-        } catch (NoSuchMethodException ex) {
-            Assert.fail(ex.getMessage());
-        } catch (InstantiationException ex) {
-            Assert.fail(ex.getMessage());
-        } catch (InvocationTargetException ex) {
-            Assert.fail(ex.getMessage());
+        } catch (IllegalAccessException | NoSuchMethodException | InstantiationException |
+                InvocationTargetException ex) {
+            Assertions.fail(ex.getMessage());
         }
     }
 
@@ -396,16 +395,11 @@ public final class RandomAssert {
                     // Eventually reset to zero
                     seed[i] >>>= 1;
                 }
-                Assert.assertEquals("Seed element was not reset", 0L, seed[i]);
+                Assertions.assertEquals(0L, seed[i], "Seed element was not reset");
             }
-        } catch (IllegalAccessException ex) {
-            Assert.fail(ex.getMessage());
-        } catch (NoSuchMethodException ex) {
-            Assert.fail(ex.getMessage());
-        } catch (InstantiationException ex) {
-            Assert.fail(ex.getMessage());
-        } catch (InvocationTargetException ex) {
-            Assert.fail(ex.getMessage());
+        } catch (IllegalAccessException | NoSuchMethodException | InstantiationException |
+                InvocationTargetException ex) {
+            Assertions.fail(ex.getMessage());
         }
     }
 }
diff --git a/commons-rng-core/src/test/java/org/apache/commons/rng/core/RandomProviderDefaultStateTest.java b/commons-rng-core/src/test/java/org/apache/commons/rng/core/RandomProviderDefaultStateTest.java
index 8e6737a..e13e4f9 100644
--- a/commons-rng-core/src/test/java/org/apache/commons/rng/core/RandomProviderDefaultStateTest.java
+++ b/commons-rng-core/src/test/java/org/apache/commons/rng/core/RandomProviderDefaultStateTest.java
@@ -18,7 +18,7 @@ package org.apache.commons.rng.core;
 
 
 import org.junit.Test;
-import org.junit.Assert;
+import org.junit.jupiter.api.Assertions;
 
 /**
  * Tests for {@link RandomProviderDefaultState}.
@@ -29,6 +29,6 @@ public class RandomProviderDefaultStateTest {
         final byte[] internalState = {1, 0, -23, 67, -128, 54, 100, 127};
         final RandomProviderDefaultState state = new RandomProviderDefaultState(internalState);
 
-        Assert.assertArrayEquals(internalState, state.getState());
+        Assertions.assertArrayEquals(internalState, state.getState());
     }
 }
diff --git a/commons-rng-core/src/test/java/org/apache/commons/rng/core/source32/IntProviderTest.java b/commons-rng-core/src/test/java/org/apache/commons/rng/core/source32/IntProviderTest.java
index 7c01313..041b9fd 100644
--- a/commons-rng-core/src/test/java/org/apache/commons/rng/core/source32/IntProviderTest.java
+++ b/commons-rng-core/src/test/java/org/apache/commons/rng/core/source32/IntProviderTest.java
@@ -16,7 +16,7 @@
  */
 package org.apache.commons.rng.core.source32;
 
-import org.junit.Assert;
+import org.junit.jupiter.api.Assertions;
 import org.junit.Test;
 
 /**
@@ -64,12 +64,14 @@ public class IntProviderTest {
             // Test the result for a single pass over the long
             for (int j = 0; j < Integer.SIZE; j++) {
                 final boolean expected = i == j;
-                Assert.assertEquals("Pass 1, bit " + j, expected, provider.nextBoolean());
+                final int index = j;
+                Assertions.assertEquals(expected, provider.nextBoolean(), () -> "Pass 1, bit " + index);
             }
             // The second pass should use the opposite bits
             for (int j = 0; j < Integer.SIZE; j++) {
                 final boolean expected = i != j;
-                Assert.assertEquals("Pass 2, bit " + j, expected, provider.nextBoolean());
+                final int index = j;
+                Assertions.assertEquals(expected, provider.nextBoolean(), () -> "Pass 2, bit " + index);
             }
         }
     }
diff --git a/commons-rng-core/src/test/java/org/apache/commons/rng/core/source32/JDKRandomTest.java b/commons-rng-core/src/test/java/org/apache/commons/rng/core/source32/JDKRandomTest.java
index 39baabd..5ba63dd 100644
--- a/commons-rng-core/src/test/java/org/apache/commons/rng/core/source32/JDKRandomTest.java
+++ b/commons-rng-core/src/test/java/org/apache/commons/rng/core/source32/JDKRandomTest.java
@@ -24,9 +24,10 @@ import java.io.Serializable;
 import java.util.Random;
 
 import org.apache.commons.rng.RandomProviderState;
+import org.apache.commons.rng.core.RandomAssert;
 import org.apache.commons.rng.core.RandomProviderDefaultState;
 import org.apache.commons.rng.core.util.NumberFactory;
-import org.junit.Assert;
+import org.junit.jupiter.api.Assertions;
 import org.junit.Test;
 
 public class JDKRandomTest {
@@ -41,7 +42,7 @@ public class JDKRandomTest {
         private int state0;
         private double state1;
         private long state2;
-        private boolean stte3;
+        private boolean state3;
 
         /**
          * This simulates doing something malicious when deserializing.
@@ -53,7 +54,7 @@ public class JDKRandomTest {
         private void readObject(ObjectInputStream input)
                 throws IOException,
                        ClassNotFoundException {
-            Assert.fail("This should not be run during the test");
+            Assertions.fail("*** Malicious code ***. This should not be run during the test");
         }
     }
 
@@ -66,8 +67,8 @@ public class JDKRandomTest {
         // This is a trivial test since "JDKRandom" delegates to "Random".
 
         final int numRepeats = 1000;
-        for (int r = 0; r < numRepeats; r++) {
-            Assert.assertEquals(r + " nextInt", jdk.nextInt(), rng.nextInt());
+        for (int[] r = {0}; r[0] < numRepeats; r[0]++) {
+            Assertions.assertEquals(jdk.nextInt(), rng.nextInt(), () -> r[0] + " nextInt");
         }
     }
 
@@ -83,8 +84,8 @@ public class JDKRandomTest {
 
         // Ensure different
         final int numRepeats = 10;
-        for (int r = 0; r < numRepeats; r++) {
-            Assert.assertNotEquals(r + " nextInt", rng1.nextInt(), rng2.nextInt());
+        for (int[] r = {0}; r[0] < numRepeats; r[0]++) {
+            Assertions.assertNotEquals(rng1.nextInt(), rng2.nextInt(), () -> r[0] + " nextInt");
         }
 
         final RandomProviderState state = rng1.saveState();
@@ -94,9 +95,7 @@ public class JDKRandomTest {
         rng2.restoreState(state);
 
         // Ensure the same
-        for (int r = 0; r < numRepeats; r++) {
-            Assert.assertEquals(r + " nextInt", rng1.nextInt(), rng2.nextInt());
-        }
+        RandomAssert.assertNextIntEquals(numRepeats, rng1, rng2);
     }
 
     /**
@@ -109,9 +108,9 @@ public class JDKRandomTest {
     public void testRestoreWithInvalidClass() throws IOException  {
         // Serialize something
         final ByteArrayOutputStream bos = new ByteArrayOutputStream();
-        final ObjectOutputStream oos = new ObjectOutputStream(bos);
-        oos.writeObject(new SerializableTestObject());
-        oos.close();
+        try (ObjectOutputStream oos = new ObjectOutputStream(bos)) {
+            oos.writeObject(new SerializableTestObject());
+        }
 
         // Compose the size with the state.
         // This is what is expected by the JDKRandom class.
diff --git a/commons-rng-core/src/test/java/org/apache/commons/rng/core/source32/MersenneTwisterTest.java b/commons-rng-core/src/test/java/org/apache/commons/rng/core/source32/MersenneTwisterTest.java
index 04f382e..3d356c7 100644
--- a/commons-rng-core/src/test/java/org/apache/commons/rng/core/source32/MersenneTwisterTest.java
+++ b/commons-rng-core/src/test/java/org/apache/commons/rng/core/source32/MersenneTwisterTest.java
@@ -17,7 +17,7 @@
 package org.apache.commons.rng.core.source32;
 
 import org.apache.commons.rng.core.RandomAssert;
-import org.junit.Assert;
+import org.junit.jupiter.api.Assertions;
 import org.junit.Test;
 
 public class MersenneTwisterTest {
@@ -166,7 +166,7 @@ public class MersenneTwisterTest {
         // An empty seed is allowed
         final MersenneTwister rng = new MersenneTwister(new int[0]);
         // It should be functional so check it returns different values.
-        Assert.assertNotEquals("Empty seed creates sequence with same values",
-            rng.nextInt(), rng.nextInt());
+        Assertions.assertNotEquals(rng.nextInt(), rng.nextInt(),
+            "Empty seed creates sequence with same values");
     }
 }
diff --git a/commons-rng-core/src/test/java/org/apache/commons/rng/core/source32/MiddleSquareWeylSequenceTest.java b/commons-rng-core/src/test/java/org/apache/commons/rng/core/source32/MiddleSquareWeylSequenceTest.java
index fcb4d81..50f842b 100644
--- a/commons-rng-core/src/test/java/org/apache/commons/rng/core/source32/MiddleSquareWeylSequenceTest.java
+++ b/commons-rng-core/src/test/java/org/apache/commons/rng/core/source32/MiddleSquareWeylSequenceTest.java
@@ -18,7 +18,7 @@ package org.apache.commons.rng.core.source32;
 
 import org.apache.commons.rng.core.RandomAssert;
 import org.apache.commons.rng.core.util.NumberFactory;
-import org.junit.Assert;
+import org.junit.jupiter.api.Assertions;
 import org.junit.Test;
 
 public class MiddleSquareWeylSequenceTest {
@@ -93,7 +93,7 @@ public class MiddleSquareWeylSequenceTest {
         final MiddleSquareWeylSequence rng1 = new MiddleSquareWeylSequence(seed);
         final MiddleSquareWeylSequence rng2 = new MiddleSquareWeylSequence(seed);
         for (int i = 0; i < 50; i++) {
-            Assert.assertEquals(NumberFactory.makeLong(rng1.nextInt(), rng1.nextInt()),
+            Assertions.assertEquals(NumberFactory.makeLong(rng1.nextInt(), rng1.nextInt()),
                                 rng2.nextLong());
         }
     }
diff --git a/commons-rng-core/src/test/java/org/apache/commons/rng/core/source64/LongProviderTest.java b/commons-rng-core/src/test/java/org/apache/commons/rng/core/source64/LongProviderTest.java
index 21e16ae..356efda 100644
--- a/commons-rng-core/src/test/java/org/apache/commons/rng/core/source64/LongProviderTest.java
+++ b/commons-rng-core/src/test/java/org/apache/commons/rng/core/source64/LongProviderTest.java
@@ -16,7 +16,7 @@
  */
 package org.apache.commons.rng.core.source64;
 
-import org.junit.Assert;
+import org.junit.jupiter.api.Assertions;
 import org.junit.Test;
 
 /**
@@ -82,10 +82,10 @@ public class LongProviderTest {
                 // Pack into upper then lower bits
                 final long value = (((long) i) << 32) | (j & 0xffffffffL);
                 final LongProvider provider = new FixedLongProvider(value);
-                Assert.assertEquals("1st call not the upper 32-bits", i, provider.nextInt());
-                Assert.assertEquals("2nd call not the lower 32-bits", j, provider.nextInt());
-                Assert.assertEquals("3rd call not the upper 32-bits", i, provider.nextInt());
-                Assert.assertEquals("4th call not the lower 32-bits", j, provider.nextInt());
+                Assertions.assertEquals(i, provider.nextInt(), "1st call not the upper 32-bits");
+                Assertions.assertEquals(j, provider.nextInt(), "2nd call not the lower 32-bits");
+                Assertions.assertEquals(i, provider.nextInt(), "3rd call not the upper 32-bits");
+                Assertions.assertEquals(j, provider.nextInt(), "4th call not the lower 32-bits");
             }
         }
     }
@@ -105,12 +105,14 @@ public class LongProviderTest {
             // Test the result for a single pass over the long
             for (int j = 0; j < Long.SIZE; j++) {
                 final boolean expected = i == j;
-                Assert.assertEquals("Pass 1, bit " + j, expected, provider.nextBoolean());
+                final int index = j;
+                Assertions.assertEquals(expected, provider.nextBoolean(), () -> "Pass 1, bit " + index);
             }
             // The second pass should use the opposite bits
             for (int j = 0; j < Long.SIZE; j++) {
                 final boolean expected = i != j;
-                Assert.assertEquals("Pass 2, bit " + j, expected, provider.nextBoolean());
+                final int index = j;
+                Assertions.assertEquals(expected, provider.nextBoolean(), () -> "Pass 2, bit " + index);
             }
         }
     }
diff --git a/commons-rng-core/src/test/java/org/apache/commons/rng/core/source64/MersenneTwister64Test.java b/commons-rng-core/src/test/java/org/apache/commons/rng/core/source64/MersenneTwister64Test.java
index 0381f48..a7b8662 100644
--- a/commons-rng-core/src/test/java/org/apache/commons/rng/core/source64/MersenneTwister64Test.java
+++ b/commons-rng-core/src/test/java/org/apache/commons/rng/core/source64/MersenneTwister64Test.java
@@ -17,7 +17,7 @@
 package org.apache.commons.rng.core.source64;
 
 import org.apache.commons.rng.core.RandomAssert;
-import org.junit.Assert;
+import org.junit.jupiter.api.Assertions;
 import org.junit.Test;
 
 public class MersenneTwister64Test {
@@ -291,7 +291,7 @@ public class MersenneTwister64Test {
         // An empty seed is allowed
         final MersenneTwister64 rng = new MersenneTwister64(new long[0]);
         // It should be functional so check it returns different values.
-        Assert.assertNotEquals("Empty seed creates sequence with same values",
-            rng.nextLong(), rng.nextLong());
+        Assertions.assertNotEquals(rng.nextLong(), rng.nextLong(),
+            "Empty seed creates sequence with same values");
     }
 }
diff --git a/commons-rng-core/src/test/java/org/apache/commons/rng/core/source64/TwoCmresTest.java b/commons-rng-core/src/test/java/org/apache/commons/rng/core/source64/TwoCmresTest.java
index f14d8d2..19dd1f5 100644
--- a/commons-rng-core/src/test/java/org/apache/commons/rng/core/source64/TwoCmresTest.java
+++ b/commons-rng-core/src/test/java/org/apache/commons/rng/core/source64/TwoCmresTest.java
@@ -18,7 +18,7 @@ package org.apache.commons.rng.core.source64;
 
 import org.apache.commons.rng.core.RandomAssert;
 import org.apache.commons.rng.core.source64.TwoCmres.Cmres;
-import org.junit.Assert;
+import org.junit.jupiter.api.Assertions;
 import org.junit.Test;
 
 import java.util.ArrayList;
@@ -36,8 +36,8 @@ public class TwoCmresTest {
 
         // Try a few values.
         final int n = 1000;
-        for (int i = 0; i < n; i++) {
-            Assert.assertNotEquals("i=" + i, rng1.nextLong(), rng2.nextLong());
+        for (int[] i = {0}; i[0] < n; i[0]++) {
+            Assertions.assertNotEquals(rng1.nextLong(), rng2.nextLong(), () -> "i=" + i[0]);
         }
     }
 
@@ -70,7 +70,7 @@ public class TwoCmresTest {
         for (int i = 0; i < max; i++) {
             try {
                 new TwoCmres(-97845, i, i);
-                Assert.fail("Exception expected");
+                Assertions.fail("Exception expected");
             } catch (IllegalArgumentException e) {
                 // Expected.
             }
@@ -96,14 +96,14 @@ public class TwoCmresTest {
         for (int wrongIndex : new int[] {-1, max}) {
             try {
                 new TwoCmres(seed, wrongIndex, 1);
-                Assert.fail("Exception expected for index=" + wrongIndex);
+                Assertions.fail("Exception expected for index=" + wrongIndex);
             } catch (IndexOutOfBoundsException e) {
                 // Expected.
             }
 
             try {
                 new TwoCmres(seed, 1, wrongIndex);
-                Assert.fail("Exception expected for index=" + wrongIndex);
+                Assertions.fail("Exception expected for index=" + wrongIndex);
             } catch (IndexOutOfBoundsException e) {
                 // Expected.
             }
@@ -123,7 +123,7 @@ public class TwoCmresTest {
         try {
             Cmres.Factory.checkUnique(list, nextMultiply);
         } catch (IllegalStateException ex) {
-            Assert.fail("The next multiply should be unique: " + nextMultiply);
+            Assertions.fail("The next multiply should be unique: " + nextMultiply);
         }
 
         list.add(new Cmres(nextMultiply, rotate, start));
diff --git a/commons-rng-core/src/test/java/org/apache/commons/rng/core/util/NumberFactoryTest.java b/commons-rng-core/src/test/java/org/apache/commons/rng/core/util/NumberFactoryTest.java
index 8d959eb..5bf1eea 100644
--- a/commons-rng-core/src/test/java/org/apache/commons/rng/core/util/NumberFactoryTest.java
+++ b/commons-rng-core/src/test/java/org/apache/commons/rng/core/util/NumberFactoryTest.java
@@ -17,7 +17,7 @@
 package org.apache.commons.rng.core.util;
 
 import org.apache.commons.math3.util.Precision;
-import org.junit.Assert;
+import org.junit.jupiter.api.Assertions;
 import org.junit.Test;
 
 /**
@@ -42,7 +42,7 @@ public class NumberFactoryTest {
         // Test if the bit is set differently then the booleans are opposite
         final boolean b1 = NumberFactory.makeBoolean(0);
         final boolean b2 = NumberFactory.makeBoolean(0xffffffff);
-        Assert.assertNotEquals(b1, b2);
+        Assertions.assertNotEquals(b1, b2);
     }
 
     @Test
@@ -50,20 +50,20 @@ public class NumberFactoryTest {
         // Test if the bit is set differently then the booleans are opposite
         final boolean b1 = NumberFactory.makeBoolean(0L);
         final boolean b2 = NumberFactory.makeBoolean(0xffffffffffffffffL);
-        Assert.assertNotEquals(b1, b2);
+        Assertions.assertNotEquals(b1, b2);
     }
 
     @Test
     public void testMakeIntFromLong() {
         // Test the high order bits and low order bits are xor'd together
-        Assert.assertEquals(0xffffffff, NumberFactory.makeInt(0xffffffff00000000L));
-        Assert.assertEquals(0x00000000, NumberFactory.makeInt(0xffffffffffffffffL));
-        Assert.assertEquals(0xffffffff, NumberFactory.makeInt(0x00000000ffffffffL));
-        Assert.assertEquals(0x00000000, NumberFactory.makeInt(0x0000000000000000L));
-        Assert.assertEquals(0x0f0f0f0f, NumberFactory.makeInt(0x0f0f0f0f00000000L));
-        Assert.assertEquals(0xf0f0f0f0, NumberFactory.makeInt(0x00000000f0f0f0f0L));
-        Assert.assertEquals(0x00000000, NumberFactory.makeInt(0x0f0f0f0f0f0f0f0fL));
-        Assert.assertEquals(0xffffffff, NumberFactory.makeInt(0x0f0f0f0ff0f0f0f0L));
+        Assertions.assertEquals(0xffffffff, NumberFactory.makeInt(0xffffffff00000000L));
+        Assertions.assertEquals(0x00000000, NumberFactory.makeInt(0xffffffffffffffffL));
+        Assertions.assertEquals(0xffffffff, NumberFactory.makeInt(0x00000000ffffffffL));
+        Assertions.assertEquals(0x00000000, NumberFactory.makeInt(0x0000000000000000L));
+        Assertions.assertEquals(0x0f0f0f0f, NumberFactory.makeInt(0x0f0f0f0f00000000L));
+        Assertions.assertEquals(0xf0f0f0f0, NumberFactory.makeInt(0x00000000f0f0f0f0L));
+        Assertions.assertEquals(0x00000000, NumberFactory.makeInt(0x0f0f0f0f0f0f0f0fL));
+        Assertions.assertEquals(0xffffffff, NumberFactory.makeInt(0x0f0f0f0ff0f0f0f0L));
     }
 
     @Test
@@ -73,7 +73,7 @@ public class NumberFactoryTest {
             final int vH = NumberFactory.extractHi(v);
 
             final long actual = (((long) vH) << 32) | (vL & 0xffffffffL);
-            Assert.assertEquals(v, actual);
+            Assertions.assertEquals(v, actual);
         }
     }
 
@@ -83,7 +83,7 @@ public class NumberFactoryTest {
             final int vL = NumberFactory.extractLo(v);
             final int vH = NumberFactory.extractHi(v);
 
-            Assert.assertEquals(v, NumberFactory.makeLong(vH, vL));
+            Assertions.assertEquals(v, NumberFactory.makeLong(vH, vL));
         }
     }
 
@@ -95,7 +95,7 @@ public class NumberFactoryTest {
             final byte[] b = NumberFactory.makeByteArray(value);
             for (int j = 0; j < LONG_SIZE; j++) {
                 // Only one byte should be non zero
-                Assert.assertEquals(b[j] != 0, j == i);
+                Assertions.assertEquals(b[j] != 0, j == i);
             }
             // Shift to the next byte
             value <<= 8;
@@ -106,14 +106,14 @@ public class NumberFactoryTest {
     public void testLongFromByteArray2Long() {
         for (long expected : LONG_TEST_VALUES) {
             final byte[] b = NumberFactory.makeByteArray(expected);
-            Assert.assertEquals(expected, NumberFactory.makeLong(b));
+            Assertions.assertEquals(expected, NumberFactory.makeLong(b));
         }
     }
 
     @Test
     public void testLongArrayFromByteArray2LongArray() {
         final byte[] b = NumberFactory.makeByteArray(LONG_TEST_VALUES);
-        Assert.assertArrayEquals(LONG_TEST_VALUES, NumberFactory.makeLongArray(b));
+        Assertions.assertArrayEquals(LONG_TEST_VALUES, NumberFactory.makeLongArray(b));
     }
 
     @Test
@@ -122,7 +122,7 @@ public class NumberFactoryTest {
         for (int i = 0; i < LONG_TEST_VALUES.length; i++) {
             final byte[] b1 = NumberFactory.makeByteArray(LONG_TEST_VALUES[i]);
             final byte[] b2 = NumberFactory.makeByteArray(new long[] {LONG_TEST_VALUES[i]});
-            Assert.assertArrayEquals(b1, b2);
+            Assertions.assertArrayEquals(b1, b2);
         }
     }
 
@@ -134,7 +134,7 @@ public class NumberFactoryTest {
             final byte[] b = NumberFactory.makeByteArray(value);
             for (int j = 0; j < INT_SIZE; j++) {
                 // Only one byte should be non zero
-                Assert.assertEquals(b[j] != 0, j == i);
+                Assertions.assertEquals(b[j] != 0, j == i);
             }
             // Shift to the next byte
             value <<= 8;
@@ -145,14 +145,14 @@ public class NumberFactoryTest {
     public void testIntFromByteArray2Int() {
         for (int expected : INT_TEST_VALUES) {
             final byte[] b = NumberFactory.makeByteArray(expected);
-            Assert.assertEquals(expected, NumberFactory.makeInt(b));
+            Assertions.assertEquals(expected, NumberFactory.makeInt(b));
         }
     }
 
     @Test
     public void testIntArrayFromByteArray2IntArray() {
         final byte[] b = NumberFactory.makeByteArray(INT_TEST_VALUES);
-        Assert.assertArrayEquals(INT_TEST_VALUES, NumberFactory.makeIntArray(b));
+        Assertions.assertArrayEquals(INT_TEST_VALUES, NumberFactory.makeIntArray(b));
     }
 
     @Test
@@ -161,7 +161,7 @@ public class NumberFactoryTest {
         for (int i = 0; i < INT_TEST_VALUES.length; i++) {
             final byte[] b1 = NumberFactory.makeByteArray(INT_TEST_VALUES[i]);
             final byte[] b2 = NumberFactory.makeByteArray(new int[] {INT_TEST_VALUES[i]});
-            Assert.assertArrayEquals(b1, b2);
+            Assertions.assertArrayEquals(b1, b2);
         }
     }
 
@@ -171,7 +171,7 @@ public class NumberFactoryTest {
             try {
                 NumberFactory.makeInt(new byte[i]);
                 if (i != INT_SIZE) {
-                    Assert.fail("Exception expected");
+                    Assertions.fail("Exception expected");
                 }
             } catch (IllegalArgumentException e) {
                 // Expected.
@@ -185,7 +185,7 @@ public class NumberFactoryTest {
             try {
                 NumberFactory.makeIntArray(new byte[i]);
                 if (i != 0 && i % INT_SIZE != 0) {
-                    Assert.fail("Exception expected");
+                    Assertions.fail("Exception expected");
                 }
             } catch (IllegalArgumentException e) {
                 // Expected.
@@ -199,7 +199,7 @@ public class NumberFactoryTest {
             try {
                 NumberFactory.makeLong(new byte[i]);
                 if (i != LONG_SIZE) {
-                    Assert.fail("Exception expected");
+                    Assertions.fail("Exception expected");
                 }
             } catch (IllegalArgumentException e) {
                 // Expected.
@@ -213,7 +213,7 @@ public class NumberFactoryTest {
             try {
                 NumberFactory.makeLongArray(new byte[i]);
                 if (i != 0 && i % LONG_SIZE != 0) {
-                    Assert.fail("Exception expected");
+                    Assertions.fail("Exception expected");
                 }
             } catch (IllegalArgumentException e) {
                 // Expected.
@@ -235,9 +235,9 @@ public class NumberFactoryTest {
         assertCloseToNotAbove1(Float.intBitsToFloat(0x7f << 23 | allBits >>> 9) - 1.0f, 2);
 
         final int noBits = 0;
-        Assert.assertEquals(0.0f, (noBits >>> 9) * 0x1.0p-23f, 0);
-        Assert.assertEquals(0.0f, (noBits >>> 8) * 0x1.0p-24f, 0);
-        Assert.assertEquals(0.0f, Float.intBitsToFloat(0x7f << 23 | noBits >>> 9) - 1.0f, 0);
+        Assertions.assertEquals(0.0f, (noBits >>> 9) * 0x1.0p-23f);
+        Assertions.assertEquals(0.0f, (noBits >>> 8) * 0x1.0p-24f);
+        Assertions.assertEquals(0.0f, Float.intBitsToFloat(0x7f << 23 | noBits >>> 9) - 1.0f);
     }
 
     /**
@@ -254,9 +254,9 @@ public class NumberFactoryTest {
         assertCloseToNotAbove1(Double.longBitsToDouble(0x3ffL << 52 | allBits >>> 12) - 1.0, 2);
 
         final long noBits = 0;
-        Assert.assertEquals(0.0, (noBits >>> 12) * 0x1.0p-52d, 0);
-        Assert.assertEquals(0.0, (noBits >>> 11) * 0x1.0p-53d, 0);
-        Assert.assertEquals(0.0, Double.longBitsToDouble(0x3ffL << 52 | noBits >>> 12) - 1.0, 0);
+        Assertions.assertEquals(0.0, (noBits >>> 12) * 0x1.0p-52d);
+        Assertions.assertEquals(0.0, (noBits >>> 11) * 0x1.0p-53d);
+        Assertions.assertEquals(0.0, Double.longBitsToDouble(0x3ffL << 52 | noBits >>> 12) - 1.0);
     }
 
     @Test
@@ -265,7 +265,7 @@ public class NumberFactoryTest {
         final long noBits = 0;
         // Within 1 ULP of 1.0
         assertCloseToNotAbove1(NumberFactory.makeDouble(allBits), 1);
-        Assert.assertEquals(0.0, NumberFactory.makeDouble(noBits), 0);
+        Assertions.assertEquals(0.0, NumberFactory.makeDouble(noBits));
     }
 
     @Test
@@ -274,7 +274,7 @@ public class NumberFactoryTest {
         final int noBits = 0;
         // Within 1 ULP of 1.0
         assertCloseToNotAbove1(NumberFactory.makeDouble(allBits, allBits), 1);
-        Assert.assertEquals(0.0, NumberFactory.makeDouble(noBits, noBits), 0);
+        Assertions.assertEquals(0.0, NumberFactory.makeDouble(noBits, noBits));
     }
 
     @Test
@@ -283,7 +283,7 @@ public class NumberFactoryTest {
         final int noBits = 0;
         // Within 1 ULP of 1.0f
         assertCloseToNotAbove1(NumberFactory.makeFloat(allBits), 1);
-        Assert.assertEquals(0.0f, NumberFactory.makeFloat(noBits), 0);
+        Assertions.assertEquals(0.0f, NumberFactory.makeFloat(noBits), 0);
     }
 
     /**
@@ -296,9 +296,9 @@ public class NumberFactoryTest {
      * @see Precision#equals(float, float, int)
      */
     private static void assertCloseToNotAbove1(float value, int maxUlps) {
-        Assert.assertTrue("Not <= 1.0f", value <= 1.0f);
-        Assert.assertTrue("Not equal to 1.0f within units of least precision: " + maxUlps,
-                          Precision.equals(1.0f, value, maxUlps));
+        Assertions.assertTrue(value <= 1.0f, "Not <= 1.0f");
+        Assertions.assertTrue(Precision.equals(1.0f, value, maxUlps),
+            () -> "Not equal to 1.0f within units of least precision: " + maxUlps);
     }
 
     /**
@@ -311,8 +311,8 @@ public class NumberFactoryTest {
      * @see Precision#equals(double, double, int)
      */
     private static void assertCloseToNotAbove1(double value, int maxUlps) {
-        Assert.assertTrue("Not <= 1.0", value <= 1.0);
-        Assert.assertTrue("Not equal to 1.0 within units of least precision: " + maxUlps,
-                          Precision.equals(1.0, value, maxUlps));
+        Assertions.assertTrue(value <= 1.0, "Not <= 1.0");
+        Assertions.assertTrue(Precision.equals(1.0, value, maxUlps),
+            () -> "Not equal to 1.0 within units of least precision: " + maxUlps);
     }
 }
diff --git a/commons-rng-examples/examples-stress/src/test/java/org/apache/commons/rng/examples/stress/HexTest.java b/commons-rng-examples/examples-stress/src/test/java/org/apache/commons/rng/examples/stress/HexTest.java
index 1fe5c58..24b118f 100644
--- a/commons-rng-examples/examples-stress/src/test/java/org/apache/commons/rng/examples/stress/HexTest.java
+++ b/commons-rng-examples/examples-stress/src/test/java/org/apache/commons/rng/examples/stress/HexTest.java
@@ -16,7 +16,7 @@
  */
 package org.apache.commons.rng.examples.stress;
 
-import org.junit.Assert;
+import org.junit.jupiter.api.Assertions;
 import org.junit.Test;
 
 import java.util.Arrays;
@@ -64,7 +64,7 @@ public class HexTest {
         final StringBuilder sb = new StringBuilder();
         sb.append(Hex.encodeHex(bytes));
         final byte[] decoded = Hex.decodeHex(sb);
-        Assert.assertArrayEquals(bytes, decoded);
+        Assertions.assertArrayEquals(bytes, decoded);
     }
 
     /**
@@ -104,7 +104,7 @@ public class HexTest {
         final String text = String.valueOf(chars);
         final byte[] decoded = Hex.decodeHex(text);
         // Test the encoding is lower case
-        Assert.assertArrayEquals(text.toLowerCase(Locale.US).toCharArray(), Hex.encodeHex(decoded));
+        Assertions.assertArrayEquals(text.toLowerCase(Locale.US).toCharArray(), Hex.encodeHex(decoded));
     }
 
     @Test(expected = IllegalArgumentException.class)
diff --git a/commons-rng-examples/examples-stress/src/test/java/org/apache/commons/rng/examples/stress/RngDataOutputTest.java b/commons-rng-examples/examples-stress/src/test/java/org/apache/commons/rng/examples/stress/RngDataOutputTest.java
index 4115a85..90619a4 100644
--- a/commons-rng-examples/examples-stress/src/test/java/org/apache/commons/rng/examples/stress/RngDataOutputTest.java
+++ b/commons-rng-examples/examples-stress/src/test/java/org/apache/commons/rng/examples/stress/RngDataOutputTest.java
@@ -21,7 +21,7 @@ import org.apache.commons.rng.core.source32.IntProvider;
 import org.apache.commons.rng.core.source32.RandomIntSource;
 import org.apache.commons.rng.core.source64.RandomLongSource;
 import org.apache.commons.rng.simple.RandomSource;
-import org.junit.Assert;
+import org.junit.jupiter.api.Assertions;
 import org.junit.Test;
 
 import java.io.ByteArrayOutputStream;
@@ -117,7 +117,7 @@ public class RngDataOutputTest {
         try {
             sink.writeInt(rng.nextInt());
         } catch (IOException e) {
-            Assert.fail();
+            Assertions.fail();
         }
     }
 
@@ -125,7 +125,7 @@ public class RngDataOutputTest {
         try {
             sink.writeLong(rng.nextLong());
         } catch (IOException e) {
-            Assert.fail();
+            Assertions.fail();
         }
     }
 
@@ -157,7 +157,7 @@ public class RngDataOutputTest {
         for (int repeats = 1; repeats <= 2; repeats++) {
             byte[] expected = createBytes(rng1, size, repeats, rngConverter, pipe);
             byte[] actual = writeRngOutput(rng2, size, repeats, byteOrder, factory);
-            Assert.assertArrayEquals(expected, actual);
+            Assertions.assertArrayEquals(expected, actual);
         }
     }
 
diff --git a/commons-rng-sampling/src/test/java/org/apache/commons/rng/sampling/CollectionSamplerTest.java b/commons-rng-sampling/src/test/java/org/apache/commons/rng/sampling/CollectionSamplerTest.java
index c2d66c4..90a5a3b 100644
--- a/commons-rng-sampling/src/test/java/org/apache/commons/rng/sampling/CollectionSamplerTest.java
+++ b/commons-rng-sampling/src/test/java/org/apache/commons/rng/sampling/CollectionSamplerTest.java
@@ -20,7 +20,7 @@ import java.util.ArrayList;
 import java.util.Arrays;
 import java.util.List;
 
-import org.junit.Assert;
+import org.junit.jupiter.api.Assertions;
 import org.junit.Test;
 import org.apache.commons.rng.UniformRandomProvider;
 import org.apache.commons.rng.simple.RandomSource;
@@ -46,7 +46,7 @@ public class CollectionSamplerTest {
                 return;
             }
         }
-        Assert.fail(word + " not in list");
+        Assertions.fail(word + " not in list");
     }
 
     @Test(expected = IllegalArgumentException.class)
diff --git a/commons-rng-sampling/src/test/java/org/apache/commons/rng/sampling/CombinationSamplerTest.java b/commons-rng-sampling/src/test/java/org/apache/commons/rng/sampling/CombinationSamplerTest.java
index 853f011..ba2f707 100644
--- a/commons-rng-sampling/src/test/java/org/apache/commons/rng/sampling/CombinationSamplerTest.java
+++ b/commons-rng-sampling/src/test/java/org/apache/commons/rng/sampling/CombinationSamplerTest.java
@@ -18,7 +18,7 @@ package org.apache.commons.rng.sampling;
 
 import java.util.Arrays;
 
-import org.junit.Assert;
+import org.junit.jupiter.api.Assertions;
 import org.junit.Test;
 
 import org.apache.commons.math3.stat.inference.ChiSquareTest;
@@ -66,9 +66,9 @@ public class CombinationSamplerTest {
             final int k = n;
             final CombinationSampler sampler = new CombinationSampler(rng, n, k);
             final int[] sample = sampler.sample();
-            Assert.assertEquals("Incorrect sample length", n, sample.length);
+            Assertions.assertEquals(n, sample.length, "Incorrect sample length");
             for (int i = 0; i < n; i++) {
-                Assert.assertEquals("Sample was shuffled", i, sample[i]);
+                Assertions.assertEquals(i, sample[i], "Sample was shuffled");
             }
         }
     }
@@ -138,7 +138,7 @@ public class CombinationSamplerTest {
      */
     private static void assertIsInDomain(int n, int value) {
         if (value < 0 || value >= n) {
-            Assert.fail("sample " + value + " not in the domain " + n);
+            Assertions.fail("sample " + value + " not in the domain " + n);
         }
     }
 
@@ -160,8 +160,8 @@ public class CombinationSamplerTest {
         }
 
         // The number of combinations C(n, k) is the binomial coefficient
-        Assert.assertEquals("Incorrect number of combination codes",
-                CombinatoricsUtils.binomialCoefficient(n, k), codes);
+        Assertions.assertEquals(CombinatoricsUtils.binomialCoefficient(n, k), codes,
+            "Incorrect number of combination codes");
 
         final long[] observed = new long[codes];
         final int numSamples = 6000;
@@ -177,7 +177,7 @@ public class CombinationSamplerTest {
         Arrays.fill(expected, numExpected);
         final ChiSquareTest chiSquareTest = new ChiSquareTest();
         // Pass if we cannot reject null hypothesis that distributions are the same.
-        Assert.assertFalse(chiSquareTest.chiSquareTest(expected, observed, 0.001));
+        Assertions.assertFalse(chiSquareTest.chiSquareTest(expected, observed, 0.001));
     }
 
     private static int findCode(int[] codeLookup, int[] sample) {
@@ -190,11 +190,11 @@ public class CombinationSamplerTest {
             bits |= 1 << s;
         }
         if (bits >= codeLookup.length) {
-            Assert.fail("Bad bit combination: " + Arrays.toString(sample));
+            Assertions.fail("Bad bit combination: " + Arrays.toString(sample));
         }
         final int code = codeLookup[bits];
         if (code < 0) {
-            Assert.fail("Bad bit code: " + Arrays.toString(sample));
+            Assertions.fail("Bad bit code: " + Arrays.toString(sample));
         }
         return code;
     }
diff --git a/commons-rng-sampling/src/test/java/org/apache/commons/rng/sampling/CompositeSamplersTest.java b/commons-rng-sampling/src/test/java/org/apache/commons/rng/sampling/CompositeSamplersTest.java
index e5f06c4..0224ee9 100644
--- a/commons-rng-sampling/src/test/java/org/apache/commons/rng/sampling/CompositeSamplersTest.java
+++ b/commons-rng-sampling/src/test/java/org/apache/commons/rng/sampling/CompositeSamplersTest.java
@@ -19,7 +19,7 @@ package org.apache.commons.rng.sampling;
 
 import java.util.Arrays;
 import java.util.concurrent.atomic.AtomicInteger;
-import org.junit.Assert;
+import org.junit.jupiter.api.Assertions;
 import org.junit.Test;
 
 import org.apache.commons.math3.stat.inference.ChiSquareTest;
@@ -56,7 +56,7 @@ public class CompositeSamplersTest {
             for (int i = 0; i < n; i++) {
                 sum += sampler.sample();
             }
-            Assert.assertEquals(item.name(), mean, (double) sum / n, 1e-3);
+            Assertions.assertEquals(mean, (double) sum / n, 1e-3, item::name);
         }
     }
 
@@ -68,7 +68,7 @@ public class CompositeSamplersTest {
         final UniformRandomProvider rng = RandomSource.SPLIT_MIX_64.create(0L);
         final Builder<SharedStateObjectSampler<Integer>> builder = CompositeSamplers
                 .newSharedStateObjectSamplerBuilder();
-        Assert.assertEquals(0, builder.size());
+        Assertions.assertEquals(0, builder.size());
         builder.build(rng);
     }
 
@@ -92,15 +92,15 @@ public class CompositeSamplersTest {
                 .newSharedStateObjectSamplerBuilder();
         final RangeSampler sampler = new RangeSampler(45, 63, rng);
         // Zero weight is ignored
-        Assert.assertEquals(0, builder.size());
+        Assertions.assertEquals(0, builder.size());
         builder.add(sampler, 0.0);
-        Assert.assertEquals(0, builder.size());
+        Assertions.assertEquals(0, builder.size());
 
         final double[] bad = {-1, Double.NaN, Double.POSITIVE_INFINITY};
         for (final double weight : bad) {
             try {
                 builder.add(sampler, weight);
-                Assert.fail("Did not detect invalid weight: " + weight);
+                Assertions.fail("Did not detect invalid weight: " + weight);
             } catch (final IllegalArgumentException ex) {
                 // Expected
             }
@@ -117,9 +117,9 @@ public class CompositeSamplersTest {
                 .newSharedStateObjectSamplerBuilder();
         final RangeSampler sampler = new RangeSampler(45, 63, rng);
         builder.add(sampler, 1.0);
-        Assert.assertEquals(1, builder.size());
+        Assertions.assertEquals(1, builder.size());
         final SharedStateObjectSampler<Integer> composite = builder.build(rng);
-        Assert.assertSame(sampler, composite);
+        Assertions.assertSame(sampler, composite);
     }
 
     /**
@@ -180,7 +180,7 @@ public class CompositeSamplersTest {
         final UniformRandomProvider rng1 = RandomSource.XO_SHI_RO_256_PLUS.create(0x1f2e3d);
         assertObjectSamplerSamples(builder.build(rng).withUniformRandomProvider(rng1), min, max);
 
-        Assert.assertEquals("Factory should not be used to create the shared state sampler", 1, factoryCount.get());
+        Assertions.assertEquals(1, factoryCount.get(), "Factory should not be used to create the shared state sampler");
     }
 
     /**
@@ -219,7 +219,7 @@ public class CompositeSamplersTest {
         final UniformRandomProvider rng1 = RandomSource.XO_SHI_RO_256_PLUS.create(0x8c7b6a);
         assertObjectSamplerSamples(builder.build(rng).withUniformRandomProvider(rng1), min, max);
 
-        Assert.assertEquals("Factory should be used to create the shared state sampler", 2, factoryCount.get());
+        Assertions.assertEquals(2, factoryCount.get(), "Factory should be used to create the shared state sampler");
     }
 
     /**
@@ -254,7 +254,7 @@ public class CompositeSamplersTest {
         final double w4 = 0x1.0p1023;
         final double w2 = 0x1.0p1022;
         final double w1 = 0x1.0p1021;
-        Assert.assertEquals(Double.POSITIVE_INFINITY, w4 + w4 + w2 + w1, 0.0);
+        Assertions.assertEquals(Double.POSITIVE_INFINITY, w4 + w4 + w2 + w1);
         builder.add(new RangeSampler(0, 40, rng), w4);
         builder.add(new RangeSampler(40, 80, rng), w4);
         builder.add(new RangeSampler(80, 100, rng), w2);
@@ -279,11 +279,11 @@ public class CompositeSamplersTest {
         final double w1 = Double.MIN_VALUE;
         final double sum = w4 + w4 + w2 + w1;
         // Cannot do a divide by multiplying by the reciprocal
-        Assert.assertEquals(Double.POSITIVE_INFINITY, 1.0 / sum, 0.0);
+        Assertions.assertEquals(Double.POSITIVE_INFINITY, 1.0 / sum);
         // A divide works so the sampler should work
-        Assert.assertEquals(4.0 / 11, w4 / sum, 0.0);
-        Assert.assertEquals(2.0 / 11, w2 / sum, 0.0);
-        Assert.assertEquals(1.0 / 11, w1 / sum, 0.0);
+        Assertions.assertEquals(4.0 / 11, w4 / sum);
+        Assertions.assertEquals(2.0 / 11, w2 / sum);
+        Assertions.assertEquals(1.0 / 11, w1 / sum);
         builder.add(new RangeSampler(0, 40, rng), w4);
         builder.add(new RangeSampler(40, 80, rng), w4);
         builder.add(new RangeSampler(80, 100, rng), w2);
@@ -334,7 +334,7 @@ public class CompositeSamplersTest {
             builder.add(sampler, sampler.range);
         }
 
-        Assert.assertEquals("Failed to add the correct number of samplers", n, builder.size() - before);
+        Assertions.assertEquals(n, builder.size() - before, "Failed to add the correct number of samplers");
     }
 
     /**
@@ -354,7 +354,7 @@ public class CompositeSamplersTest {
         final double[] expected = new double[observed.length];
         Arrays.fill(expected, (double) n / expected.length);
         final double p = new ChiSquareTest().chiSquareTest(expected, observed);
-        Assert.assertFalse("p-value too small: " + p, p < 0.001);
+        Assertions.assertFalse(p < 0.001, () -> "p-value too small: " + p);
     }
 
     /**
@@ -428,7 +428,7 @@ public class CompositeSamplersTest {
             builder.add(sampler, sampler.range);
         }
 
-        Assert.assertEquals("Failed to add the correct number of samplers", n, builder.size() - before);
+        Assertions.assertEquals(n, builder.size() - before, "Failed to add the correct number of samplers");
     }
 
     /**
@@ -448,7 +448,7 @@ public class CompositeSamplersTest {
         final double[] expected = new double[observed.length];
         Arrays.fill(expected, (double) n / expected.length);
         final double p = new ChiSquareTest().chiSquareTest(expected, observed);
-        Assert.assertFalse("p-value too small: " + p, p < 0.001);
+        Assertions.assertFalse(p < 0.001, () -> "p-value too small: " + p);
     }
 
     /**
@@ -521,7 +521,7 @@ public class CompositeSamplersTest {
             builder.add(sampler, sampler.range());
         }
 
-        Assert.assertEquals("Failed to add the correct number of samplers", n, builder.size() - before);
+        Assertions.assertEquals(n, builder.size() - before, "Failed to add the correct number of samplers");
     }
 
     /**
@@ -545,7 +545,7 @@ public class CompositeSamplersTest {
         final double[] expected = new double[observed.length];
         Arrays.fill(expected, (double) n / expected.length);
         final double p = new ChiSquareTest().chiSquareTest(expected, observed);
-        Assert.assertFalse("p-value too small: " + p, p < 0.001);
+        Assertions.assertFalse(p < 0.001, () -> "p-value too small: " + p);
     }
 
     /**
@@ -618,7 +618,7 @@ public class CompositeSamplersTest {
             builder.add(sampler, sampler.range);
         }
 
-        Assert.assertEquals("Failed to add the correct number of samplers", n, builder.size() - before);
+        Assertions.assertEquals(n, builder.size() - before, "Failed to add the correct number of samplers");
     }
 
     /**
@@ -641,7 +641,7 @@ public class CompositeSamplersTest {
         final double[] expected = new double[observed.length];
         Arrays.fill(expected, (double) n / expected.length);
         final double p = new ChiSquareTest().chiSquareTest(expected, observed);
-        Assert.assertFalse("p-value too small: " + p, p < 0.001);
+        Assertions.assertFalse(p < 0.001, () -> "p-value too small: " + p);
     }
 
     /**
diff --git a/commons-rng-sampling/src/test/java/org/apache/commons/rng/sampling/DiscreteProbabilityCollectionSamplerTest.java b/commons-rng-sampling/src/test/java/org/apache/commons/rng/sampling/DiscreteProbabilityCollectionSamplerTest.java
index 8a5225f..ed72e7d 100644
--- a/commons-rng-sampling/src/test/java/org/apache/commons/rng/sampling/DiscreteProbabilityCollectionSamplerTest.java
+++ b/commons-rng-sampling/src/test/java/org/apache/commons/rng/sampling/DiscreteProbabilityCollectionSamplerTest.java
@@ -24,7 +24,7 @@ import java.util.List;
 import java.util.Map;
 import java.util.TreeMap;
 
-import org.junit.Assert;
+import org.junit.jupiter.api.Assertions;
 import org.junit.Test;
 import org.apache.commons.rng.UniformRandomProvider;
 import org.apache.commons.rng.simple.RandomSource;
@@ -104,9 +104,9 @@ public class DiscreteProbabilityCollectionSamplerTest {
         }
 
         final double mean = sum / n;
-        Assert.assertEquals(expectedMean, mean, 1e-3);
+        Assertions.assertEquals(expectedMean, mean, 1e-3);
         final double variance = sumOfSquares / n - mean * mean;
-        Assert.assertEquals(expectedVariance, variance, 2e-3);
+        Assertions.assertEquals(expectedVariance, variance, 2e-3);
     }
 
 
@@ -128,7 +128,7 @@ public class DiscreteProbabilityCollectionSamplerTest {
             new DiscreteProbabilityCollectionSampler<Integer>(rng2, map);
 
         for (int i = 0; i < 50; i++) {
-            Assert.assertEquals(sampler1.sample(), sampler2.sample());
+            Assertions.assertEquals(sampler1.sample(), sampler2.sample());
         }
     }
 
@@ -165,10 +165,10 @@ public class DiscreteProbabilityCollectionSamplerTest {
         final Double item1 = sampler.sample();
         final Double item2 = sampler.sample();
         // Check they are in the list
-        Assert.assertTrue("Sample item1 is not from the list", items.contains(item1));
-        Assert.assertTrue("Sample item2 is not from the list", items.contains(item2));
+        Assertions.assertTrue(items.contains(item1), "Sample item1 is not from the list");
+        Assertions.assertTrue(items.contains(item2), "Sample item2 is not from the list");
         // Test the two samples are different items
-        Assert.assertNotSame("Item1 and 2 should be different", item1, item2);
+        Assertions.assertNotSame(item1, item2, "Item1 and 2 should be different");
     }
 
     /**
diff --git a/commons-rng-sampling/src/test/java/org/apache/commons/rng/sampling/ListSamplerTest.java b/commons-rng-sampling/src/test/java/org/apache/commons/rng/sampling/ListSamplerTest.java
index 095dd3b..c4788d9 100644
--- a/commons-rng-sampling/src/test/java/org/apache/commons/rng/sampling/ListSamplerTest.java
+++ b/commons-rng-sampling/src/test/java/org/apache/commons/rng/sampling/ListSamplerTest.java
@@ -17,6 +17,7 @@
 package org.apache.commons.rng.sampling;
 
 import java.util.Set;
+import java.util.function.Supplier;
 import java.util.HashSet;
 import java.util.LinkedList;
 import java.util.List;
@@ -24,7 +25,7 @@ import java.util.ListIterator;
 import java.util.ArrayList;
 import java.util.Collection;
 
-import org.junit.Assert;
+import org.junit.jupiter.api.Assertions;
 import org.junit.Test;
 
 import org.apache.commons.math3.stat.inference.ChiSquareTest;
@@ -66,7 +67,7 @@ public class ListSamplerTest {
         }
 
         // Pass if we cannot reject null hypothesis that distributions are the same.
-        Assert.assertFalse(chiSquareTest.chiSquareTest(expected, observed, 0.001));
+        Assertions.assertFalse(chiSquareTest.chiSquareTest(expected, observed, 0.001));
     }
 
     @Test
@@ -76,8 +77,8 @@ public class ListSamplerTest {
         list.add("one");
 
         final List<String> one = ListSampler.sample(rng, list, 1);
-        Assert.assertEquals(1, one.size());
-        Assert.assertTrue(one.contains("one"));
+        Assertions.assertEquals(1, one.size());
+        Assertions.assertTrue(one.contains("one"));
     }
 
     @Test(expected = IllegalArgumentException.class)
@@ -106,13 +107,13 @@ public class ListSamplerTest {
 
         ListSampler.shuffle(rng, arrayList);
         // Ensure that at least one entry has moved.
-        Assert.assertTrue("ArrayList", compare(orig, arrayList, 0, orig.size(), false));
+        Assertions.assertTrue(compare(orig, arrayList, 0, orig.size(), false), "ArrayList");
 
         final List<Integer> linkedList = new LinkedList<Integer>(orig);
 
         ListSampler.shuffle(rng, linkedList);
         // Ensure that at least one entry has moved.
-        Assert.assertTrue("LinkedList", compare(orig, linkedList, 0, orig.size(), false));
+        Assertions.assertTrue(compare(orig, linkedList, 0, orig.size(), false), "LinkedList");
     }
 
     @Test
@@ -127,10 +128,10 @@ public class ListSamplerTest {
         ListSampler.shuffle(rng, list, start, false);
 
         // Ensure that all entries below index "start" did not move.
-        Assert.assertTrue(compare(orig, list, 0, start, true));
+        Assertions.assertTrue(compare(orig, list, 0, start, true));
 
         // Ensure that at least one entry has moved.
-        Assert.assertTrue(compare(orig, list, start, orig.size(), false));
+        Assertions.assertTrue(compare(orig, list, start, orig.size(), false));
     }
 
     @Test
@@ -145,10 +146,10 @@ public class ListSamplerTest {
         ListSampler.shuffle(rng, list, start, true);
 
         // Ensure that all entries above index "start" did not move.
-        Assert.assertTrue(compare(orig, list, start + 1, orig.size(), true));
+        Assertions.assertTrue(compare(orig, list, start + 1, orig.size(), true));
 
         // Ensure that at least one entry has moved.
-        Assert.assertTrue(compare(orig, list, 0, start + 1, false));
+        Assertions.assertTrue(compare(orig, list, 0, start + 1, false));
     }
 
     /**
@@ -240,8 +241,7 @@ public class ListSamplerTest {
             }
         }
 
-        Assert.fail("Sample not found: { " +
-                    samp[0] + ", " + samp[1] + " }");
+        Assertions.fail("Sample not found: { " + samp[0] + ", " + samp[1] + " }");
         return -1;
     }
 
@@ -265,10 +265,10 @@ public class ListSamplerTest {
         ListSampler.shuffle(rng1, list);
         PermutationSampler.shuffle(rng2, array);
 
-        final String msg = "Type=" + list.getClass().getSimpleName();
+        final Supplier<String> msg = () -> "Type=" + list.getClass().getSimpleName();
         it = list.listIterator();
         for (int i = 0; i < array.length; i++) {
-            Assert.assertEquals(msg, array[i], it.next().intValue());
+            Assertions.assertEquals(array[i], it.next().intValue(), msg);
         }
     }
     /**
@@ -297,11 +297,11 @@ public class ListSamplerTest {
         ListSampler.shuffle(rng1, list, start, towardHead);
         PermutationSampler.shuffle(rng2, array, start, towardHead);
 
-        final String msg = String.format("Type=%s start=%d towardHead=%b",
+        final Supplier<String> msg = () -> String.format("Type=%s start=%d towardHead=%b",
                 list.getClass().getSimpleName(), start, towardHead);
         it = list.listIterator();
         for (int i = 0; i < array.length; i++) {
-            Assert.assertEquals(msg, array[i], it.next().intValue());
+            Assertions.assertEquals(array[i], it.next().intValue(), msg);
         }
     }
 }
diff --git a/commons-rng-sampling/src/test/java/org/apache/commons/rng/sampling/PermutationSamplerTest.java b/commons-rng-sampling/src/test/java/org/apache/commons/rng/sampling/PermutationSamplerTest.java
index 6f0739f..06d9631 100644
--- a/commons-rng-sampling/src/test/java/org/apache/commons/rng/sampling/PermutationSamplerTest.java
+++ b/commons-rng-sampling/src/test/java/org/apache/commons/rng/sampling/PermutationSamplerTest.java
@@ -18,7 +18,7 @@ package org.apache.commons.rng.sampling;
 
 import java.util.Arrays;
 
-import org.junit.Assert;
+import org.junit.jupiter.api.Assertions;
 import org.junit.Test;
 
 import org.apache.commons.math3.stat.inference.ChiSquareTest;
@@ -46,7 +46,7 @@ public class PermutationSamplerTest {
                     continue SAMPLE;
                 }
             }
-            Assert.fail("number " + s + " not in array");
+            Assertions.fail("number " + s + " not in array");
         }
     }
 
@@ -78,8 +78,8 @@ public class PermutationSamplerTest {
         // Check size = 1 boundary case.
         final PermutationSampler sampler = new PermutationSampler(rng, 1, 1);
         final int[] perm = sampler.sample();
-        Assert.assertEquals(1, perm.length);
-        Assert.assertEquals(0, perm[0]);
+        Assertions.assertEquals(1, perm.length);
+        Assertions.assertEquals(0, perm[0]);
     }
 
     @Test(expected = IllegalArgumentException.class)
@@ -113,14 +113,14 @@ public class PermutationSamplerTest {
 
         final int[] natural = PermutationSampler.natural(n);
         for (int i = 0; i < n; i++) {
-            Assert.assertEquals(expected[i], natural[i]);
+            Assertions.assertEquals(expected[i], natural[i]);
         }
     }
 
     @Test
     public void testNaturalZero() {
         final int[] natural = PermutationSampler.natural(0);
-        Assert.assertEquals(0, natural.length);
+        Assertions.assertEquals(0, natural.length);
     }
 
     @Test
@@ -136,7 +136,7 @@ public class PermutationSamplerTest {
         }
 
         for (int i = 0; i < n; i++) {
-            Assert.assertEquals(1, count[i]);
+            Assertions.assertEquals(1, count[i]);
         }
     }
 
@@ -149,7 +149,7 @@ public class PermutationSamplerTest {
 
         // Ensure that all entries below index "start" did not move.
         for (int i = 0; i < start; i++) {
-            Assert.assertEquals(orig[i], list[i]);
+            Assertions.assertEquals(orig[i], list[i]);
         }
 
         // Ensure that at least one entry has moved.
@@ -160,7 +160,7 @@ public class PermutationSamplerTest {
                 break;
             }
         }
-        Assert.assertTrue(ok);
+        Assertions.assertTrue(ok);
     }
 
     @Test
@@ -172,7 +172,7 @@ public class PermutationSamplerTest {
 
         // Ensure that all entries above index "start" did not move.
         for (int i = start + 1; i < orig.length; i++) {
-            Assert.assertEquals(orig[i], list[i]);
+            Assertions.assertEquals(orig[i], list[i]);
         }
 
         // Ensure that at least one entry has moved.
@@ -183,7 +183,7 @@ public class PermutationSamplerTest {
                 break;
             }
         }
-        Assert.assertTrue(ok);
+        Assertions.assertTrue(ok);
     }
 
     /**
@@ -219,7 +219,7 @@ public class PermutationSamplerTest {
         }
 
         // Pass if we cannot reject null hypothesis that distributions are the same.
-        Assert.assertFalse(chiSquareTest.chiSquareTest(expected, observed, 0.001));
+        Assertions.assertFalse(chiSquareTest.chiSquareTest(expected, observed, 0.001));
     }
 
     private static int findPerm(int[][] p,
@@ -229,7 +229,7 @@ public class PermutationSamplerTest {
                 return i;
             }
         }
-        Assert.fail("Permutation not found");
+        Assertions.fail("Permutation not found");
         return -1;
     }
 }
diff --git a/commons-rng-sampling/src/test/java/org/apache/commons/rng/sampling/RandomAssert.java b/commons-rng-sampling/src/test/java/org/apache/commons/rng/sampling/RandomAssert.java
index 085f84e..0ea4a6d 100644
--- a/commons-rng-sampling/src/test/java/org/apache/commons/rng/sampling/RandomAssert.java
+++ b/commons-rng-sampling/src/test/java/org/apache/commons/rng/sampling/RandomAssert.java
@@ -17,7 +17,7 @@
 
 package org.apache.commons.rng.sampling;
 
-import org.junit.Assert;
+import org.junit.jupiter.api.Assertions;
 
 import org.apache.commons.rng.sampling.distribution.ContinuousSampler;
 import org.apache.commons.rng.sampling.distribution.DiscreteSampler;
@@ -45,7 +45,7 @@ public final class RandomAssert {
     public static void assertProduceSameSequence(ContinuousSampler sampler1,
                                                  ContinuousSampler sampler2) {
         for (int i = 0; i < SAMPLES; i++) {
-            Assert.assertEquals(sampler1.sample(), sampler2.sample(), 0.0);
+            Assertions.assertEquals(sampler1.sample(), sampler2.sample());
         }
     }
 
@@ -59,7 +59,7 @@ public final class RandomAssert {
     public static void assertProduceSameSequence(DiscreteSampler sampler1,
                                                  DiscreteSampler sampler2) {
         for (int i = 0; i < SAMPLES; i++) {
-            Assert.assertEquals(sampler1.sample(), sampler2.sample());
+            Assertions.assertEquals(sampler1.sample(), sampler2.sample());
         }
     }
 
@@ -73,7 +73,7 @@ public final class RandomAssert {
     public static void assertProduceSameSequence(LongSampler sampler1,
                                                  LongSampler sampler2) {
         for (int i = 0; i < SAMPLES; i++) {
-            Assert.assertEquals(sampler1.sample(), sampler2.sample());
+            Assertions.assertEquals(sampler1.sample(), sampler2.sample());
         }
     }
 
@@ -81,9 +81,9 @@ public final class RandomAssert {
      * Exercise the {@link ObjectSampler} interface, and
      * ensure that the two samplers produce the same sequence.
      *
-     * <p>Arrays are tested using {@link Assert#assertArrayEquals(Object[], Object[])}
+     * <p>Arrays are tested using {@link Assertions#assertArrayEquals(Object[], Object[])}
      * which handles primitive arrays using exact equality and objects using
-     * {@link Object#equals(Object)}. Otherwise {@link Assert#assertEquals(Object, Object)}
+     * {@link Object#equals(Object)}. Otherwise {@link Assertions#assertEquals(Object, Object)}
      * is used which makes use of {@link Object#equals(Object)}.</p>
      *
      * <p>This should be used to test samplers of any type by wrapping the sample method
@@ -99,9 +99,9 @@ public final class RandomAssert {
             final T value2 = sampler2.sample();
             if (isArray(value1) && isArray(value2)) {
                 // JUnit assertArrayEquals will handle nested primitive arrays
-                Assert.assertArrayEquals(new Object[] {value1}, new Object[] {value2});
+                Assertions.assertArrayEquals(new Object[] {value1}, new Object[] {value2});
             } else {
-                Assert.assertEquals(value1, value2);
+                Assertions.assertEquals(value1, value2);
             }
         }
     }
diff --git a/commons-rng-sampling/src/test/java/org/apache/commons/rng/sampling/UnitSphereSamplerTest.java b/commons-rng-sampling/src/test/java/org/apache/commons/rng/sampling/UnitSphereSamplerTest.java
index d731a98..8ff8679 100644
--- a/commons-rng-sampling/src/test/java/org/apache/commons/rng/sampling/UnitSphereSamplerTest.java
+++ b/commons-rng-sampling/src/test/java/org/apache/commons/rng/sampling/UnitSphereSamplerTest.java
@@ -16,7 +16,7 @@
  */
 package org.apache.commons.rng.sampling;
 
-import org.junit.Assert;
+import org.junit.jupiter.api.Assertions;
 import org.junit.Test;
 import org.apache.commons.rng.simple.RandomSource;
 import java.util.Arrays;
@@ -78,13 +78,13 @@ public class UnitSphereSamplerTest {
             // Test the deprecated method once in the test suite.
             @SuppressWarnings("deprecation")
             final double[] v = generator.nextVector();
-            Assert.assertEquals(1, v.length);
+            Assertions.assertEquals(1, v.length);
             final double d = v[0];
             if (d == -1.0) {
                 count++;
             } else if (d != 1.0) {
                 // RNG-130: All samples should be 1 or -1.
-                Assert.fail("Invalid unit length: " + d);
+                Assertions.fail("Invalid unit length: " + d);
             }
         }
         // Test the number of negatives is approximately 50%
@@ -114,10 +114,9 @@ public class UnitSphereSamplerTest {
         // the p-value requires the complimentary error function.
         final double absSum = Math.abs(sum);
         final double max = Math.sqrt(numberOfBits) * 2.576;
-        Assert.assertTrue(
-                "Walked too far astray: " + absSum + " > " + max +
-                " (test will fail randomly about 1 in 100 times)",
-                absSum <= max);
+        Assertions.assertTrue(absSum <= max,
+            () -> "Walked too far astray: " + absSum + " > " + max +
+                  " (test will fail randomly about 1 in 100 times)");
     }
 
     /**
@@ -150,8 +149,8 @@ public class UnitSphereSamplerTest {
         final int steps = 100000;
         for (int i = 0; i < steps; ++i) {
             final double[] v = generator.sample();
-            Assert.assertEquals(2, v.length);
-            Assert.assertEquals(1.0, length(v), 1e-10);
+            Assertions.assertEquals(2, v.length);
+            Assertions.assertEquals(1.0, length(v), 1e-10);
             // Get the polar angle bin from xy
             final int angleBin = angleBin(angleBins, v[0], v[1]);
             observed[angleBin]++;
@@ -160,7 +159,7 @@ public class UnitSphereSamplerTest {
         final double[] expected = new double[observed.length];
         Arrays.fill(expected, (double) steps / observed.length);
         final double p = new ChiSquareTest().chiSquareTest(expected, observed);
-        Assert.assertFalse("p-value too small: " + p, p < 0.01);
+        Assertions.assertFalse(p < 0.01, () -> "p-value too small: " + p);
     }
 
     /**
@@ -200,8 +199,8 @@ public class UnitSphereSamplerTest {
         final int steps = 1000000;
         for (int i = 0; i < steps; ++i) {
             final double[] v = generator.sample();
-            Assert.assertEquals(3, v.length);
-            Assert.assertEquals(1.0, length(v), 1e-10);
+            Assertions.assertEquals(3, v.length);
+            Assertions.assertEquals(1.0, length(v), 1e-10);
             // Get the polar angle bin from xy
             final int angleBin = angleBin(angleBins, v[0], v[1]);
             // Map cos(phi) = z from [-1, 1) to [0, 1) then assign a bin
@@ -212,7 +211,7 @@ public class UnitSphereSamplerTest {
         final double[] expected = new double[observed.length];
         Arrays.fill(expected, (double) steps / observed.length);
         final double p = new ChiSquareTest().chiSquareTest(expected, observed);
-        Assert.assertFalse("p-value too small: " + p, p < 0.01);
+        Assertions.assertFalse(p < 0.01, () -> "p-value too small: " + p);
     }
 
     /**
@@ -271,8 +270,8 @@ public class UnitSphereSamplerTest {
         final int steps = 1000000;
         for (int i = 0; i < steps; ++i) {
             final double[] v = generator.sample();
-            Assert.assertEquals(4, v.length);
-            Assert.assertEquals(1.0, length(v), 1e-10);
+            Assertions.assertEquals(4, v.length);
+            Assertions.assertEquals(1.0, length(v), 1e-10);
             // Circle 1
             observed1[circleBin(angleBins, r, v[0], v[1])]++;
             // Circle 2
@@ -283,9 +282,9 @@ public class UnitSphereSamplerTest {
         Arrays.fill(expected, (double) steps / observed1.length);
         final ChiSquareTest chi = new ChiSquareTest();
         final double p1 = chi.chiSquareTest(expected, observed1);
-        Assert.assertFalse("Circle 1 p-value too small: " + p1, p1 < 0.01);
+        Assertions.assertFalse(p1 < 0.01, () -> "Circle 1 p-value too small: " + p1);
         final double p2 = chi.chiSquareTest(expected, observed2);
-        Assert.assertFalse("Circle 2 p-value too small: " + p2, p2 < 0.01);
+        Assertions.assertFalse(p2 < 0.01, () -> "Circle 2 p-value too small: " + p2);
     }
 
     /**
@@ -431,8 +430,8 @@ public class UnitSphereSamplerTest {
         };
 
         final double[] vector = UnitSphereSampler.of(bad, dimension).sample();
-        Assert.assertEquals(dimension, vector.length);
-        Assert.assertEquals(1.0, length(vector), 1e-10);
+        Assertions.assertEquals(dimension, vector.length);
+        Assertions.assertEquals(1.0, length(vector), 1e-10);
     }
 
     /**
@@ -447,7 +446,7 @@ public class UnitSphereSamplerTest {
         // Map to the scaling factor
         final double f = 1 / Math.sqrt(normSq);
         // As long as this is finite positive then the sampler is valid
-        Assert.assertTrue(f > 0 && f <= Double.MAX_VALUE);
+        Assertions.assertTrue(f > 0 && f <= Double.MAX_VALUE);
     }
 
     /**
diff --git a/commons-rng-sampling/src/test/java/org/apache/commons/rng/sampling/distribution/AhrensDieterExponentialSamplerTest.java b/commons-rng-sampling/src/test/java/org/apache/commons/rng/sampling/distribution/AhrensDieterExponentialSamplerTest.java
index 10fd206..24e474f 100644
--- a/commons-rng-sampling/src/test/java/org/apache/commons/rng/sampling/distribution/AhrensDieterExponentialSamplerTest.java
+++ b/commons-rng-sampling/src/test/java/org/apache/commons/rng/sampling/distribution/AhrensDieterExponentialSamplerTest.java
@@ -22,7 +22,7 @@ import org.apache.commons.rng.UniformRandomProvider;
 import org.apache.commons.rng.core.source64.SplitMix64;
 import org.apache.commons.rng.sampling.RandomAssert;
 import org.apache.commons.rng.simple.RandomSource;
-import org.junit.Assert;
+import org.junit.jupiter.api.Assertions;
 import org.junit.Rule;
 import org.junit.Test;
 import org.junit.rules.Timeout;
@@ -77,7 +77,7 @@ public class AhrensDieterExponentialSamplerTest {
         final SharedStateContinuousSampler sampler = AhrensDieterExponentialSampler.of(rng, 1);
         // This should not infinite loop
         final double x = sampler.sample();
-        Assert.assertTrue(x >= 0);
+        Assertions.assertTrue(x >= 0);
     }
 
     /**
@@ -96,6 +96,6 @@ public class AhrensDieterExponentialSamplerTest {
         };
         final SharedStateContinuousSampler sampler = AhrensDieterExponentialSampler.of(rng, 1);
         final double x = sampler.sample();
-        Assert.assertTrue(x >= 0);
+        Assertions.assertTrue(x >= 0);
     }
 }
diff --git a/commons-rng-sampling/src/test/java/org/apache/commons/rng/sampling/distribution/AhrensDieterMarsagliaTsangGammaSamplerTest.java b/commons-rng-sampling/src/test/java/org/apache/commons/rng/sampling/distribution/AhrensDieterMarsagliaTsangGammaSamplerTest.java
index cb03418..718ecf9 100644
--- a/commons-rng-sampling/src/test/java/org/apache/commons/rng/sampling/distribution/AhrensDieterMarsagliaTsangGammaSamplerTest.java
+++ b/commons-rng-sampling/src/test/java/org/apache/commons/rng/sampling/distribution/AhrensDieterMarsagliaTsangGammaSamplerTest.java
@@ -20,7 +20,7 @@ import org.apache.commons.rng.RestorableUniformRandomProvider;
 import org.apache.commons.rng.UniformRandomProvider;
 import org.apache.commons.rng.sampling.RandomAssert;
 import org.apache.commons.rng.simple.RandomSource;
-import org.junit.Assert;
+import org.junit.jupiter.api.Assertions;
 import org.junit.Test;
 
 /**
@@ -90,7 +90,7 @@ public class AhrensDieterMarsagliaTsangGammaSamplerTest {
     @Test
     public void testToString() {
         final UniformRandomProvider rng = RandomSource.SPLIT_MIX_64.create(0L);
-        Assert.assertTrue(new AhrensDieterMarsagliaTsangGammaSampler(rng, 1.0, 2.0).toString()
+        Assertions.assertTrue(new AhrensDieterMarsagliaTsangGammaSampler(rng, 1.0, 2.0).toString()
                 .toLowerCase().contains("gamma"));
     }
 }
diff --git a/commons-rng-sampling/src/test/java/org/apache/commons/rng/sampling/distribution/AliasMethodDiscreteSamplerTest.java b/commons-rng-sampling/src/test/java/org/apache/commons/rng/sampling/distribution/AliasMethodDiscreteSamplerTest.java
index e259f21..6a01e74 100644
--- a/commons-rng-sampling/src/test/java/org/apache/commons/rng/sampling/distribution/AliasMethodDiscreteSamplerTest.java
+++ b/commons-rng-sampling/src/test/java/org/apache/commons/rng/sampling/distribution/AliasMethodDiscreteSamplerTest.java
@@ -22,7 +22,7 @@ import org.apache.commons.math3.stat.inference.ChiSquareTest;
 import org.apache.commons.rng.UniformRandomProvider;
 import org.apache.commons.rng.sampling.RandomAssert;
 import org.apache.commons.rng.simple.RandomSource;
-import org.junit.Assert;
+import org.junit.jupiter.api.Assertions;
 import org.junit.Test;
 
 import java.util.Arrays;
@@ -69,7 +69,7 @@ public class AliasMethodDiscreteSamplerTest {
     @Test
     public void testToString() {
         final SharedStateDiscreteSampler sampler = createSampler(new double[] {0.5, 0.5});
-        Assert.assertTrue(sampler.toString().toLowerCase().contains("alias method"));
+        Assertions.assertTrue(sampler.toString().toLowerCase().contains("alias method"));
     }
 
     /**
@@ -241,13 +241,13 @@ public class AliasMethodDiscreteSamplerTest {
                 expected[mapSize] = probabilies[i];
                 observed[mapSize] = samples[i];
             } else {
-                Assert.assertEquals("No samples expected from zero probability", 0, samples[i]);
+                Assertions.assertEquals(0, samples[i], "No samples expected from zero probability");
             }
         }
 
         final ChiSquareTest chiSquareTest = new ChiSquareTest();
         // Pass if we cannot reject null hypothesis that the distributions are the same.
-        Assert.assertFalse(chiSquareTest.chiSquareTest(expected, observed, 0.001));
+        Assertions.assertFalse(chiSquareTest.chiSquareTest(expected, observed, 0.001));
     }
 
     /**
diff --git a/commons-rng-sampling/src/test/java/org/apache/commons/rng/sampling/distribution/ChengBetaSamplerTest.java b/commons-rng-sampling/src/test/java/org/apache/commons/rng/sampling/distribution/ChengBetaSamplerTest.java
index a058bf7..4daa16e 100644
--- a/commons-rng-sampling/src/test/java/org/apache/commons/rng/sampling/distribution/ChengBetaSamplerTest.java
+++ b/commons-rng-sampling/src/test/java/org/apache/commons/rng/sampling/distribution/ChengBetaSamplerTest.java
@@ -20,7 +20,7 @@ import org.apache.commons.rng.RestorableUniformRandomProvider;
 import org.apache.commons.rng.UniformRandomProvider;
 import org.apache.commons.rng.sampling.RandomAssert;
 import org.apache.commons.rng.simple.RandomSource;
-import org.junit.Assert;
+import org.junit.jupiter.api.Assertions;
 import org.junit.Test;
 
 /**
@@ -106,7 +106,7 @@ public class ChengBetaSamplerTest {
     @Test
     public void testToString() {
         final UniformRandomProvider rng = RandomSource.SPLIT_MIX_64.create(0L);
-        Assert.assertTrue(new ChengBetaSampler(rng, 1.0, 2.0).toString()
+        Assertions.assertTrue(new ChengBetaSampler(rng, 1.0, 2.0).toString()
                 .toLowerCase().contains("beta"));
     }
 }
diff --git a/commons-rng-sampling/src/test/java/org/apache/commons/rng/sampling/distribution/ContinuousSamplerParametricTest.java b/commons-rng-sampling/src/test/java/org/apache/commons/rng/sampling/distribution/ContinuousSamplerParametricTest.java
index 199e504..4ad40e3 100644
--- a/commons-rng-sampling/src/test/java/org/apache/commons/rng/sampling/distribution/ContinuousSamplerParametricTest.java
+++ b/commons-rng-sampling/src/test/java/org/apache/commons/rng/sampling/distribution/ContinuousSamplerParametricTest.java
@@ -20,7 +20,7 @@ import java.util.Arrays;
 import java.util.List;
 import java.util.ArrayList;
 
-import org.junit.Assert;
+import org.junit.jupiter.api.Assertions;
 import org.junit.Test;
 import org.junit.runner.RunWith;
 import org.junit.runners.Parameterized;
@@ -129,9 +129,9 @@ public class ContinuousSamplerParametricTest {
         // 3     0.0016
 
         if (numFailures > 3) { // Test will fail with 0.16% probability
-            Assert.fail(sampler + ": Too many failures for sample size = " + sampleSize +
-                        " (" + numFailures + " out of " + numTests + " tests failed, " +
-                        "chi2=" + Arrays.toString(failedStat.toArray(new Double[0])) + ")");
+            Assertions.fail(sampler + ": Too many failures for sample size = " + sampleSize +
+                            " (" + numFailures + " out of " + numTests + " tests failed, " +
+                            "chi2=" + Arrays.toString(failedStat.toArray(new Double[0])) + ")");
         }
     }
 }
diff --git a/commons-rng-sampling/src/test/java/org/apache/commons/rng/sampling/distribution/ContinuousUniformSamplerTest.java b/commons-rng-sampling/src/test/java/org/apache/commons/rng/sampling/distribution/ContinuousUniformSamplerTest.java
index 9db2c6e..2a55ca1 100644
--- a/commons-rng-sampling/src/test/java/org/apache/commons/rng/sampling/distribution/ContinuousUniformSamplerTest.java
+++ b/commons-rng-sampling/src/test/java/org/apache/commons/rng/sampling/distribution/ContinuousUniformSamplerTest.java
@@ -20,7 +20,7 @@ import org.apache.commons.rng.UniformRandomProvider;
 import org.apache.commons.rng.core.source64.SplitMix64;
 import org.apache.commons.rng.sampling.RandomAssert;
 import org.apache.commons.rng.simple.RandomSource;
-import org.junit.Assert;
+import org.junit.jupiter.api.Assertions;
 import org.junit.Test;
 
 /**
@@ -46,7 +46,7 @@ public class ContinuousUniformSamplerTest {
         final double max = Math.max(low,  high);
         for (int i = 0; i < 10; i++) {
             final double value = sampler.sample();
-            Assert.assertTrue("Value not in range", value >= min && value <= max);
+            Assertions.assertTrue(value >= min && value <= max, () -> "Value not in range: " + value);
         }
     }
 
@@ -84,7 +84,7 @@ public class ContinuousUniformSamplerTest {
         // Test the sampler excludes the end points
         for (int i = 0; i < 10; i++) {
             final double value = sampler.sample();
-            Assert.assertTrue("Value not in range: " + value, value > low && value < high);
+            Assertions.assertTrue(value > low && value < high, () -> "Value not in range: " + value);
         }
     }
 
@@ -114,13 +114,13 @@ public class ContinuousUniformSamplerTest {
             final double high = interval[1];
             try {
                 ContinuousUniformSampler.of(rng, low, high, true);
-                Assert.fail("(" + low + "," + high + ")");
+                Assertions.fail("(" + low + "," + high + ")");
             } catch (IllegalArgumentException ex) {
                 // Expected
             }
             try {
                 ContinuousUniformSampler.of(rng, high, low, true);
-                Assert.fail("(" + high + "," + low + ")");
+                Assertions.fail("(" + high + "," + low + ")");
             } catch (IllegalArgumentException ex) {
                 // Expected
             }
@@ -147,18 +147,18 @@ public class ContinuousUniformSamplerTest {
         }) {
             final double low = Math.nextUp(expected);
             final double high = Math.nextDown(expected);
-            Assert.assertEquals(expected, ContinuousUniformSampler.of(rng, low, high, true).sample(), 0.0);
-            Assert.assertEquals(expected, ContinuousUniformSampler.of(rng, high, low, true).sample(), 0.0);
-            Assert.assertEquals(-expected, ContinuousUniformSampler.of(rng, -low, -high, true).sample(), 0.0);
-            Assert.assertEquals(-expected, ContinuousUniformSampler.of(rng, -high, -low, true).sample(), 0.0);
+            Assertions.assertEquals(expected, ContinuousUniformSampler.of(rng, low, high, true).sample());
+            Assertions.assertEquals(expected, ContinuousUniformSampler.of(rng, high, low, true).sample());
+            Assertions.assertEquals(-expected, ContinuousUniformSampler.of(rng, -low, -high, true).sample());
+            Assertions.assertEquals(-expected, ContinuousUniformSampler.of(rng, -high, -low, true).sample());
         }
 
         // Special case of sampling around zero.
         // Requires 2 doubles inside the range.
         final double y = ContinuousUniformSampler.of(rng, -x, 2 * x, true).sample();
-        Assert.assertTrue(-x < y && y < 2 * x);
+        Assertions.assertTrue(-x < y && y < 2 * x);
         final double z = ContinuousUniformSampler.of(rng, -2 * x, x, true).sample();
-        Assert.assertTrue(-2 * x < z && z < x);
+        Assertions.assertTrue(-2 * x < z && z < x);
     }
 
     /**
diff --git a/commons-rng-sampling/src/test/java/org/apache/commons/rng/sampling/distribution/DirichletSamplerTest.java b/commons-rng-sampling/src/test/java/org/apache/commons/rng/sampling/distribution/DirichletSamplerTest.java
index 53b440b..cc1ae0a 100644
--- a/commons-rng-sampling/src/test/java/org/apache/commons/rng/sampling/distribution/DirichletSamplerTest.java
+++ b/commons-rng-sampling/src/test/java/org/apache/commons/rng/sampling/distribution/DirichletSamplerTest.java
@@ -16,7 +16,7 @@
  */
 package org.apache.commons.rng.sampling.distribution;
 
-import org.junit.Assert;
+import org.junit.jupiter.api.Assertions;
 import org.junit.Test;
 import java.util.Arrays;
 import org.apache.commons.math3.linear.Array2DRowRealMatrix;
@@ -148,8 +148,8 @@ public class DirichletSamplerTest {
         final UniformRandomProvider rng = RandomSource.SPLIT_MIX_64.create(0L);
         final DirichletSampler sampler1 = DirichletSampler.symmetric(rng, 2, 1.0);
         final DirichletSampler sampler2 = DirichletSampler.of(rng, 0.5, 1, 1.5);
-        Assert.assertTrue(sampler1.toString().toLowerCase().contains("dirichlet"));
-        Assert.assertTrue(sampler2.toString().toLowerCase().contains("dirichlet"));
+        Assertions.assertTrue(sampler1.toString().toLowerCase().contains("dirichlet"));
+        Assertions.assertTrue(sampler2.toString().toLowerCase().contains("dirichlet"));
     }
 
     @Test
@@ -212,7 +212,7 @@ public class DirichletSamplerTest {
         final double[] means = getColumnMeans(samples);
         for (int i = 0; i < k; i++) {
             final double mean = alpha[i] / alpha0;
-            Assert.assertEquals("Mean", mean, means[i], mean * relativeTolerance);
+            Assertions.assertEquals(mean, means[i], mean * relativeTolerance, "Mean");
         }
 
         // Variance = alpha_i (alpha_0 - alpha_i) / alpha_0^2 (alpha_0 + 1)
@@ -221,10 +221,10 @@ public class DirichletSamplerTest {
         final double denom = alpha0 * alpha0 * (alpha0 + 1);
         for (int i = 0; i < k; i++) {
             final double var = alpha[i] * (alpha0 - alpha[i]) / denom;
-            Assert.assertEquals("Variance", var, covars[i][i], var * relativeTolerance);
+            Assertions.assertEquals(var, covars[i][i], var * relativeTolerance, "Variance");
             for (int j = i + 1; j < k; j++) {
                 final double covar = -alpha[i] * alpha[j] / denom;
-                Assert.assertEquals("Covariance", covar, covars[i][j], Math.abs(covar) * relativeTolerance);
+                Assertions.assertEquals(covar, covars[i][j], Math.abs(covar) * relativeTolerance, "Covariance");
             }
         }
     }
@@ -236,14 +236,14 @@ public class DirichletSamplerTest {
      * @param x Sample.
      */
     private static void assertSample(int k, double[] x) {
-        Assert.assertEquals("Number of categories", k, x.length);
+        Assertions.assertEquals(k, x.length, "Number of categories");
         // There are always at least 2 categories
         double sum = x[0] + x[1];
         // Sum the rest
         for (int i = 2; i < x.length; i++) {
             sum += x[i];
         }
-        Assert.assertEquals("Invalid sum", 1.0, sum, 1e-10);
+        Assertions.assertEquals(1.0, sum, 1e-10, "Invalid sum");
     }
 
     /**
diff --git a/commons-rng-sampling/src/test/java/org/apache/commons/rng/sampling/distribution/DiscreteSamplerParametricTest.java b/commons-rng-sampling/src/test/java/org/apache/commons/rng/sampling/distribution/DiscreteSamplerParametricTest.java
index 379c914..8ad84d1 100644
--- a/commons-rng-sampling/src/test/java/org/apache/commons/rng/sampling/distribution/DiscreteSamplerParametricTest.java
+++ b/commons-rng-sampling/src/test/java/org/apache/commons/rng/sampling/distribution/DiscreteSamplerParametricTest.java
@@ -20,7 +20,7 @@ import java.util.Arrays;
 import java.util.List;
 import java.util.ArrayList;
 
-import org.junit.Assert;
+import org.junit.jupiter.api.Assertions;
 import org.junit.Test;
 import org.junit.runner.RunWith;
 import org.junit.runners.Parameterized;
@@ -125,9 +125,9 @@ public class DiscreteSamplerParametricTest {
         // 3     0.0016
 
         if (numFailures > 3) { // Test will fail with 0.16% probability
-            Assert.fail(sampler + ": Too many failures for sample size = " + sampleSize +
-                        " (" + numFailures + " out of " + numTests + " tests failed, " +
-                        "chi2=" + Arrays.toString(failedStat.toArray(new Double[0])));
+            Assertions.fail(sampler + ": Too many failures for sample size = " + sampleSize +
+                            " (" + numFailures + " out of " + numTests + " tests failed, " +
+                            "chi2=" + Arrays.toString(failedStat.toArray(new Double[0])));
         }
     }
 }
diff --git a/commons-rng-sampling/src/test/java/org/apache/commons/rng/sampling/distribution/DiscreteUniformSamplerTest.java b/commons-rng-sampling/src/test/java/org/apache/commons/rng/sampling/distribution/DiscreteUniformSamplerTest.java
index 98bdfa3..a16bf0b 100644
--- a/commons-rng-sampling/src/test/java/org/apache/commons/rng/sampling/distribution/DiscreteUniformSamplerTest.java
+++ b/commons-rng-sampling/src/test/java/org/apache/commons/rng/sampling/distribution/DiscreteUniformSamplerTest.java
@@ -20,7 +20,7 @@ import org.apache.commons.rng.UniformRandomProvider;
 import org.apache.commons.rng.core.source32.IntProvider;
 import org.apache.commons.rng.sampling.RandomAssert;
 import org.apache.commons.rng.simple.RandomSource;
-import org.junit.Assert;
+import org.junit.jupiter.api.Assertions;
 import org.junit.Test;
 
 import java.util.Locale;
@@ -48,7 +48,7 @@ public class DiscreteUniformSamplerTest {
         final UniformRandomProvider rng = RandomSource.SPLIT_MIX_64.create();
         final SharedStateDiscreteSampler sampler = DiscreteUniformSampler.of(rng, lower, upper);
         for (int i = 0; i < 5; i++) {
-            Assert.assertEquals(lower, sampler.sample());
+            Assertions.assertEquals(lower, sampler.sample());
         }
     }
 
@@ -64,7 +64,7 @@ public class DiscreteUniformSamplerTest {
         final UniformRandomProvider rng2 = RandomSource.SPLIT_MIX_64.create(0L);
         final SharedStateDiscreteSampler sampler = DiscreteUniformSampler.of(rng2, lower, upper);
         for (int i = 0; i < 10; i++) {
-            Assert.assertEquals(rng1.nextInt(), sampler.sample());
+            Assertions.assertEquals(rng1.nextInt(), sampler.sample());
         }
     }
 
@@ -83,7 +83,7 @@ public class DiscreteUniformSamplerTest {
             final UniformRandomProvider rng2 = RandomSource.SPLIT_MIX_64.create(0L);
             final SharedStateDiscreteSampler sampler = DiscreteUniformSampler.of(rng2, lower, upper);
             for (int i = 0; i < 10; i++) {
-                Assert.assertEquals(lower + rng1.nextInt(n), sampler.sample());
+                Assertions.assertEquals(lower + rng1.nextInt(n), sampler.sample());
             }
         }
     }
@@ -118,9 +118,9 @@ public class DiscreteUniformSamplerTest {
             final int range = 1 << i;
             final int upper = lower + range - 1;
             sampler = new DiscreteUniformSampler(rngZeroBits, lower, upper);
-            Assert.assertEquals("Zero bits sample", lower, sampler.sample());
+            Assertions.assertEquals(lower, sampler.sample(), "Zero bits sample");
             sampler = new DiscreteUniformSampler(rngAllBits, lower, upper);
-            Assert.assertEquals("All bits sample", upper, sampler.sample());
+            Assertions.assertEquals(upper, sampler.sample(), "All bits sample");
         }
     }
 
@@ -141,7 +141,7 @@ public class DiscreteUniformSamplerTest {
             final UniformRandomProvider rng2 = RandomSource.SPLIT_MIX_64.create(0L);
             sampler = DiscreteUniformSampler.of(rng2, lower, upper);
             for (int j = 0; j < 10; j++) {
-                Assert.assertEquals(rng1.nextInt() >>> shift, sampler.sample());
+                Assertions.assertEquals(rng1.nextInt() >>> shift, sampler.sample());
             }
         }
     }
@@ -164,7 +164,7 @@ public class DiscreteUniformSamplerTest {
             do {
                 expected = rng1.nextInt();
             } while (expected < lower || expected > upper);
-            Assert.assertEquals(expected, sampler.sample());
+            Assertions.assertEquals(expected, sampler.sample());
         }
     }
 
@@ -200,8 +200,8 @@ public class DiscreteUniformSamplerTest {
             final int sample1 = sampler.sample();
             final int sample2 = samplerLo.sample();
             final int sample3 = samplerHi.sample();
-            Assert.assertEquals("Incorrect negative offset sample", sample1 + offsetLo, sample2);
-            Assert.assertEquals("Incorrect positive offset sample", sample1 + offsetHi, sample3);
+            Assertions.assertEquals(sample1 + offsetLo, sample2, "Incorrect negative offset sample");
+            Assertions.assertEquals(sample1 + offsetHi, sample3, "Incorrect positive offset sample");
         }
     }
 
@@ -258,7 +258,7 @@ public class DiscreteUniformSamplerTest {
             min = Math.min(min, value);
             max = Math.max(max, value);
         }
-        Assert.assertTrue("Not uniform, max = " + max + ", min=" + min, max - min <= 1);
+        Assertions.assertTrue(max - min <= 1, "Not uniform, max = " + max + ", min=" + min);
     }
 
     /**
@@ -295,7 +295,7 @@ public class DiscreteUniformSamplerTest {
 
         // This should be even across the entire range
         for (int value : histogram) {
-            Assert.assertEquals(expected, value);
+            Assertions.assertEquals(expected, value);
         }
     }
 
@@ -327,8 +327,8 @@ public class DiscreteUniformSamplerTest {
 
         final int sample = sampler.sample();
 
-        Assert.assertEquals("Sample is incorrect", 0, sample);
-        Assert.assertEquals("Sample should be produced from 2nd value", 2, value[0]);
+        Assertions.assertEquals(0, sample, "Sample is incorrect");
+        Assertions.assertEquals(2, value[0], "Sample should be produced from 2nd value");
     }
 
     @Test
@@ -399,6 +399,6 @@ public class DiscreteUniformSamplerTest {
     private static void assertToString(int lower, int upper) {
         final UniformRandomProvider rng = RandomSource.SPLIT_MIX_64.create(0L);
         final DiscreteUniformSampler sampler = new DiscreteUniformSampler(rng, lower, upper);
-        Assert.assertTrue(sampler.toString().toLowerCase(Locale.US).contains("uniform"));
+        Assertions.assertTrue(sampler.toString().toLowerCase(Locale.US).contains("uniform"));
     }
 }
diff --git a/commons-rng-sampling/src/test/java/org/apache/commons/rng/sampling/distribution/GeometricSamplerTest.java b/commons-rng-sampling/src/test/java/org/apache/commons/rng/sampling/distribution/GeometricSamplerTest.java
index 53f0585..d31f25c 100644
--- a/commons-rng-sampling/src/test/java/org/apache/commons/rng/sampling/distribution/GeometricSamplerTest.java
+++ b/commons-rng-sampling/src/test/java/org/apache/commons/rng/sampling/distribution/GeometricSamplerTest.java
@@ -19,7 +19,7 @@ package org.apache.commons.rng.sampling.distribution;
 import org.apache.commons.rng.UniformRandomProvider;
 import org.apache.commons.rng.sampling.RandomAssert;
 import org.apache.commons.rng.simple.RandomSource;
-import org.junit.Assert;
+import org.junit.jupiter.api.Assertions;
 import org.junit.Test;
 
 /**
@@ -36,7 +36,7 @@ public class GeometricSamplerTest {
         final SharedStateDiscreteSampler sampler = GeometricSampler.of(rng, 1);
         // All samples should be 0
         for (int i = 0; i < 10; i++) {
-            Assert.assertEquals("p=1 should have 0 for all samples", 0, sampler.sample());
+            Assertions.assertEquals(0, sampler.sample(), "p=1 should have 0 for all samples");
         }
     }
 
@@ -52,7 +52,7 @@ public class GeometricSamplerTest {
         // Map to the mean
         final double exponentialMean = 1.0 / (-Math.log1p(-probabilityOfSuccess));
         // As long as this is finite positive then the sampler is valid
-        Assert.assertTrue(exponentialMean > 0 && exponentialMean <= Double.MAX_VALUE);
+        Assertions.assertTrue(exponentialMean > 0 && exponentialMean <= Double.MAX_VALUE);
         // The internal exponential sampler validates the mean so demonstrate creating a
         // geometric sampler does not throw.
         final UniformRandomProvider rng = RandomSource.SPLIT_MIX_64.create(0L);
@@ -67,8 +67,8 @@ public class GeometricSamplerTest {
     public void testProbabilityOfSuccessIsOneSamplerToString() {
         final UniformRandomProvider unusedRng = RandomSource.SPLIT_MIX_64.create(0L);
         final SharedStateDiscreteSampler sampler = GeometricSampler.of(unusedRng, 1);
-        Assert.assertTrue("Missing 'Geometric' from toString",
-            sampler.toString().contains("Geometric"));
+        Assertions.assertTrue(sampler.toString().contains("Geometric"),
+            "Missing 'Geometric' from toString");
     }
 
     /**
@@ -86,8 +86,8 @@ public class GeometricSamplerTest {
         final SharedStateDiscreteSampler sampler = GeometricSampler.of(rng, Double.MIN_VALUE);
         // All samples should be max value
         for (int i = 0; i < 10; i++) {
-            Assert.assertEquals("p=(almost 0) should have Integer.MAX_VALUE for all samples",
-                Integer.MAX_VALUE, sampler.sample());
+            Assertions.assertEquals(Integer.MAX_VALUE, sampler.sample(),
+                "p=(almost 0) should have Integer.MAX_VALUE for all samples");
         }
     }
 
diff --git a/commons-rng-sampling/src/test/java/org/apache/commons/rng/sampling/distribution/GuideTableDiscreteSamplerTest.java b/commons-rng-sampling/src/test/java/org/apache/commons/rng/sampling/distribution/GuideTableDiscreteSamplerTest.java
index 7cfd85b..9ce205f 100644
--- a/commons-rng-sampling/src/test/java/org/apache/commons/rng/sampling/distribution/GuideTableDiscreteSamplerTest.java
+++ b/commons-rng-sampling/src/test/java/org/apache/commons/rng/sampling/distribution/GuideTableDiscreteSamplerTest.java
@@ -22,7 +22,7 @@ import org.apache.commons.math3.stat.inference.ChiSquareTest;
 import org.apache.commons.rng.UniformRandomProvider;
 import org.apache.commons.rng.sampling.RandomAssert;
 import org.apache.commons.rng.simple.RandomSource;
-import org.junit.Assert;
+import org.junit.jupiter.api.Assertions;
 import org.junit.Test;
 
 /**
@@ -77,7 +77,7 @@ public class GuideTableDiscreteSamplerTest {
     @Test
     public void testToString() {
         final SharedStateDiscreteSampler sampler = createSampler(new double[] {0.5, 0.5}, 1.0);
-        Assert.assertTrue(sampler.toString().toLowerCase().contains("guide table"));
+        Assertions.assertTrue(sampler.toString().toLowerCase().contains("guide table"));
     }
 
     /**
@@ -222,7 +222,7 @@ public class GuideTableDiscreteSamplerTest {
         final long[] observed = new long[mapSize];
         for (int i = 0; i < probabilies.length; i++) {
             if (probabilies[i] == 0) {
-                Assert.assertEquals("No samples expected from zero probability", 0, samples[i]);
+                Assertions.assertEquals(0, samples[i], "No samples expected from zero probability");
             } else {
                 // This can be added for the Chi-square test
                 --mapSize;
@@ -233,7 +233,7 @@ public class GuideTableDiscreteSamplerTest {
 
         final ChiSquareTest chiSquareTest = new ChiSquareTest();
         // Pass if we cannot reject null hypothesis that the distributions are the same.
-        Assert.assertFalse(chiSquareTest.chiSquareTest(expected, observed, 0.001));
+        Assertions.assertFalse(chiSquareTest.chiSquareTest(expected, observed, 0.001));
     }
 
     /**
diff --git a/commons-rng-sampling/src/test/java/org/apache/commons/rng/sampling/distribution/InternalUtilsTest.java b/commons-rng-sampling/src/test/java/org/apache/commons/rng/sampling/distribution/InternalUtilsTest.java
index f91a7c4..8505efc 100644
--- a/commons-rng-sampling/src/test/java/org/apache/commons/rng/sampling/distribution/InternalUtilsTest.java
+++ b/commons-rng-sampling/src/test/java/org/apache/commons/rng/sampling/distribution/InternalUtilsTest.java
@@ -18,7 +18,7 @@ package org.apache.commons.rng.sampling.distribution;
 
 import org.apache.commons.math3.special.Gamma;
 import org.apache.commons.rng.sampling.distribution.InternalUtils.FactorialLog;
-import org.junit.Assert;
+import org.junit.jupiter.api.Assertions;
 import org.junit.Test;
 
 /**
@@ -30,11 +30,11 @@ public class InternalUtilsTest {
 
     @Test
     public void testFactorial() {
-        Assert.assertEquals(1L, InternalUtils.factorial(0));
+        Assertions.assertEquals(1L, InternalUtils.factorial(0));
         long result = 1;
         for (int n = 1; n <= MAX_REPRESENTABLE; n++) {
             result *= n;
-            Assert.assertEquals(result, InternalUtils.factorial(n));
+            Assertions.assertEquals(result, InternalUtils.factorial(n));
         }
     }
 
@@ -53,11 +53,11 @@ public class InternalUtilsTest {
         // Cache size allows some of the factorials to be cached and some
         // to be under the precomputed factorials.
         FactorialLog factorialLog = FactorialLog.create().withCache(MAX_REPRESENTABLE / 2);
-        Assert.assertEquals(0, factorialLog.value(0), 1e-10);
+        Assertions.assertEquals(0, factorialLog.value(0), 1e-10);
         for (int n = 1; n <= MAX_REPRESENTABLE + 5; n++) {
             // Use Commons math to compute logGamma(1 + n);
             double expected = Gamma.logGamma(1 + n);
-            Assert.assertEquals(expected, factorialLog.value(n), 1e-10);
+            Assertions.assertEquals(expected, factorialLog.value(n), 1e-10);
         }
     }
 
@@ -68,7 +68,7 @@ public class InternalUtilsTest {
         for (int n = MAX_REPRESENTABLE; n <= limit; n++) {
             // Use Commons math to compute logGamma(1 + n);
             double expected = Gamma.logGamma(1 + n);
-            Assert.assertEquals(expected, factorialLog.value(n), 1e-10);
+            Assertions.assertEquals(expected, factorialLog.value(n), 1e-10);
         }
     }
 
@@ -88,7 +88,7 @@ public class InternalUtilsTest {
         for (int n = 1; n <= 5; n++) {
             // Use Commons math to compute logGamma(1 + n);
             double expected = Gamma.logGamma(1 + n);
-            Assert.assertEquals(expected, factorialLog.value(n), 1e-10);
+            Assertions.assertEquals(expected, factorialLog.value(n), 1e-10);
         }
     }
 
diff --git a/commons-rng-sampling/src/test/java/org/apache/commons/rng/sampling/distribution/KempSmallMeanPoissonSamplerTest.java b/commons-rng-sampling/src/test/java/org/apache/commons/rng/sampling/distribution/KempSmallMeanPoissonSamplerTest.java
index 802b976..cec759b 100644
--- a/commons-rng-sampling/src/test/java/org/apache/commons/rng/sampling/distribution/KempSmallMeanPoissonSamplerTest.java
+++ b/commons-rng-sampling/src/test/java/org/apache/commons/rng/sampling/distribution/KempSmallMeanPoissonSamplerTest.java
@@ -20,7 +20,7 @@ import org.apache.commons.math3.distribution.PoissonDistribution;
 import org.apache.commons.rng.UniformRandomProvider;
 import org.apache.commons.rng.sampling.RandomAssert;
 import org.apache.commons.rng.simple.RandomSource;
-import org.junit.Assert;
+import org.junit.jupiter.api.Assertions;
 import org.junit.Test;
 
 /**
@@ -94,8 +94,8 @@ public class KempSmallMeanPoissonSamplerTest {
             x = x + 1;
             p = p * mean / x;
         }
-        Assert.assertEquals("Summation is not zero", 0, u, 1e-3);
-        Assert.assertTrue("Summation is not greater than zero", u > 0);
+        Assertions.assertEquals(0, u, 1e-3, "Summation is not zero");
+        Assertions.assertTrue(u > 0, "Summation is not greater than zero");
     }
 
     /**
@@ -113,8 +113,8 @@ public class KempSmallMeanPoissonSamplerTest {
             x = x + 1;
             p = p * mean / x;
         }
-        Assert.assertEquals("Summation is not one", 1, u, 1e-3);
-        Assert.assertTrue("Summation is not less than one", u < 1);
+        Assertions.assertEquals(1, u, 1e-3, "Summation is not one");
+        Assertions.assertTrue(u < 1, "Summation is not less than one");
     }
 
     /**
@@ -173,8 +173,8 @@ public class KempSmallMeanPoissonSamplerTest {
         int lower, int upper) {
         rng.setValue(cumulativeProbability);
         final int sample = sampler.sample();
-        Assert.assertTrue(sample + " sample is not above realistic lower limit: " + lower, sample >= lower);
-        Assert.assertTrue(sample + " sample is not below realistic upper limit: " + upper, sample <= upper);
+        Assertions.assertTrue(sample >= lower, () -> sample + " sample is not above realistic lower limit: " + lower);
+        Assertions.assertTrue(sample <= upper, () -> sample + " sample is not below realistic upper limit: " + upper);
     }
 
     /**
diff --git a/commons-rng-sampling/src/test/java/org/apache/commons/rng/sampling/distribution/LargeMeanPoissonSamplerTest.java b/commons-rng-sampling/src/test/java/org/apache/commons/rng/sampling/distribution/LargeMeanPoissonSamplerTest.java
index dbdfa6b..f3707e4 100644
--- a/commons-rng-sampling/src/test/java/org/apache/commons/rng/sampling/distribution/LargeMeanPoissonSamplerTest.java
+++ b/commons-rng-sampling/src/test/java/org/apache/commons/rng/sampling/distribution/LargeMeanPoissonSamplerTest.java
@@ -22,7 +22,7 @@ import org.apache.commons.rng.UniformRandomProvider;
 import org.apache.commons.rng.sampling.RandomAssert;
 import org.apache.commons.rng.sampling.distribution.LargeMeanPoissonSampler.LargeMeanPoissonSamplerState;
 import org.apache.commons.rng.simple.RandomSource;
-import org.junit.Assert;
+import org.junit.jupiter.api.Assertions;
 import org.junit.Test;
 
 /**
@@ -135,8 +135,8 @@ public class LargeMeanPoissonSamplerTest {
         final LargeMeanPoissonSamplerState state1 = s1.getState();
         final LargeMeanPoissonSampler s2 = new LargeMeanPoissonSampler(rng2, state1, lambdaFractional);
         final LargeMeanPoissonSamplerState state2 = s2.getState();
-        Assert.assertEquals("State lambdas are not equal", state1.getLambda(), state2.getLambda());
-        Assert.assertNotSame("States are the same object", state1, state2);
+        Assertions.assertEquals(state1.getLambda(), state2.getLambda(), "State lambdas are not equal");
+        Assertions.assertNotSame(state1, state2, "States are the same object");
         RandomAssert.assertProduceSameSequence(s1, s2);
     }
 
diff --git a/commons-rng-sampling/src/test/java/org/apache/commons/rng/sampling/distribution/LevySamplerTest.java b/commons-rng-sampling/src/test/java/org/apache/commons/rng/sampling/distribution/LevySamplerTest.java
index 0d32410..27cbc61 100644
--- a/commons-rng-sampling/src/test/java/org/apache/commons/rng/sampling/distribution/LevySamplerTest.java
+++ b/commons-rng-sampling/src/test/java/org/apache/commons/rng/sampling/distribution/LevySamplerTest.java
@@ -21,7 +21,7 @@ import org.apache.commons.rng.core.source64.SplitMix64;
 import org.apache.commons.rng.sampling.RandomAssert;
 import org.apache.commons.rng.simple.RandomSource;
 
-import org.junit.Assert;
+import org.junit.jupiter.api.Assertions;
 import org.junit.Test;
 
 /**
@@ -79,7 +79,7 @@ public class LevySamplerTest {
                     return 0L;
                 }
             }, location, scale);
-        Assert.assertEquals(Double.POSITIVE_INFINITY, s1.sample(), 0.0);
+        Assertions.assertEquals(Double.POSITIVE_INFINITY, s1.sample());
 
         // Force the underlying ZigguratSampler.NormalizedGaussian to create a large
         // sample in the tail of the distribution.
@@ -117,6 +117,6 @@ public class LevySamplerTest {
         // So the sampler never achieves the lower bound of zero.
         // It requires an extreme deviate from the Gaussian.
         final double expected = 1 / (s * s);
-        Assert.assertEquals(expected, s2.sample(), 0.0);
+        Assertions.assertEquals(expected, s2.sample());
     }
 }
diff --git a/commons-rng-sampling/src/test/java/org/apache/commons/rng/sampling/distribution/MarsagliaNormalisedGaussianSamplerTest.java b/commons-rng-sampling/src/test/java/org/apache/commons/rng/sampling/distribution/MarsagliaNormalisedGaussianSamplerTest.java
index fdf4732..f766d54 100644
--- a/commons-rng-sampling/src/test/java/org/apache/commons/rng/sampling/distribution/MarsagliaNormalisedGaussianSamplerTest.java
+++ b/commons-rng-sampling/src/test/java/org/apache/commons/rng/sampling/distribution/MarsagliaNormalisedGaussianSamplerTest.java
@@ -20,7 +20,7 @@ import org.apache.commons.rng.UniformRandomProvider;
 import org.apache.commons.rng.core.source32.IntProvider;
 import org.apache.commons.rng.sampling.RandomAssert;
 import org.apache.commons.rng.simple.RandomSource;
-import org.junit.Assert;
+import org.junit.jupiter.api.Assertions;
 import org.junit.Test;
 
 /**
@@ -79,6 +79,6 @@ public class MarsagliaNormalisedGaussianSamplerTest {
         final double x = 2 * value - 1;
         final double r2 = x * x + x * x;
         final double expected = x * Math.sqrt(-2 * Math.log(r2) / r2);
-        Assert.assertEquals(expected, sampler.sample(), 0);
+        Assertions.assertEquals(expected, sampler.sample());
     }
 }
diff --git a/commons-rng-sampling/src/test/java/org/apache/commons/rng/sampling/distribution/MarsagliaTsangWangDiscreteSamplerTest.java b/commons-rng-sampling/src/test/java/org/apache/commons/rng/sampling/distribution/MarsagliaTsangWangDiscreteSamplerTest.java
index 8e3573c..ffbaab3 100644
--- a/commons-rng-sampling/src/test/java/org/apache/commons/rng/sampling/distribution/MarsagliaTsangWangDiscreteSamplerTest.java
+++ b/commons-rng-sampling/src/test/java/org/apache/commons/rng/sampling/distribution/MarsagliaTsangWangDiscreteSamplerTest.java
@@ -22,7 +22,7 @@ import org.apache.commons.rng.core.source32.IntProvider;
 import org.apache.commons.rng.core.source64.SplitMix64;
 import org.apache.commons.rng.sampling.RandomAssert;
 import org.apache.commons.rng.simple.RandomSource;
-import org.junit.Assert;
+import org.junit.jupiter.api.Assertions;
 import org.junit.Test;
 
 /**
@@ -75,7 +75,7 @@ public class MarsagliaTsangWangDiscreteSamplerTest {
         final DiscreteSampler sampler = createDiscreteDistributionSampler(new double[] {0.5, 0.5});
         String text = sampler.toString();
         for (String item : new String[] {"Marsaglia", "Tsang", "Wang"}) {
-            Assert.assertTrue("toString missing: " + item, text.contains(item));
+            Assertions.assertTrue(text.contains(item), () -> "toString missing: " + item);
         }
     }
 
@@ -155,8 +155,8 @@ public class MarsagliaTsangWangDiscreteSamplerTest {
             final int s1 = sampler1.sample() - offset1;
             final int s2 = sampler2.sample() - offset2;
             final int s3 = sampler3.sample() - offset3;
-            Assert.assertEquals("Offset sample 1 and 2 do not match", s1, s2);
-            Assert.assertEquals("Offset Sample 1 and 3 do not match", s1, s3);
+            Assertions.assertEquals(s1, s2, "Offset sample 1 and 2 do not match");
+            Assertions.assertEquals(s1, s3, "Offset Sample 1 and 3 do not match");
         }
     }
 
@@ -204,7 +204,7 @@ public class MarsagliaTsangWangDiscreteSamplerTest {
 
         final ChiSquareTest chiSquareTest = new ChiSquareTest();
         // Pass if we cannot reject null hypothesis that the distributions are the same.
-        Assert.assertFalse(chiSquareTest.chiSquareTest(probabilities, samples, 0.001));
+        Assertions.assertFalse(chiSquareTest.chiSquareTest(probabilities, samples, 0.001));
     }
 
     /**
@@ -258,7 +258,7 @@ public class MarsagliaTsangWangDiscreteSamplerTest {
         // Check the sum is less than 2^30
         final long sum = (long) maxSamples * m;
         final int total = 1 << 30;
-        Assert.assertTrue("Worst case uniform distribution is above 2^30", sum < total);
+        Assertions.assertTrue(sum < total, "Worst case uniform distribution is above 2^30");
 
         // Get the digits as per the sampler and compute storage
         final int d1 = getBase64Digit(m, 1);
@@ -276,9 +276,9 @@ public class MarsagliaTsangWangDiscreteSamplerTest {
             bytes = 4;
         }
         final double storageMB = bytes * 1e-6 * (d1 + d2 + d3 + d4 + d5) * maxSamples;
-        Assert.assertTrue(
-            "Worst case uniform distribution storage " + storageMB + "MB is above expected limit: " + expectedLimitMB,
-            storageMB < expectedLimitMB);
+        Assertions.assertTrue(storageMB < expectedLimitMB,
+            () -> "Worst case uniform distribution storage " + storageMB +
+                  "MB is above expected limit: " + expectedLimitMB);
     }
 
     /**
@@ -422,8 +422,8 @@ public class MarsagliaTsangWangDiscreteSamplerTest {
         final int trials = (int) Math.floor(Math.log(Double.MIN_VALUE) / Math.log(0.5));
         final double p = 0.5;
         // Validate set-up
-        Assert.assertEquals("Invalid test set-up for p(0)", Double.MIN_VALUE, getBinomialP0(trials, p), 0);
-        Assert.assertEquals("Invalid test set-up for p(0)", 0, getBinomialP0(trials + 1, p), 0);
+        Assertions.assertEquals(Double.MIN_VALUE, getBinomialP0(trials, p), 0, "Invalid test set-up for p(0)");
+        Assertions.assertEquals(0, getBinomialP0(trials + 1, p), 0, "Invalid test set-up for p(0)");
 
         // This will throw if the table does not sum to 2^30
         final DiscreteSampler sampler = MarsagliaTsangWangDiscreteSampler.Binomial.of(rng, trials, p);
@@ -441,7 +441,7 @@ public class MarsagliaTsangWangDiscreteSamplerTest {
         final int trials = 1 + (int) Math.floor(Math.log(Double.MIN_VALUE) / Math.log(0.5));
         final double p = 0.5;
         // Validate set-up
-        Assert.assertEquals("Invalid test set-up for p(0)", 0, getBinomialP0(trials, p), 0);
+        Assertions.assertEquals(0, getBinomialP0(trials, p), 0, "Invalid test set-up for p(0)");
         @SuppressWarnings("unused")
         final DiscreteSampler sampler = MarsagliaTsangWangDiscreteSampler.Binomial.of(rng, trials, p);
     }
@@ -465,11 +465,11 @@ public class MarsagliaTsangWangDiscreteSamplerTest {
         double p = 1 - Math.exp(Math.log(Double.MIN_VALUE) / trials);
 
         // Validate set-up
-        Assert.assertEquals("Invalid test set-up for p(0)", Double.MIN_VALUE, getBinomialP0(trials, p), 0);
+        Assertions.assertEquals(Double.MIN_VALUE, getBinomialP0(trials, p), 0, "Invalid test set-up for p(0)");
 
         // Search for larger p until Math.nextUp(p) produces 0
         double upper = p * 2;
-        Assert.assertEquals("Invalid test set-up for p(0)", 0, getBinomialP0(trials, upper), 0);
+        Assertions.assertEquals(0, getBinomialP0(trials, upper), 0, "Invalid test set-up for p(0)");
 
         double lower = p;
         while (Double.doubleToRawLongBits(lower) + 1 < Double.doubleToRawLongBits(upper)) {
@@ -483,8 +483,8 @@ public class MarsagliaTsangWangDiscreteSamplerTest {
         p = lower;
 
         // Re-validate
-        Assert.assertEquals("Invalid test set-up for p(0)", Double.MIN_VALUE, getBinomialP0(trials, p), 0);
-        Assert.assertEquals("Invalid test set-up for p(0)", 0, getBinomialP0(trials, Math.nextUp(p)), 0);
+        Assertions.assertEquals(Double.MIN_VALUE, getBinomialP0(trials, p), 0, "Invalid test set-up for p(0)");
+        Assertions.assertEquals(0, getBinomialP0(trials, Math.nextUp(p)), 0, "Invalid test set-up for p(0)");
 
         final DiscreteSampler sampler = MarsagliaTsangWangDiscreteSampler.Binomial.of(rng, trials, p);
         // This will throw if the table does not sum to 2^30
@@ -512,10 +512,10 @@ public class MarsagliaTsangWangDiscreteSamplerTest {
         final double p = 0;
         final DiscreteSampler sampler = MarsagliaTsangWangDiscreteSampler.Binomial.of(rng, trials, p);
         for (int i = 0; i < 5; i++) {
-            Assert.assertEquals(0, sampler.sample());
+            Assertions.assertEquals(0, sampler.sample());
         }
         // Hit the toString() method
-        Assert.assertTrue(sampler.toString().contains("Binomial"));
+        Assertions.assertTrue(sampler.toString().contains("Binomial"));
     }
 
     /**
@@ -529,10 +529,10 @@ public class MarsagliaTsangWangDiscreteSamplerTest {
         final double p = 1;
         final DiscreteSampler sampler = MarsagliaTsangWangDiscreteSampler.Binomial.of(rng, trials, p);
         for (int i = 0; i < 5; i++) {
-            Assert.assertEquals(trials, sampler.sample());
+            Assertions.assertEquals(trials, sampler.sample());
         }
         // Hit the toString() method
-        Assert.assertTrue(sampler.toString().contains("Binomial"));
+        Assertions.assertTrue(sampler.toString().contains("Binomial"));
     }
 
     /**
@@ -578,7 +578,7 @@ public class MarsagliaTsangWangDiscreteSamplerTest {
         final double p2 = 1 - p1;
         final DiscreteSampler sampler1 = MarsagliaTsangWangDiscreteSampler.Binomial.of(rng, trials, p1);
         final DiscreteSampler sampler2 = MarsagliaTsangWangDiscreteSampler.Binomial.of(rng, trials, p2);
-        Assert.assertEquals(sampler1.toString(), sampler2.toString());
+        Assertions.assertEquals(sampler1.toString(), sampler2.toString());
     }
 
     /**
diff --git a/commons-rng-sampling/src/test/java/org/apache/commons/rng/sampling/distribution/PoissonSamplerCacheTest.java b/commons-rng-sampling/src/test/java/org/apache/commons/rng/sampling/distribution/PoissonSamplerCacheTest.java
index 85490e9..a604199 100644
--- a/commons-rng-sampling/src/test/java/org/apache/commons/rng/sampling/distribution/PoissonSamplerCacheTest.java
+++ b/commons-rng-sampling/src/test/java/org/apache/commons/rng/sampling/distribution/PoissonSamplerCacheTest.java
@@ -18,7 +18,7 @@ package org.apache.commons.rng.sampling.distribution;
 
 import org.apache.commons.rng.RestorableUniformRandomProvider;
 import org.apache.commons.rng.simple.RandomSource;
-import org.junit.Assert;
+import org.junit.jupiter.api.Assertions;
 import org.junit.Test;
 
 /**
@@ -43,7 +43,7 @@ public class PoissonSamplerCacheTest {
      */
     @Test
     public void testMinimumCachedMean() {
-        Assert.assertEquals(PoissonSampler.PIVOT, PoissonSamplerCache.getMinimumCachedMean(), 0);
+        Assertions.assertEquals(PoissonSampler.PIVOT, PoissonSamplerCache.getMinimumCachedMean());
     }
 
     // Edge cases for construction
@@ -58,9 +58,9 @@ public class PoissonSamplerCacheTest {
         final double min = 0;
         final double max = PoissonSampler.PIVOT - 2;
         final PoissonSamplerCache cache = createPoissonSamplerCache(min, max);
-        Assert.assertFalse(cache.isValidRange());
-        Assert.assertEquals(0, cache.getMinMean(), 0);
-        Assert.assertEquals(0, cache.getMaxMean(), 0);
+        Assertions.assertFalse(cache.isValidRange());
+        Assertions.assertEquals(0, cache.getMinMean());
+        Assertions.assertEquals(0, cache.getMaxMean());
     }
 
     /**
@@ -73,10 +73,10 @@ public class PoissonSamplerCacheTest {
         final double min = PoissonSampler.PIVOT + 2;
         final double max = min;
         final PoissonSamplerCache cache = createPoissonSamplerCache(min, max);
-        Assert.assertTrue(cache.isValidRange());
-        Assert.assertEquals(min, cache.getMinMean(), 0);
-        Assert.assertEquals(Math.nextDown(Math.floor(max) + 1),
-                            cache.getMaxMean(), 0);
+        Assertions.assertTrue(cache.isValidRange());
+        Assertions.assertEquals(min, cache.getMinMean());
+        Assertions.assertEquals(Math.nextDown(Math.floor(max) + 1),
+                                cache.getMaxMean());
     }
 
     /**
@@ -89,10 +89,10 @@ public class PoissonSamplerCacheTest {
         final double min = PoissonSampler.PIVOT + 2;
         final double max = min + 10;
         final PoissonSamplerCache cache = createPoissonSamplerCache(min, max);
-        Assert.assertTrue(cache.isValidRange());
-        Assert.assertEquals(min, cache.getMinMean(), 0);
-        Assert.assertEquals(Math.nextDown(Math.floor(max) + 1),
-                            cache.getMaxMean(), 0);
+        Assertions.assertTrue(cache.isValidRange());
+        Assertions.assertEquals(min, cache.getMinMean());
+        Assertions.assertEquals(Math.nextDown(Math.floor(max) + 1),
+                                cache.getMaxMean());
     }
 
     /**
@@ -114,10 +114,10 @@ public class PoissonSamplerCacheTest {
         final double min = -1;
         final double max = PoissonSampler.PIVOT + 2;
         final PoissonSamplerCache cache = createPoissonSamplerCache(min, max);
-        Assert.assertTrue(cache.isValidRange());
-        Assert.assertEquals(PoissonSampler.PIVOT, cache.getMinMean(), 0);
-        Assert.assertEquals(Math.nextDown(Math.floor(max) + 1),
-                            cache.getMaxMean(), 0);
+        Assertions.assertTrue(cache.isValidRange());
+        Assertions.assertEquals(PoissonSampler.PIVOT, cache.getMinMean());
+        Assertions.assertEquals(Math.nextDown(Math.floor(max) + 1),
+                                cache.getMaxMean());
     }
 
     /**
@@ -129,9 +129,9 @@ public class PoissonSamplerCacheTest {
         final double min = -10;
         final double max = -1;
         final PoissonSamplerCache cache = createPoissonSamplerCache(min, max);
-        Assert.assertFalse(cache.isValidRange());
-        Assert.assertEquals(0, cache.getMinMean(), 0);
-        Assert.assertEquals(0, cache.getMaxMean(), 0);
+        Assertions.assertFalse(cache.isValidRange());
+        Assertions.assertEquals(0, cache.getMinMean());
+        Assertions.assertEquals(0, cache.getMaxMean());
     }
 
     /**
@@ -144,9 +144,9 @@ public class PoissonSamplerCacheTest {
         final double min = 0;
         final double max = PoissonSampler.PIVOT - 2;
         final PoissonSamplerCache cache = createPoissonSamplerCache().withRange(min, max);
-        Assert.assertFalse(cache.isValidRange());
-        Assert.assertEquals(0, cache.getMinMean(), 0);
-        Assert.assertEquals(0, cache.getMaxMean(), 0);
+        Assertions.assertFalse(cache.isValidRange());
+        Assertions.assertEquals(0, cache.getMinMean());
+        Assertions.assertEquals(0, cache.getMaxMean());
     }
 
     /**
@@ -159,10 +159,10 @@ public class PoissonSamplerCacheTest {
         final double min = PoissonSampler.PIVOT + 2;
         final double max = min;
         final PoissonSamplerCache cache = createPoissonSamplerCache().withRange(min, max);
-        Assert.assertTrue(cache.isValidRange());
-        Assert.assertEquals(min, cache.getMinMean(), 0);
-        Assert.assertEquals(Math.nextDown(Math.floor(max) + 1),
-                            cache.getMaxMean(), 0);
+        Assertions.assertTrue(cache.isValidRange());
+        Assertions.assertEquals(min, cache.getMinMean());
+        Assertions.assertEquals(Math.nextDown(Math.floor(max) + 1),
+                                cache.getMaxMean());
     }
 
     /**
@@ -175,10 +175,10 @@ public class PoissonSamplerCacheTest {
         final double min = PoissonSampler.PIVOT + 2;
         final double max = min + 10;
         final PoissonSamplerCache cache = createPoissonSamplerCache().withRange(min, max);
-        Assert.assertTrue(cache.isValidRange());
-        Assert.assertEquals(min, cache.getMinMean(), 0);
-        Assert.assertEquals(Math.nextDown(Math.floor(max) + 1),
-                            cache.getMaxMean(), 0);
+        Assertions.assertTrue(cache.isValidRange());
+        Assertions.assertEquals(min, cache.getMinMean());
+        Assertions.assertEquals(Math.nextDown(Math.floor(max) + 1),
+                                cache.getMaxMean());
     }
 
     /**
@@ -200,10 +200,10 @@ public class PoissonSamplerCacheTest {
         final double min = -1;
         final double max = PoissonSampler.PIVOT + 2;
         final PoissonSamplerCache cache = createPoissonSamplerCache().withRange(min, max);
-        Assert.assertTrue(cache.isValidRange());
-        Assert.assertEquals(PoissonSampler.PIVOT, cache.getMinMean(), 0);
-        Assert.assertEquals(Math.nextDown(Math.floor(max) + 1),
-                            cache.getMaxMean(), 0);
+        Assertions.assertTrue(cache.isValidRange());
+        Assertions.assertEquals(PoissonSampler.PIVOT, cache.getMinMean());
+        Assertions.assertEquals(Math.nextDown(Math.floor(max) + 1),
+                                cache.getMaxMean());
     }
 
     /**
@@ -214,10 +214,10 @@ public class PoissonSamplerCacheTest {
         final double min = PoissonSampler.PIVOT + 2;
         final double max = min + 10;
         final PoissonSamplerCache cache = createPoissonSamplerCache(0, 0).withRange(min, max);
-        Assert.assertTrue(cache.isValidRange());
-        Assert.assertEquals(min, cache.getMinMean(), 0);
-        Assert.assertEquals(Math.nextDown(Math.floor(max) + 1),
-                            cache.getMaxMean(), 0);
+        Assertions.assertTrue(cache.isValidRange());
+        Assertions.assertEquals(min, cache.getMinMean());
+        Assertions.assertEquals(Math.nextDown(Math.floor(max) + 1),
+                                cache.getMaxMean());
     }
 
     /**
@@ -230,11 +230,11 @@ public class PoissonSamplerCacheTest {
         final double max = PoissonSampler.PIVOT + 20;
         final PoissonSamplerCache cache = createPoissonSamplerCache(min, max);
         // Under the pivot point is always within range
-        Assert.assertTrue(cache.withinRange(PoissonSampler.PIVOT - 1));
-        Assert.assertFalse(cache.withinRange(min - 1));
-        Assert.assertTrue(cache.withinRange(min));
-        Assert.assertTrue(cache.withinRange(max));
-        Assert.assertFalse(cache.withinRange(max + 10));
+        Assertions.assertTrue(cache.withinRange(PoissonSampler.PIVOT - 1));
+        Assertions.assertFalse(cache.withinRange(min - 1));
+        Assertions.assertTrue(cache.withinRange(min));
+        Assertions.assertTrue(cache.withinRange(max));
+        Assertions.assertFalse(cache.withinRange(max + 10));
     }
 
     // Edge cases for creating a Poisson sampler
@@ -384,7 +384,7 @@ public class PoissonSamplerCacheTest {
         final DiscreteSampler s1 = PoissonSampler.of(rng1, mean);
         final DiscreteSampler s2 = cache.createSharedStateSampler(rng2, mean);
         for (int j = 0; j < 10; j++) {
-            Assert.assertEquals(s1.sample(), s2.sample());
+            Assertions.assertEquals(s1.sample(), s2.sample());
         }
     }
 
@@ -468,7 +468,7 @@ public class PoissonSamplerCacheTest {
         }
 
         final PoissonSamplerCache cache2 = cache.withRange(minMean2, maxMean2);
-        Assert.assertNotSame("WithRange cache is the same object", cache, cache2);
+        Assertions.assertNotSame(cache, cache2, "WithRange cache is the same object");
 
         // Test all means in the test range (which may be different
         // from the cache range).
@@ -489,6 +489,6 @@ public class PoissonSamplerCacheTest {
     public void testCreatePoissonSampler() {
         final PoissonSamplerCache cache = createPoissonSamplerCache(0, 100);
         final DiscreteSampler s2 = cache.createPoissonSampler(null, 42);
-        Assert.assertTrue(s2 instanceof LargeMeanPoissonSampler);
+        Assertions.assertTrue(s2 instanceof LargeMeanPoissonSampler);
     }
 }
diff --git a/commons-rng-sampling/src/test/java/org/apache/commons/rng/sampling/distribution/PoissonSamplerTest.java b/commons-rng-sampling/src/test/java/org/apache/commons/rng/sampling/distribution/PoissonSamplerTest.java
index 4385633..63cc85b 100644
--- a/commons-rng-sampling/src/test/java/org/apache/commons/rng/sampling/distribution/PoissonSamplerTest.java
+++ b/commons-rng-sampling/src/test/java/org/apache/commons/rng/sampling/distribution/PoissonSamplerTest.java
@@ -19,7 +19,7 @@ package org.apache.commons.rng.sampling.distribution;
 import org.apache.commons.rng.UniformRandomProvider;
 import org.apache.commons.rng.sampling.RandomAssert;
 import org.apache.commons.rng.simple.RandomSource;
-import org.junit.Assert;
+import org.junit.jupiter.api.Assertions;
 import org.junit.Test;
 
 
@@ -66,6 +66,6 @@ public class PoissonSamplerTest {
     @Test
     public void testToString() {
         final UniformRandomProvider rng = RandomSource.SPLIT_MIX_64.create(0L);
-        Assert.assertTrue(new PoissonSampler(rng, 1.23).toString().toLowerCase().contains("poisson"));
+        Assertions.assertTrue(new PoissonSampler(rng, 1.23).toString().toLowerCase().contains("poisson"));
     }
 }
diff --git a/commons-rng-sampling/src/test/java/org/apache/commons/rng/sampling/distribution/SamplerBaseTest.java b/commons-rng-sampling/src/test/java/org/apache/commons/rng/sampling/distribution/SamplerBaseTest.java
index af8db5b..e5e97cb 100644
--- a/commons-rng-sampling/src/test/java/org/apache/commons/rng/sampling/distribution/SamplerBaseTest.java
+++ b/commons-rng-sampling/src/test/java/org/apache/commons/rng/sampling/distribution/SamplerBaseTest.java
@@ -18,7 +18,7 @@ package org.apache.commons.rng.sampling.distribution;
 
 import org.apache.commons.rng.UniformRandomProvider;
 import org.apache.commons.rng.simple.RandomSource;
-import org.junit.Assert;
+import org.junit.jupiter.api.Assertions;
 import org.junit.Test;
 
 /**
@@ -63,10 +63,10 @@ public class SamplerBaseTest {
         final SimpleSampler sampler = new SimpleSampler(rng2);
         final int n = 256;
         for (int i = 0; i < 3; i++) {
-            Assert.assertEquals(rng1.nextDouble(), sampler.nextDouble(), 0);
-            Assert.assertEquals(rng1.nextInt(), sampler.nextInt());
-            Assert.assertEquals(rng1.nextInt(n), sampler.nextInt(n));
-            Assert.assertEquals(rng1.nextLong(), sampler.nextLong());
+            Assertions.assertEquals(rng1.nextDouble(), sampler.nextDouble());
+            Assertions.assertEquals(rng1.nextInt(), sampler.nextInt());
+            Assertions.assertEquals(rng1.nextInt(n), sampler.nextInt(n));
+            Assertions.assertEquals(rng1.nextLong(), sampler.nextLong());
         }
     }
 
@@ -74,6 +74,6 @@ public class SamplerBaseTest {
     public void testToString() {
         final UniformRandomProvider rng = RandomSource.SPLIT_MIX_64.create(0L);
         final SimpleSampler sampler = new SimpleSampler(rng);
-        Assert.assertTrue(sampler.toString().contains("rng"));
+        Assertions.assertTrue(sampler.toString().contains("rng"));
     }
 }
diff --git a/commons-rng-sampling/src/test/java/org/apache/commons/rng/sampling/distribution/SmallMeanPoissonSamplerTest.java b/commons-rng-sampling/src/test/java/org/apache/commons/rng/sampling/distribution/SmallMeanPoissonSamplerTest.java
index 57bd094..a1f9427 100644
--- a/commons-rng-sampling/src/test/java/org/apache/commons/rng/sampling/distribution/SmallMeanPoissonSamplerTest.java
+++ b/commons-rng-sampling/src/test/java/org/apache/commons/rng/sampling/distribution/SmallMeanPoissonSamplerTest.java
@@ -19,7 +19,7 @@ package org.apache.commons.rng.sampling.distribution;
 import org.apache.commons.rng.UniformRandomProvider;
 import org.apache.commons.rng.sampling.RandomAssert;
 import org.apache.commons.rng.simple.RandomSource;
-import org.junit.Assert;
+import org.junit.jupiter.api.Assertions;
 import org.junit.Test;
 
 /**
@@ -73,7 +73,7 @@ public class SmallMeanPoissonSamplerTest {
         for (double mean : new double[] {0.5, 1, 1.5, 2.2}) {
             final SharedStateDiscreteSampler sampler = SmallMeanPoissonSampler.of(rng, mean);
             final int expected = (int) Math.ceil(1000 * mean);
-            Assert.assertEquals(expected, sampler.sample());
+            Assertions.assertEquals(expected, sampler.sample());
         }
     }
 
diff --git a/commons-rng-sampling/src/test/java/org/apache/commons/rng/sampling/distribution/StableSamplerTest.java b/commons-rng-sampling/src/test/java/org/apache/commons/rng/sampling/distribution/StableSamplerTest.java
index efe2c02..29ebe13 100644
--- a/commons-rng-sampling/src/test/java/org/apache/commons/rng/sampling/distribution/StableSamplerTest.java
+++ b/commons-rng-sampling/src/test/java/org/apache/commons/rng/sampling/distribution/StableSamplerTest.java
@@ -16,8 +16,9 @@
  */
 package org.apache.commons.rng.sampling.distribution;
 
-import org.junit.Assert;
+import org.junit.jupiter.api.Assertions;
 import org.junit.Test;
+import java.util.function.Supplier;
 import org.apache.commons.rng.UniformRandomProvider;
 import org.apache.commons.rng.core.source64.SplitMix64;
 import org.apache.commons.rng.sampling.RandomAssert;
@@ -88,12 +89,12 @@ public class StableSamplerTest {
         // The number 1 - alpha must not be 1.
         // This is valid
         StableSampler s = createStableSampler(SMALLEST_ALPHA, VALID_BETA, VALID_GAMMA, VALID_DELTA);
-        Assert.assertNotNull(s);
+        Assertions.assertNotNull(s);
 
         // Smaller than this is still above zero but 1 - alpha == 1
         final double alphaTooSmall = SMALLEST_ALPHA / 2;
-        Assert.assertNotEquals("Expected alpha to be positive", 0.0, alphaTooSmall, 0.0);
-        Assert.assertEquals("Expected rounding to 1", 1.0, 1 - alphaTooSmall, 0.0);
+        Assertions.assertNotEquals(0.0, alphaTooSmall, "Expected alpha to be positive");
+        Assertions.assertEquals(1.0, 1 - alphaTooSmall, "Expected rounding to 1");
 
         // Because alpha is effectively zero this will throw
         createStableSampler(alphaTooSmall, VALID_BETA, VALID_GAMMA, VALID_DELTA);
@@ -184,8 +185,8 @@ public class StableSamplerTest {
 
         // alpha -> 2: tau -> 0
         // alpha -> 0: tau -> 0
-        Assert.assertEquals(0.0, CMSStableSampler.getTau(2, beta), 0.0);
-        Assert.assertEquals(0.0, CMSStableSampler.getTau(0, beta), 0.0);
+        Assertions.assertEquals(0.0, CMSStableSampler.getTau(2, beta));
+        Assertions.assertEquals(0.0, CMSStableSampler.getTau(0, beta));
 
         // Full range over 0 to 2.
         for (int i = 0; i <= 512; i++) {
@@ -193,46 +194,46 @@ public class StableSamplerTest {
             final double alpha = (double) i / 256;
             final double tau = CMSStableSampler.getTau(alpha, beta);
             final double expected = getTauOriginal(alpha, beta);
-            Assert.assertEquals(expected, tau, 1e-15);
+            Assertions.assertEquals(expected, tau, 1e-15);
 
             // Symmetric
-            Assert.assertEquals(tau, CMSStableSampler.getTau(2 - alpha, beta), 0.0);
+            Assertions.assertEquals(tau, CMSStableSampler.getTau(2 - alpha, beta));
         }
 
         // alpha -> 1: tau -> beta / (pi / 2) = 0.6366
         final double limit = beta / PI_2;
-        Assert.assertEquals(limit, CMSStableSampler.getTau(1, beta), 0.0);
+        Assertions.assertEquals(limit, CMSStableSampler.getTau(1, beta));
         for (double alpha : new double[] {1.01, 1 + 1e-6, 1, 1 - 1e-6, 0.99}) {
             final double tau = CMSStableSampler.getTau(alpha, beta);
             final double expected = getTauOriginal(alpha, beta);
-            Assert.assertEquals(expected, tau, 1e-15);
+            Assertions.assertEquals(expected, tau, 1e-15);
             // Approach the limit
-            Assert.assertEquals(limit, tau, Math.abs(1 - alpha) + 1e-15);
+            Assertions.assertEquals(limit, tau, Math.abs(1 - alpha) + 1e-15);
         }
 
         // It can be zero if beta is zero or close to zero when alpha != 1.
         // This requires we check tau==0 instead of beta==0 to switch to
         // a beta = 0 sampler.
-        Assert.assertEquals(0.0, CMSStableSampler.getTau(1.3, 0.0), 0.0);
-        Assert.assertEquals(0.0, CMSStableSampler.getTau(1.5, Double.MIN_VALUE), 0.0);
-        Assert.assertNotEquals(0.0, CMSStableSampler.getTau(1.0, Double.MIN_VALUE), 0.0);
+        Assertions.assertEquals(0.0, CMSStableSampler.getTau(1.3, 0.0));
+        Assertions.assertEquals(0.0, CMSStableSampler.getTau(1.5, Double.MIN_VALUE));
+        Assertions.assertNotEquals(0.0, CMSStableSampler.getTau(1.0, Double.MIN_VALUE));
 
         // The sign of beta determines the sign of tau.
-        Assert.assertEquals(0.5, CMSStableSampler.getTau(1.5, beta), 0.0);
-        Assert.assertEquals(0.5, CMSStableSampler.getTau(0.5, beta), 0.0);
-        Assert.assertEquals(-0.5, CMSStableSampler.getTau(1.5, -beta), 0.0);
-        Assert.assertEquals(-0.5, CMSStableSampler.getTau(0.5, -beta), 0.0);
+        Assertions.assertEquals(0.5, CMSStableSampler.getTau(1.5, beta));
+        Assertions.assertEquals(0.5, CMSStableSampler.getTau(0.5, beta));
+        Assertions.assertEquals(-0.5, CMSStableSampler.getTau(1.5, -beta));
+        Assertions.assertEquals(-0.5, CMSStableSampler.getTau(0.5, -beta));
 
         // Check monototic at the transition point to switch to a different computation.
         final double tau1 = CMSStableSampler.getTau(Math.nextDown(1.5), 1);
         final double tau2 = CMSStableSampler.getTau(1.5, 1);
         final double tau3 = CMSStableSampler.getTau(Math.nextUp(1.5), 1);
-        Assert.assertTrue(tau1 > tau2);
-        Assert.assertTrue(tau2 > tau3);
+        Assertions.assertTrue(tau1 > tau2);
+        Assertions.assertTrue(tau2 > tau3);
         // Test symmetry at the transition
-        Assert.assertEquals(tau1, CMSStableSampler.getTau(2 - Math.nextDown(1.5), 1), 0.0);
-        Assert.assertEquals(tau2, CMSStableSampler.getTau(0.5, 1), 0.0);
-        Assert.assertEquals(tau3, CMSStableSampler.getTau(2 - Math.nextUp(1.5), 1), 0.0);
+        Assertions.assertEquals(tau1, CMSStableSampler.getTau(2 - Math.nextDown(1.5), 1));
+        Assertions.assertEquals(tau2, CMSStableSampler.getTau(0.5, 1));
+        Assertions.assertEquals(tau3, CMSStableSampler.getTau(2 - Math.nextUp(1.5), 1));
     }
 
     /**
@@ -278,27 +279,27 @@ public class StableSamplerTest {
         // The extreme limit of the angle phiby2. This is ignored by the sampler
         // as it can result in cancellation of terms and invalid results.
         final double p0 = getU(Long.MIN_VALUE);
-        Assert.assertEquals(-PI_4, p0, 0.0);
+        Assertions.assertEquals(-PI_4, p0);
 
         // These are the limits to generate (-pi/4, pi/4)
         final double p1 = getU(Long.MIN_VALUE + (1 << 10));
         final double p2 = getU(Long.MAX_VALUE);
-        Assert.assertNotEquals(-PI_4, p1, 0.0);
-        Assert.assertNotEquals(PI_4, p2, 0.0);
-        Assert.assertEquals(-PI_4 + PI_4 * DU, p1, 0.0);
-        Assert.assertEquals(PI_4 - PI_4 * DU, p2, 0.0);
+        Assertions.assertNotEquals(-PI_4, p1);
+        Assertions.assertNotEquals(PI_4, p2);
+        Assertions.assertEquals(-PI_4 + PI_4 * DU, p1);
+        Assertions.assertEquals(PI_4 - PI_4 * DU, p2);
 
         for (double phiby2 : new double[] {p1, p2}) {
             // phiby2 in (-pi/4, pi/4)
             // a in (-1, 1)
             final double a = phiby2 * SpecialMath.tan2(phiby2);
-            Assert.assertEquals(Math.copySign(Math.nextDown(1.0), phiby2), a, 0.0);
+            Assertions.assertEquals(Math.copySign(Math.nextDown(1.0), phiby2), a);
             final double da = a * a;
             final double a2 = 1 - da;
             // The number is close to but not equal to zero
-            Assert.assertNotEquals(0.0, a2, 0.0);
+            Assertions.assertNotEquals(0.0, a2);
             // The minimum value of a2 is 2.220E-16 = 2^-52
-            Assert.assertEquals(0x1.0p-52, a2, 0.0);
+            Assertions.assertEquals(0x1.0p-52, a2);
         }
     }
 
@@ -319,9 +320,9 @@ public class StableSamplerTest {
         final long x00 = Long.MIN_VALUE;
         final long x0 = Long.MIN_VALUE + (1 << 10);
         final long x1 = Long.MAX_VALUE;
-        Assert.assertEquals(-PI_4, getU(x00), 0.0);
-        Assert.assertEquals(-PI_4 + DU * PI_4, getU(x0), 0.0);
-        Assert.assertEquals(PI_4 - DU * PI_4, getU(x1), 0.0);
+        Assertions.assertEquals(-PI_4, getU(x00));
+        Assertions.assertEquals(-PI_4 + DU * PI_4, getU(x0));
+        Assertions.assertEquals(PI_4 - DU * PI_4, getU(x1));
         // General case numerator:
         // b2 + 2 * phiby2 * bb * tau
         // To generate 0 numerator requires:
@@ -355,41 +356,41 @@ public class StableSamplerTest {
         // This is not true due to floating-point
         // error but the following cases are known to exhibit the result.
 
-        Assert.assertEquals(0.0, computeNumerator(0.859375, 1, x00), 0.0);
+        Assertions.assertEquals(0.0, computeNumerator(0.859375, 1, x00));
         // Even worse to have negative as the log(-ve) = nan
-        Assert.assertTrue(0.0 > computeNumerator(0.9375, 1, x00));
-        Assert.assertTrue(0.0 > computeNumerator(1.90625, 1, x00));
+        Assertions.assertTrue(0.0 > computeNumerator(0.9375, 1, x00));
+        Assertions.assertTrue(0.0 > computeNumerator(1.90625, 1, x00));
 
         // As phi reduces in magnitude the equality fails.
         // The numerator=0 can often be corrected
         // with the next random variate from the range limit.
-        Assert.assertTrue(0.0 < computeNumerator(0.859375, 1, x0));
-        Assert.assertTrue(0.0 < computeNumerator(0.9375, 1, x0));
-        Assert.assertTrue(0.0 < computeNumerator(1.90625, 1, x0));
+        Assertions.assertTrue(0.0 < computeNumerator(0.859375, 1, x0));
+        Assertions.assertTrue(0.0 < computeNumerator(0.9375, 1, x0));
+        Assertions.assertTrue(0.0 < computeNumerator(1.90625, 1, x0));
 
         // WARNING:
         // Even when u is not at the limit floating point error can still create
         // a bad numerator. This is rare but shows we must still detect this edge
         // case.
-        Assert.assertTrue(0.0 > computeNumerator(0.828125, 1, x0));
-        Assert.assertTrue(0.0 > computeNumerator(1.291015625, -1, x1));
+        Assertions.assertTrue(0.0 > computeNumerator(0.828125, 1, x0));
+        Assertions.assertTrue(0.0 > computeNumerator(1.291015625, -1, x1));
 
         // beta=0 case the numerator reduces to b2:
         // b2 = 1 - tan^2((1-alpha) * phi/2)
         // requires tan(x)=1; x=pi/4.
         // Note: tan(x) = x * SpecialMath.tan2(x) returns +/-1 for u = +/-pi/4.
-        Assert.assertEquals(-1, SpecialMath.tan2(getU(x00)) * getU(x00), 0.0);
+        Assertions.assertEquals(-1, SpecialMath.tan2(getU(x00)) * getU(x00));
         // Using the next value in the range this is not an issue.
         // The beta=0 sampler does not have to check for z=0.
-        Assert.assertTrue(-1 < SpecialMath.tan2(getU(x0)) * getU(x0));
-        Assert.assertTrue(1 > SpecialMath.tan2(getU(x1)) * getU(x1));
+        Assertions.assertTrue(-1 < SpecialMath.tan2(getU(x0)) * getU(x0));
+        Assertions.assertTrue(1 > SpecialMath.tan2(getU(x1)) * getU(x1));
         // Use alpha=2 so 1-alpha (eps) is at the limit
         final double beta = 0;
-        Assert.assertEquals(0.0, computeNumerator(2, beta, x00), 0.0);
-        Assert.assertTrue(0.0 < computeNumerator(2, beta, x0));
-        Assert.assertTrue(0.0 < computeNumerator(2, beta, x1));
-        Assert.assertTrue(0.0 < computeNumerator(Math.nextDown(2), beta, x0));
-        Assert.assertTrue(0.0 < computeNumerator(Math.nextDown(2), beta, x1));
+        Assertions.assertEquals(0.0, computeNumerator(2, beta, x00));
+        Assertions.assertTrue(0.0 < computeNumerator(2, beta, x0));
+        Assertions.assertTrue(0.0 < computeNumerator(2, beta, x1));
+        Assertions.assertTrue(0.0 < computeNumerator(Math.nextDown(2), beta, x0));
+        Assertions.assertTrue(0.0 < computeNumerator(Math.nextDown(2), beta, x1));
 
         // alpha=1 case the numerator reduces to:
         // 1 + 2 * phi/2 * tau
@@ -402,14 +403,14 @@ public class StableSamplerTest {
         // beta = -1 => phiby2 = pi/4
         // The alpha=1 sampler does not have to check for z=0 if phiby2 excludes -pi/4.
         final double alpha = 1;
-        Assert.assertEquals(0.0, computeNumerator(alpha, 1, x00), 0.0);
+        Assertions.assertEquals(0.0, computeNumerator(alpha, 1, x00));
         // Next value of u computes above zero
-        Assert.assertTrue(0.0 < computeNumerator(alpha, 1, x0));
-        Assert.assertTrue(0.0 < computeNumerator(alpha, -1, x1));
+        Assertions.assertTrue(0.0 < computeNumerator(alpha, 1, x0));
+        Assertions.assertTrue(0.0 < computeNumerator(alpha, -1, x1));
         // beta < 1 => u < 0
         // beta > -1 => u > 1
         // z=0 not possible with any other beta
-        Assert.assertTrue(0.0 < computeNumerator(alpha, Math.nextUp(-1), x00));
+        Assertions.assertTrue(0.0 < computeNumerator(alpha, Math.nextUp(-1), x00));
     }
 
     /**
@@ -449,7 +450,7 @@ public class StableSamplerTest {
             // Finite z
             for (final double z : zs) {
                 // The result may be infinite, but not NaN
-                Assert.assertNotEquals(Double.NaN, computeD(alpha, z), 0.0);
+                Assertions.assertNotEquals(Double.NaN, computeD(alpha, z));
             }
 
             // May be invalid with z=0 or z=inf as some combinations multiply the
@@ -459,28 +460,28 @@ public class StableSamplerTest {
             final double d0 = computeD(alpha, 0);
             if (alpha < 1) {
                 // d2(-inf) * -inf = 0 * -inf = NaN
-                Assert.assertEquals(Double.NaN, d0, 0.0);
+                Assertions.assertEquals(Double.NaN, d0);
             } else if (alpha == 1) {
                 // d2(0 * -inf) -> NaN
-                Assert.assertEquals(Double.NaN, d0, 0.0);
+                Assertions.assertEquals(Double.NaN, d0);
             } else {
                 // alpha > 1
                 // d2(inf) * -inf = -inf
-                Assert.assertEquals(Double.NEGATIVE_INFINITY, d0, 0.0);
+                Assertions.assertEquals(Double.NEGATIVE_INFINITY, d0);
             }
 
             // When z=inf, log(z) = inf, d = d2(sign(1-alpha) * inf) * inf
             final double di = computeD(alpha, Double.POSITIVE_INFINITY);
             if (alpha < 1) {
                 // d2(inf) * inf = inf
-                Assert.assertEquals(Double.POSITIVE_INFINITY, di, 0.0);
+                Assertions.assertEquals(Double.POSITIVE_INFINITY, di);
             } else if (alpha == 1) {
                 // d2(0 * inf) -> NaN
-                Assert.assertEquals(Double.NaN, di, 0.0);
+                Assertions.assertEquals(Double.NaN, di);
             } else {
                 // alpha > 1
                 // d2(-inf) * inf = 0 * inf = NaN
-                Assert.assertEquals(Double.NaN, di, 0.0);
+                Assertions.assertEquals(Double.NaN, di);
             }
         }
     }
@@ -517,7 +518,7 @@ public class StableSamplerTest {
                 double beta = Math.tan(-alpha * phi) / Math.tan(alpha * PI_2);
                 double zeta = -beta * Math.tan(alpha * PI_2);
                 double atanZeta = Math.atan(-zeta);
-                Assert.assertEquals(0.0, alpha * phi + atanZeta, 0.0);
+                Assertions.assertEquals(0.0, alpha * phi + atanZeta);
             }
         }
     }
@@ -532,9 +533,9 @@ public class StableSamplerTest {
         // This is the extreme of cos(x) that should be used
         final double cosPi2 = Math.cos(PI_2);
         // The function is symmetric
-        Assert.assertEquals(cosPi2, Math.cos(-PI_2), 0.0);
+        Assertions.assertEquals(cosPi2, Math.cos(-PI_2));
         // As pi is an approximation then the cos value is not exactly 0
-        Assert.assertTrue(cosPi2 > 0);
+        Assertions.assertTrue(cosPi2 > 0);
 
         final UniformRandomProvider rng = RandomSource.XO_SHI_RO_256_SS.create();
 
@@ -625,20 +626,20 @@ public class StableSamplerTest {
         // Test it is in the interval (-pi/2, pi/2)
         double phi = getU(x) * 2;
         double value = eps * phi + alphaPi2;
-        Assert.assertTrue(value <= PI_2);
-        Assert.assertTrue(value >= -PI_2);
+        Assertions.assertTrue(value <= PI_2);
+        Assertions.assertTrue(value >= -PI_2);
         value = eps * phi - alphaPi2;
-        Assert.assertTrue(value <= PI_2);
-        Assert.assertTrue(value >= -PI_2);
+        Assertions.assertTrue(value <= PI_2);
+        Assertions.assertTrue(value >= -PI_2);
 
         // Mirror the deviate
         phi = -phi;
         value = eps * phi + alphaPi2;
-        Assert.assertTrue(value <= PI_2);
-        Assert.assertTrue(value >= -PI_2);
+        Assertions.assertTrue(value <= PI_2);
+        Assertions.assertTrue(value >= -PI_2);
         value = eps * phi - alphaPi2;
-        Assert.assertTrue(value <= PI_2);
-        Assert.assertTrue(value >= -PI_2);
+        Assertions.assertTrue(value <= PI_2);
+        Assertions.assertTrue(value >= -PI_2);
     }
     /**
      * Assumption test:
@@ -651,9 +652,9 @@ public class StableSamplerTest {
         // getU creates in the domain (-pi/4, pi/4) so double the angle.
         for (final double phi : new double[] {getU(-1) * 2, getU(1 << 10) * 2}) {
             final double x = Math.sin(SMALLEST_ALPHA * phi);
-            Assert.assertNotEquals(0.0, x, 0.0);
+            Assertions.assertNotEquals(0.0, x);
             // Value is actually:
-            Assert.assertEquals(1.9361559566769725E-32, Math.abs(x), 0.0);
+            Assertions.assertEquals(1.9361559566769725E-32, Math.abs(x));
         }
     }
 
@@ -666,15 +667,15 @@ public class StableSamplerTest {
     @Test
     public void testExpM1() {
         // Test monotonic at the switch point
-        Assert.assertEquals(d2(0.5), d2b(0.5), 0.0);
+        Assertions.assertEquals(d2(0.5), d2b(0.5));
         // When positive x -> 0 the value smaller bigger.
-        Assert.assertTrue(d2(Math.nextDown(0.5)) <= d2b(0.5));
-        Assert.assertEquals(d2(-0.5), d2b(-0.5), 0.0);
+        Assertions.assertTrue(d2(Math.nextDown(0.5)) <= d2b(0.5));
+        Assertions.assertEquals(d2(-0.5), d2b(-0.5));
         // When negative x -> 0 the value gets bigger.
-        Assert.assertTrue(d2(-Math.nextDown(0.5)) >= d2b(-0.5));
+        Assertions.assertTrue(d2(-Math.nextDown(0.5)) >= d2b(-0.5));
         // Potentially the next power of 2 could be used based on ULP errors but
         // the switch is not monotonic.
-        Assert.assertFalse(d2(Math.nextDown(0.25)) <= d2b(0.25));
+        Assertions.assertFalse(d2(Math.nextDown(0.25)) <= d2b(0.25));
     }
 
     /**
@@ -696,7 +697,7 @@ public class StableSamplerTest {
         // Note:
         // The point at which there *should* be no difference between the two is when
         // exp(x) - 1 == exp(x). This will occur at exp(x)=2^54, x = ln(2^54) = 37.43.
-        Assert.assertEquals(((double) (1L << 54)) - 1, (double) (1L << 54), 0.0);
+        Assertions.assertEquals(((double) (1L << 54)) - 1, (double) (1L << 54));
         // However since expm1 and exp are only within 1 ULP of the exact result differences
         // still occur above this threshold.
         // 2^6 = 64; 2^-4 = 0.0625
@@ -704,8 +705,8 @@ public class StableSamplerTest {
             // The exponent must be unsigned so + 1023 to the signed exponent
             final long exp = (signedExp + 1023L) << 52;
             // Test we are creating the correct numbers
-            Assert.assertEquals(signedExp, Math.getExponent(Double.longBitsToDouble(exp)));
-            Assert.assertEquals(signedExp, Math.getExponent(Double.longBitsToDouble((-1 & mask) | exp)));
+            Assertions.assertEquals(signedExp, Math.getExponent(Double.longBitsToDouble(exp)));
+            Assertions.assertEquals(signedExp, Math.getExponent(Double.longBitsToDouble((-1 & mask) | exp)));
             // Get the average and max ulp
             long sum1 = 0;
             long sum2 = 0;
@@ -806,23 +807,23 @@ public class StableSamplerTest {
     @Test
     public void testD2() {
         for (final double x : new double[] {Double.MAX_VALUE, Math.log(Double.MAX_VALUE), 10, 5, 1, 0.5, 0.1, 0.05, 0.01}) {
-            Assert.assertEquals(Math.expm1(x) / x, SpecialMath.d2(x), 1e-15);
-            Assert.assertEquals(Math.expm1(-x) / -x, SpecialMath.d2(-x), 1e-15);
+            Assertions.assertEquals(Math.expm1(x) / x, SpecialMath.d2(x), 1e-15);
+            Assertions.assertEquals(Math.expm1(-x) / -x, SpecialMath.d2(-x), 1e-15);
         }
 
         // Negative infinity computes without correction
-        Assert.assertEquals(0.0, Math.expm1(Double.NEGATIVE_INFINITY) / Double.NEGATIVE_INFINITY, 0.0);
-        Assert.assertEquals(0.0, SpecialMath.d2(Double.NEGATIVE_INFINITY), 0.0);
+        Assertions.assertEquals(0.0, Math.expm1(Double.NEGATIVE_INFINITY) / Double.NEGATIVE_INFINITY);
+        Assertions.assertEquals(0.0, SpecialMath.d2(Double.NEGATIVE_INFINITY));
 
         // NaN is returned (i.e. no correction)
-        Assert.assertEquals(Double.NaN, SpecialMath.d2(Double.NaN), 0.0);
+        Assertions.assertEquals(Double.NaN, SpecialMath.d2(Double.NaN));
 
         // Edge cases for z=0 or z==inf require correction
-        Assert.assertEquals(Double.NaN, Math.expm1(0) / 0.0, 0.0);
-        Assert.assertEquals(Double.NaN, Math.expm1(Double.POSITIVE_INFINITY) / Double.POSITIVE_INFINITY, 0.0);
+        Assertions.assertEquals(Double.NaN, Math.expm1(0) / 0.0);
+        Assertions.assertEquals(Double.NaN, Math.expm1(Double.POSITIVE_INFINITY) / Double.POSITIVE_INFINITY);
         // Corrected in the special function
-        Assert.assertEquals(1.0, SpecialMath.d2(0.0), 0.0);
-        Assert.assertEquals(Double.POSITIVE_INFINITY, SpecialMath.d2(Double.POSITIVE_INFINITY), 0.0);
+        Assertions.assertEquals(1.0, SpecialMath.d2(0.0));
+        Assertions.assertEquals(Double.POSITIVE_INFINITY, SpecialMath.d2(Double.POSITIVE_INFINITY));
     }
 
     /**
@@ -833,18 +834,18 @@ public class StableSamplerTest {
         // Test the value of tan(x) when the angle is generated in the open interval (-pi/4, pi/4)
         for (final long x : new long[] {Long.MIN_VALUE + (1 << 10), Long.MAX_VALUE}) {
             final double phiby2 = getU(x);
-            Assert.assertEquals(PI_4 - DU * PI_4, Math.abs(phiby2), 0.0);
+            Assertions.assertEquals(PI_4 - DU * PI_4, Math.abs(phiby2));
             final double a = phiby2 * SpecialMath.tan2(phiby2);
             // Check this is not 1
-            Assert.assertNotEquals(1, Math.abs(a), 0.0);
-            Assert.assertTrue(Math.abs(a) < 1.0);
+            Assertions.assertNotEquals(1, Math.abs(a));
+            Assertions.assertTrue(Math.abs(a) < 1.0);
         }
 
         // At pi/4 the function reverts to Math.tan(x) / x. Test through the transition.
         final double pi = Math.PI;
         for (final double x : new double[] {pi, pi / 2, pi / 3.99, pi / 4, pi / 4.01, pi / 8, pi / 16}) {
             final double y = Math.tan(x) / x;
-            Assert.assertEquals(y, SpecialMath.tan2(x), Math.ulp(y));
+            Assertions.assertEquals(y, SpecialMath.tan2(x), Math.ulp(y));
         }
 
         // Test this closely matches the JDK tan function.
@@ -872,7 +873,7 @@ public class StableSamplerTest {
                 ulp += u;
                 // Within 4 ulp. Note tan(x) is within 1 ulp of the result. So this
                 // is max 5 ulp from the result.
-                Assert.assertEquals(tanx, y, 4 * Math.ulp(tanx));
+                Assertions.assertEquals(tanx, y, 4 * Math.ulp(tanx));
             }
             // Test tan(x) / x
             y = tanx / x;
@@ -883,7 +884,7 @@ public class StableSamplerTest {
                 }
                 ulp2 += u;
                 // Within 3 ulp.
-                Assert.assertEquals(y, tan2x, 3 * Math.ulp(y));
+                Assertions.assertEquals(y, tan2x, 3 * Math.ulp(y));
             }
         }
         // Mean (max) ULP is very low
@@ -891,17 +892,17 @@ public class StableSamplerTest {
         //          tan(x)                    tan(x) / x
         // tan4283  93436.25534446817         201185 : 68313.16171793547         128079
         // tan4288c     0.5905972588807344         4 :     0.4047176940366626         3
-        Assert.assertTrue("Mean ULP to tan(x) is too high", (double) ulp / count < 0.6);
-        Assert.assertTrue("Mean ULP to tan(x) / x is too high", (double) ulp2 / count < 0.45);
+        Assertions.assertTrue((double) ulp / count < 0.6, "Mean ULP to tan(x) is too high");
+        Assertions.assertTrue((double) ulp2 / count < 0.45, "Mean ULP to tan(x) / x is too high");
         // If the value is under 1 then the sampler will break due to cancellation errors.
-        Assert.assertEquals("Must be exact tan(x) / x at x=0", 1.0, SpecialMath.tan2(0.0), 0.0);
-        Assert.assertEquals(4 / Math.PI, SpecialMath.tan2(PI_4), Math.ulp(4 / Math.PI));
-        Assert.assertEquals(1.0, PI_4 * SpecialMath.tan2(PI_4), Math.ulp(1.0));
+        Assertions.assertEquals(1.0, SpecialMath.tan2(0.0), "Must be exact tan(x) / x at x=0");
+        Assertions.assertEquals(4 / Math.PI, SpecialMath.tan2(PI_4), Math.ulp(4 / Math.PI));
+        Assertions.assertEquals(1.0, PI_4 * SpecialMath.tan2(PI_4), Math.ulp(1.0));
         // If this is above 1 then the sampler will break. Test at the switch point pi/4.
-        Assert.assertTrue(1.0 >= PI_4 * SpecialMath.tan2(PI_4));
-        Assert.assertTrue(1.0 >= PI_4 * SpecialMath.tan2(Math.nextDown(PI_4)));
+        Assertions.assertTrue(1.0 >= PI_4 * SpecialMath.tan2(PI_4));
+        Assertions.assertTrue(1.0 >= PI_4 * SpecialMath.tan2(Math.nextDown(PI_4)));
         // Monotonic function at the transition
-        Assert.assertTrue(SpecialMath.tan2(Math.nextUp(PI_4)) >= SpecialMath.tan2(PI_4));
+        Assertions.assertTrue(SpecialMath.tan2(Math.nextUp(PI_4)) >= SpecialMath.tan2(PI_4));
     }
 
     /**
@@ -925,10 +926,10 @@ public class StableSamplerTest {
                     for (final double u : us) {
                         final double x = sampleCMS(alpha, beta, w, u);
                         final double y = sampleWeronAlphaNot1(alpha, beta, w, u);
-                        Assert.assertEquals(x, y, Math.max(absolute, Math.abs(x) * relative));
+                        Assertions.assertEquals(x, y, Math.max(absolute, Math.abs(x) * relative));
                         // Test symmetry
                         final double z = sampleCMS(alpha, -beta, w, 1 - u);
-                        Assert.assertEquals(x, -z, 0);
+                        Assertions.assertEquals(x, -z, 0.0);
                     }
                 }
             }
@@ -955,10 +956,10 @@ public class StableSamplerTest {
                 for (final double u : us) {
                     final double x = sampleCMS(alpha, beta, w, u);
                     final double y = sampleWeronAlpha1(beta, w, u);
-                    Assert.assertEquals(x, y, Math.max(absolute, Math.abs(x) * relative));
+                    Assertions.assertEquals(x, y, Math.max(absolute, Math.abs(x) * relative));
                     // Test symmetry
                     final double z = sampleCMS(alpha, -beta, w, 1 - u);
-                    Assert.assertEquals(x, -z, 0);
+                    Assertions.assertEquals(x, -z, 0.0);
                 }
             }
         }
@@ -991,7 +992,7 @@ public class StableSamplerTest {
                     for (final double u : us) {
                         // CMS formulas
                         double x0 = sampleCMS(1, beta, w, u);
-                        Assert.assertTrue("Target must be finite", Double.isFinite(x0));
+                        Assertions.assertTrue(Double.isFinite(x0), "Target must be finite");
 
                         // Sample should approach x0 as alpha approaches 1
                         double delta = deltaStart;
@@ -1007,7 +1008,7 @@ public class StableSamplerTest {
 
                         // Weron formulas
                         x0 = sampleWeronAlpha1(beta, w, u);
-                        Assert.assertTrue("Target must be finite", Double.isFinite(x0));
+                        Assertions.assertTrue(Double.isFinite(x0), "Target must be finite");
 
                         // Sample should approach x0 as alpha approaches 1
                         delta = deltaStart;
@@ -1025,10 +1026,10 @@ public class StableSamplerTest {
             }
 
             // The CMS formala monotonically converges
-            Assert.assertEquals(0, cmsCount);
+            Assertions.assertEquals(0, cmsCount);
             // The weron formula does not monotonically converge
             // (difference to the target can be bigger when alpha moves closer to 1).
-            Assert.assertTrue(weronCount > 200);
+            Assertions.assertTrue(weronCount > 200);
         }
     }
 
@@ -1041,22 +1042,22 @@ public class StableSamplerTest {
     @Test
     public void testExtremeInputsToSample() {
         // Demonstrate instability when w = 0
-        Assert.assertEquals(Double.NaN, sampleCMS(1.3, 0.7, 0, 0.25), 0.0);
-        Assert.assertTrue(Double.isFinite(sampleCMS(1.3, 0.7, SMALL_W, 0.25)));
+        Assertions.assertEquals(Double.NaN, sampleCMS(1.3, 0.7, 0, 0.25));
+        Assertions.assertTrue(Double.isFinite(sampleCMS(1.3, 0.7, SMALL_W, 0.25)));
 
         // Demonstrate instability when u -> 0 or 1, and |beta| = 1
-        Assert.assertEquals(Double.NaN, sampleCMS(1.1, 1.0, 0.1, 0), 0.0);
-        Assert.assertTrue(Double.isFinite(sampleCMS(1.1, 1.0, 0.1, DU)));
+        Assertions.assertEquals(Double.NaN, sampleCMS(1.1, 1.0, 0.1, 0));
+        Assertions.assertTrue(Double.isFinite(sampleCMS(1.1, 1.0, 0.1, DU)));
 
         // Demonstrate instability when alpha -> 0
 
         // Small alpha does not tolerate very small w.
-        Assert.assertEquals(Double.NaN, sampleCMS(0.01, 0.7, SMALL_W, 0.5), 0.0);
+        Assertions.assertEquals(Double.NaN, sampleCMS(0.01, 0.7, SMALL_W, 0.5));
 
         // Very small alpha does not tolerate u approaching 0 or 1 (depending on the
         // skew)
-        Assert.assertEquals(Double.NaN, sampleCMS(1e-5, 0.7, 1.0, 1e-4), 0.0);
-        Assert.assertEquals(Double.NaN, sampleCMS(1e-5, -0.7, 1.0, 1 - 1e-4), 0.0);
+        Assertions.assertEquals(Double.NaN, sampleCMS(1e-5, 0.7, 1.0, 1e-4));
+        Assertions.assertEquals(Double.NaN, sampleCMS(1e-5, -0.7, 1.0, 1 - 1e-4));
 
         final double[] alphas = {Math.nextDown(2), 1.3, 1.1, Math.nextUp(1), 1, Math.nextDown(1), 0.7, 0.1, 0.05, 0.01, 0x1.0p-16};
         final double[] betas = {1, 0.9, 0.001, 0};
@@ -1091,17 +1092,18 @@ public class StableSamplerTest {
                             nan1++;
                         }
                         // The edge-case corrected Weron formula should not fail
-                        Assert.assertNotEquals(Double.NaN, x2);
+                        Assertions.assertNotEquals(Double.NaN, x2);
 
-                        // Check symmetry of each formula
-                        Assert.assertEquals(x1, -sampleCMS(alpha, -beta, w, 1 - u), 0.0);
-                        Assert.assertEquals(x2, -sampleWeron(alpha, -beta, w, 1 - u), 0.0);
+                        // Check symmetry of each formula.
+                        // Use a delta of zero to allow equality of 0.0 and -0.0.
+                        Assertions.assertEquals(x1, 0.0 - sampleCMS(alpha, -beta, w, 1 - u), 0.0);
+                        Assertions.assertEquals(x2, 0.0 - sampleWeron(alpha, -beta, w, 1 - u), 0.0);
 
                         if (Double.isInfinite(x1) && x1 != x2) {
                             // Check the Weron correction for extreme samples.
                             // The result should be at the correct *finite* support bounds.
                             // Note: This applies when alpha < 1 and beta = +/-1.
-                            Assert.assertTrue(lower <= x2 && x2 <= upper);
+                            Assertions.assertTrue(lower <= x2 && x2 <= upper);
                         }
                     }
                 }
@@ -1109,7 +1111,7 @@ public class StableSamplerTest {
         }
 
         // The CMS algorithm is expected to fail some cases
-        Assert.assertNotEquals(0, nan1);
+        Assertions.assertNotEquals(0, nan1);
     }
 
     /**
@@ -1355,7 +1357,7 @@ public class StableSamplerTest {
         // See testZIsNotAlwaysAboveZero()
         final double alpha = 1.291015625;
         final double beta = -1;
-        Assert.assertTrue(0.0 > computeNumerator(alpha, beta, Long.MAX_VALUE));
+        Assertions.assertTrue(0.0 > computeNumerator(alpha, beta, Long.MAX_VALUE));
 
         // z will be negative. Repeat computation assumed to be performed by the sampler.
         // This ensures the test should be updated if the sampler implementation changes.
@@ -1371,11 +1373,11 @@ public class StableSamplerTest {
         final double b2 = 1 - db;
         final double b2p = 1 + db;
         final double z = a2p * (b2 + 2 * phiby2 * bb * tau) / (w * a2 * b2p);
-        Assert.assertTrue(0.0 > z);
+        Assertions.assertTrue(0.0 > z);
 
         final StableSampler sampler = StableSampler.of(createRngWithSequence(longs), alpha, beta);
         // It should not be NaN or infinite
-        Assert.assertTrue("Sampler did not recover", Double.isFinite(sampler.sample()));
+        Assertions.assertTrue(Double.isFinite(sampler.sample()), "Sampler did not recover");
     }
 
     /**
@@ -1401,17 +1403,17 @@ public class StableSamplerTest {
                 final StableSampler sampler = StableSampler.of(createRngWithSequence(longs), alpha, beta);
                 final double x = sampler.sample();
                 // It should not be NaN
-                Assert.assertFalse("Sampler did not recover", Double.isNaN(x));
+                Assertions.assertFalse(Double.isNaN(x), "Sampler did not recover");
                 if (beta != 0) {
                     // The sample is extreme so should be at a limit of the support
                     if (alpha < 0) {
                         // Effectively +/- infinity
-                        Assert.assertEquals(Math.copySign(Double.POSITIVE_INFINITY, beta), x, 0.0);
+                        Assertions.assertEquals(Math.copySign(Double.POSITIVE_INFINITY, beta), x);
                     } else if (alpha > 1) {
                         // At the distribution mean
                         final double[] support = getSupport(alpha, beta);
                         final double mu = support[2];
-                        Assert.assertEquals(mu, x, 0.0);
+                        Assertions.assertEquals(mu, x);
                     }
                 }
             }
@@ -1475,17 +1477,17 @@ public class StableSamplerTest {
         final double x3 = sampler.sample();
         // Expect the limit of the support (the direction is controlled by extreme phi)
         final double max = Double.POSITIVE_INFINITY;
-        Assert.assertEquals(-max, x1, 0.0);
-        Assert.assertEquals(max, x2, 0.0);
+        Assertions.assertEquals(-max, x1);
+        Assertions.assertEquals(max, x2);
         // Expect the sampler to avoid inf * 0
-        Assert.assertNotEquals(Double.NaN, x3, 0.0);
+        Assertions.assertNotEquals(Double.NaN, x3);
         // When f=0 the sample should be in the middle (beta=0) or skewed in the direction of beta
         if (beta == 0) {
             // In the middle
-            Assert.assertEquals(0.0, x3, 0.0);
+            Assertions.assertEquals(0.0, x3);
         } else {
             // At the support limit
-            Assert.assertEquals(Math.copySign(max, beta), x3, 0.0);
+            Assertions.assertEquals(Math.copySign(max, beta), x3);
         }
     }
 
@@ -1510,7 +1512,7 @@ public class StableSamplerTest {
         }, longs1);
         final StableSampler sampler1 = StableSampler.of(createRngWithSequence(longs1), 1.0, 1.0);
         final double x1 = sampler1.sample();
-        Assert.assertTrue("Sampler did not recover", Double.isFinite(x1));
+        Assertions.assertTrue(Double.isFinite(x1), "Sampler did not recover");
 
         // u -> pi/4
         final long[] longs2 = {Long.MAX_VALUE, 1446480648965178882L};
@@ -1519,10 +1521,10 @@ public class StableSamplerTest {
         }, longs2);
         final StableSampler sampler2 = StableSampler.of(createRngWithSequence(longs2), 1.0, -1.0);
         final double x2 = sampler2.sample();
-        Assert.assertTrue("Sampler did not recover", Double.isFinite(x2));
+        Assertions.assertTrue(Double.isFinite(x2), "Sampler did not recover");
 
         // Sample should be a reflection
-        Assert.assertEquals(x1, -x2, 0.0);
+        Assertions.assertEquals(x1, -x2);
     }
 
     /**
@@ -1657,7 +1659,7 @@ public class StableSamplerTest {
         for (int i = 0; i < 100; i++) {
             final double x = sampler.sample();
             if (!(lower <= x && x <= upper)) {
-                Assert.fail(String.format("Invalid sample. alpha=%s, beta=%s, gamma=%s, delta=%s [%s, %s] x=%s",
+                Assertions.fail(String.format("Invalid sample. alpha=%s, beta=%s, gamma=%s, delta=%s [%s, %s] x=%s",
                     alpha, beta, gamma, delta, lower, upper, x));
             }
         }
@@ -1722,27 +1724,27 @@ public class StableSamplerTest {
         // Extremes of the uniform deviate generated using the same method as the sampler
         final double d = DU * PI_4;
         // Test in (-pi/4, pi/4)
-        Assert.assertNotEquals(-PI_4, getU(createRngWithSequence(Long.MIN_VALUE)), 0.0);
-        Assert.assertEquals(-PI_4 + d, getU(createRngWithSequence(Long.MIN_VALUE + (1 << 10))), 0.0);
-        Assert.assertEquals(-PI_4 / 2, getU(createRngWithSequence(Long.MIN_VALUE >> 1)), 0.0);
-        Assert.assertEquals(-d, getU(createRngWithSequence(-1)), 0.0);
-        Assert.assertEquals(0.0, getU(createRngWithSequence(0)), 0.0);
-        Assert.assertEquals(d, getU(createRngWithSequence(1 << 10)), 0.0);
-        Assert.assertEquals(PI_4 / 2, getU(createRngWithSequence(Long.MIN_VALUE >>> 1)), 0.0);
-        Assert.assertEquals(PI_4 - d, getU(createRngWithSequence(Long.MAX_VALUE)), 0.0);
+        Assertions.assertNotEquals(-PI_4, getU(createRngWithSequence(Long.MIN_VALUE)));
+        Assertions.assertEquals(-PI_4 + d, getU(createRngWithSequence(Long.MIN_VALUE + (1 << 10))));
+        Assertions.assertEquals(-PI_4 / 2, getU(createRngWithSequence(Long.MIN_VALUE >> 1)));
+        Assertions.assertEquals(-d, getU(createRngWithSequence(-1)));
+        Assertions.assertEquals(0.0, getU(createRngWithSequence(0)));
+        Assertions.assertEquals(d, getU(createRngWithSequence(1 << 10)));
+        Assertions.assertEquals(PI_4 / 2, getU(createRngWithSequence(Long.MIN_VALUE >>> 1)));
+        Assertions.assertEquals(PI_4 - d, getU(createRngWithSequence(Long.MAX_VALUE)));
 
         // Extremes of the exponential sampler
-        Assert.assertEquals(0, ZigguratSampler.Exponential.of(
+        Assertions.assertEquals(0, ZigguratSampler.Exponential.of(
                 createRngWithSequence(0L)).sample(), 0.0);
-        Assert.assertEquals(SMALL_W, ZigguratSampler.Exponential.of(
+        Assertions.assertEquals(SMALL_W, ZigguratSampler.Exponential.of(
                 createRngWithSequence(1)).sample(), 0.0);
-        Assert.assertEquals(1.0, ZigguratSampler.Exponential.of(
+        Assertions.assertEquals(1.0, ZigguratSampler.Exponential.of(
                 createRngWithSequence(1446480648965178882L)).sample(), 0.0);
-        Assert.assertEquals(5.0, ZigguratSampler.Exponential.of(
+        Assertions.assertEquals(5.0, ZigguratSampler.Exponential.of(
                 createRngWithSequence(6092639261715210240L)).sample(), 0.0);
-        Assert.assertEquals(TAIL_W, ZigguratSampler.Exponential.of(
+        Assertions.assertEquals(TAIL_W, ZigguratSampler.Exponential.of(
                 createRngWithSequence(-1, -1, 0)).sample(), 0.0);
-        Assert.assertEquals(3 * TAIL_W, ZigguratSampler.Exponential.of(
+        Assertions.assertEquals(3 * TAIL_W, ZigguratSampler.Exponential.of(
                 createRngWithSequence(-1, -1, -1, -1, -1, -1, 0)).sample(), 1e-14);
     }
 
@@ -1893,10 +1895,10 @@ public class StableSamplerTest {
         // Validate series
         final SharedStateContinuousSampler exp = ZigguratSampler.Exponential.of(rng);
         for (int i = 0; i < expected.length; i += 2) {
-            int j = i / 2;
-            Assert.assertEquals(j + ": Incorrect u", expected[i], getU(rng), 0.0);
+            final int j = i / 2;
+            Assertions.assertEquals(expected[i], getU(rng), () -> j + ": Incorrect u");
             if (i + 1 < expected.length) {
-                Assert.assertEquals(j + ": Incorrect w", expected[i + 1], exp.sample(), 0.0);
+                Assertions.assertEquals(expected[i + 1], exp.sample(), () -> j + ": Incorrect w");
             }
         }
     }
@@ -1962,7 +1964,7 @@ public class StableSamplerTest {
         final StableSampler sampler1 = StableSampler.of(rng1, alpha1, beta1);
         final StableSampler sampler2 = StableSampler.of(rng2, alpha2, beta2);
         final StableSampler sampler3 = StableSampler.of(rng3, alpha3, beta3);
-        final String msg = String.format("alpha=%s, beta=%s", alpha2, beta2);
+        final Supplier<String> msg = () -> String.format("alpha=%s, beta=%s", alpha2, beta2);
         for (int i = 0; i < 1000; i++) {
             final double x1 = sampler1.sample();
             final double x2 = sampler2.sample();
@@ -1971,16 +1973,16 @@ public class StableSamplerTest {
             if (x3 > x1) {
                 if (x2 > x3) {
                     // Should be the same
-                    Assert.assertEquals(msg, x3, x2, ulp * Math.ulp(x3));
+                    Assertions.assertEquals(x3, x2, ulp * Math.ulp(x3), msg);
                 } else if (x2 < x1) {
-                    Assert.assertEquals(msg, x1, x2, ulp * Math.ulp(x1));
+                    Assertions.assertEquals(x1, x2, ulp * Math.ulp(x1), msg);
                 }
             } else if (x3 < x1) {
                 if (x2 < x3) {
                     // Should be the same
-                    Assert.assertEquals(msg, x3, x2, ulp * Math.ulp(x3));
+                    Assertions.assertEquals(x3, x2, ulp * Math.ulp(x3), msg);
                 } else if (x2 > x1) {
-                    Assert.assertEquals(msg, x1, x2, ulp * Math.ulp(x1));
+                    Assertions.assertEquals(x1, x2, ulp * Math.ulp(x1), msg);
                 }
             }
         }
@@ -2095,7 +2097,7 @@ public class StableSamplerTest {
             for (int i = 0; i < 10; i++) {
                 final double x1 = sampler1.sample();
                 final double x2 = sampler2.sample();
-                Assert.assertEquals(x1, x2, ulp * Math.ulp(x1));
+                Assertions.assertEquals(x1, x2, ulp * Math.ulp(x1));
             }
         }
     }
@@ -2193,7 +2195,7 @@ public class StableSamplerTest {
                         // Since mirroring applies before the shift of delta this must be negated too
                         final StableSampler s2 = StableSampler.of(reverse, alpha, -beta, gamma, -delta);
                         for (int i = 0; i < 100; i++) {
-                            Assert.assertEquals(s1.sample(), -s2.sample(), 0.0);
+                            Assertions.assertEquals(s1.sample(), -s2.sample());
                         }
                     }
                 }
@@ -2217,7 +2219,7 @@ public class StableSamplerTest {
                 // Since mirroring applies before the shift of delta this must be negated too
                 final StableSampler s2 = StableSampler.of(rng2, alpha, -beta, gamma, -delta);
                 for (int i = 0; i < 100; i++) {
-                    Assert.assertEquals(s1.sample(), -s2.sample(), 0.0);
+                    Assertions.assertEquals(s1.sample(), -s2.sample());
                 }
             }
         }
@@ -2247,7 +2249,7 @@ public class StableSamplerTest {
                 sampler = StableSampler.of(rng, p[0], p[1], p[2], p[3]);
             }
             final String s = sampler.toString().toLowerCase();
-            Assert.assertTrue(s.contains("stable"));
+            Assertions.assertTrue(s.contains("stable"));
         }
     }
 
@@ -2272,16 +2274,16 @@ public class StableSamplerTest {
         final double hi = getU(Long.MAX_VALUE & unsetHighBit);
         final double lo = getU(Long.MIN_VALUE | setLowBit);
         // The limits are roughly pi/4 and -pi/4
-        Assert.assertEquals(PI_4, hi, 2e-3);
-        Assert.assertEquals(-PI_4, lo, 2e-3);
-        Assert.assertEquals(0.0, lo + hi, 1e-3);
+        Assertions.assertEquals(PI_4, hi, 2e-3);
+        Assertions.assertEquals(-PI_4, lo, 2e-3);
+        Assertions.assertEquals(0.0, lo + hi, 1e-3);
 
         // Setting a bit ensure the exponential sampler cannot be zero
         final UniformRandomProvider rng = createRngWithSequence(setLowBit);
         final double w = ZigguratSampler.Exponential.of(rng).sample();
-        Assert.assertNotEquals(0.0, w, 0.0);
+        Assertions.assertNotEquals(0.0, w);
         // This is the actual value; it is small but not extreme.
-        Assert.assertEquals(0.007391869818503967, w, 0.0);
+        Assertions.assertEquals(0.007391869818503967, w);
 
         final RandomSource source = RandomSource.XO_RO_SHI_RO_128_SS;
         final long seed = 0x83762b3daf1c43L;
@@ -2311,7 +2313,7 @@ public class StableSamplerTest {
 
         for (final double alpha : alphas) {
             for (final double beta : betas) {
-                final String msg = String.format("alpha=%s, beta=%s", alpha, beta);
+                final Supplier<String> msg = () -> String.format("alpha=%s, beta=%s", alpha, beta);
                 // WARNING:
                 // Created by direct access to package-private constructor.
                 // This is for testing only as these do not validate the parameters.
@@ -2327,7 +2329,7 @@ public class StableSamplerTest {
                 for (int i = 0; i < 1000; i++) {
                     final double x = s1.sample();
                     final double y = s2.sample();
-                    Assert.assertEquals(msg, x, y, Math.max(absolute, Math.abs(x) * relative));
+                    Assertions.assertEquals(x, y, Math.max(absolute, Math.abs(x) * relative), msg);
                 }
             }
         }
@@ -2418,14 +2420,14 @@ public class StableSamplerTest {
         }, longs);
 
         final double zeta = -beta * Math.tan(alpha * PI_2);
-        Assert.assertEquals(0.0, alpha * PI_4 + Math.atan(-zeta), 0.0);
+        Assertions.assertEquals(0.0, alpha * PI_4 + Math.atan(-zeta));
 
         final UniformRandomProvider rng = createRngWithSequence(longs);
         final StableSampler sampler = new WeronStableSampler(rng, alpha, beta);
         // zeta is the offset used to shift the 1-parameterization to the
         // 0-parameterization. This is returned when other terms multiply to zero.
-        Assert.assertEquals(zeta, sampler.sample(), 0.0);
-        Assert.assertEquals(zeta, sampler.sample(), 0.0);
-        Assert.assertEquals(zeta, sampler.sample(), 0.0);
+        Assertions.assertEquals(zeta, sampler.sample());
+        Assertions.assertEquals(zeta, sampler.sample());
+        Assertions.assertEquals(zeta, sampler.sample());
     }
 }
diff --git a/commons-rng-sampling/src/test/java/org/apache/commons/rng/sampling/distribution/UniformLongSamplerTest.java b/commons-rng-sampling/src/test/java/org/apache/commons/rng/sampling/distribution/UniformLongSamplerTest.java
index 00f6ddd..f55aeb6 100644
--- a/commons-rng-sampling/src/test/java/org/apache/commons/rng/sampling/distribution/UniformLongSamplerTest.java
+++ b/commons-rng-sampling/src/test/java/org/apache/commons/rng/sampling/distribution/UniformLongSamplerTest.java
@@ -21,7 +21,7 @@ import org.apache.commons.rng.core.source64.LongProvider;
 import org.apache.commons.rng.core.source64.SplitMix64;
 import org.apache.commons.rng.sampling.RandomAssert;
 import org.apache.commons.rng.simple.RandomSource;
-import org.junit.Assert;
+import org.junit.jupiter.api.Assertions;
 import org.junit.Test;
 
 import java.util.Locale;
@@ -57,7 +57,7 @@ public class UniformLongSamplerTest {
         final UniformRandomProvider rng = RandomSource.SPLIT_MIX_64.create();
         final UniformLongSampler sampler = UniformLongSampler.of(rng, lower, upper);
         for (int i = 0; i < 5; i++) {
-            Assert.assertEquals(lower, sampler.sample());
+            Assertions.assertEquals(lower, sampler.sample());
         }
     }
 
@@ -73,7 +73,7 @@ public class UniformLongSamplerTest {
         final UniformRandomProvider rng2 = RandomSource.SPLIT_MIX_64.create(0L);
         final UniformLongSampler sampler = UniformLongSampler.of(rng2, lower, upper);
         for (int i = 0; i < 10; i++) {
-            Assert.assertEquals(rng1.nextLong(), sampler.sample());
+            Assertions.assertEquals(rng1.nextLong(), sampler.sample());
         }
     }
 
@@ -93,7 +93,7 @@ public class UniformLongSamplerTest {
             final UniformRandomProvider rng2 = createRngWithFullBitsOnFirstCall();
             final UniformLongSampler sampler = UniformLongSampler.of(rng2, lower, upper);
             for (int i = 0; i < 10; i++) {
-                Assert.assertEquals(lower + rng1.nextLong(n), sampler.sample());
+                Assertions.assertEquals(lower + rng1.nextLong(n), sampler.sample());
             }
         }
     }
@@ -143,9 +143,9 @@ public class UniformLongSamplerTest {
             final long range = 1L << i;
             final long upper = lower + range - 1;
             sampler = UniformLongSampler.of(rngZeroBits, lower, upper);
-            Assert.assertEquals("Zero bits sample", lower, sampler.sample());
+            Assertions.assertEquals(lower, sampler.sample(), "Zero bits sample");
             sampler = UniformLongSampler.of(rngAllBits, lower, upper);
-            Assert.assertEquals("All bits sample", upper, sampler.sample());
+            Assertions.assertEquals(upper, sampler.sample(), "All bits sample");
         }
     }
 
@@ -166,7 +166,7 @@ public class UniformLongSamplerTest {
             final UniformRandomProvider rng2 = RandomSource.SPLIT_MIX_64.create(0L);
             sampler = UniformLongSampler.of(rng2, lower, upper);
             for (int j = 0; j < 10; j++) {
-                Assert.assertEquals(rng1.nextLong() >>> shift, sampler.sample());
+                Assertions.assertEquals(rng1.nextLong() >>> shift, sampler.sample());
             }
         }
     }
@@ -189,7 +189,7 @@ public class UniformLongSamplerTest {
             do {
                 expected = rng1.nextLong();
             } while (expected < lower || expected > upper);
-            Assert.assertEquals(expected, sampler.sample());
+            Assertions.assertEquals(expected, sampler.sample());
         }
     }
 
@@ -225,8 +225,8 @@ public class UniformLongSamplerTest {
             final long sample1 = sampler.sample();
             final long sample2 = samplerLo.sample();
             final long sample3 = samplerHi.sample();
-            Assert.assertEquals("Incorrect negative offset sample", sample1 + offsetLo, sample2);
-            Assert.assertEquals("Incorrect positive offset sample", sample1 + offsetHi, sample3);
+            Assertions.assertEquals(sample1 + offsetLo, sample2, "Incorrect negative offset sample");
+            Assertions.assertEquals(sample1 + offsetHi, sample3, "Incorrect positive offset sample");
         }
     }
 
@@ -264,7 +264,7 @@ public class UniformLongSamplerTest {
 
         // This should be even across the entire range
         for (int value : histogram) {
-            Assert.assertEquals(expected, value);
+            Assertions.assertEquals(expected, value);
         }
     }
 
@@ -336,6 +336,6 @@ public class UniformLongSamplerTest {
     private static void assertToString(long lower, long upper) {
         final UniformRandomProvider rng = RandomSource.SPLIT_MIX_64.create(0L);
         final UniformLongSampler sampler = UniformLongSampler.of(rng, lower, upper);
-        Assert.assertTrue(sampler.toString().toLowerCase(Locale.US).contains("uniform"));
+        Assertions.assertTrue(sampler.toString().toLowerCase(Locale.US).contains("uniform"));
     }
 }
diff --git a/commons-rng-sampling/src/test/java/org/apache/commons/rng/sampling/distribution/ZigguratSamplerTest.java b/commons-rng-sampling/src/test/java/org/apache/commons/rng/sampling/distribution/ZigguratSamplerTest.java
index 4ac616e..2ad0a24 100644
--- a/commons-rng-sampling/src/test/java/org/apache/commons/rng/sampling/distribution/ZigguratSamplerTest.java
+++ b/commons-rng-sampling/src/test/java/org/apache/commons/rng/sampling/distribution/ZigguratSamplerTest.java
@@ -16,7 +16,7 @@
  */
 package org.apache.commons.rng.sampling.distribution;
 
-import org.junit.Assert;
+import org.junit.jupiter.api.Assertions;
 import org.junit.Test;
 import java.util.Arrays;
 import org.apache.commons.math3.distribution.AbstractRealDistribution;
@@ -97,8 +97,8 @@ public class ZigguratSamplerTest {
         // and leave it to a seeded RNG to select different layers.
 
         // A value of zero will create a sample of zero (42 is the seed)
-        Assert.assertEquals(0.0, expSample(42, 0), 0.0);
-        Assert.assertEquals(tailValue, expSample(42, -1, -1, 0), 0.0);
+        Assertions.assertEquals(0.0, expSample(42, 0));
+        Assertions.assertEquals(tailValue, expSample(42, -1, -1, 0));
 
         // Use different seeds to test different layers from the edge of the ziggurat.
         for (final long seed : new long[] {42, -2136612838, 2340923842L, -1263746817818681L}) {
@@ -109,11 +109,11 @@ public class ZigguratSamplerTest {
             // Recursion
             // Note the order of additions is important as the final sample is added to the
             // tail value multiple times.
-            Assert.assertEquals(x0 + tailValue, expSample(seed, -1, -1), 0.0);
-            Assert.assertEquals(x1 + tailValue, expSample(seed, -1, -1, -1), 0.0);
+            Assertions.assertEquals(x0 + tailValue, expSample(seed, -1, -1));
+            Assertions.assertEquals(x1 + tailValue, expSample(seed, -1, -1, -1));
             // Double recursion
-            Assert.assertEquals(x0 + tailValue + tailValue, expSample(seed, -1, -1, -1, -1), 0.0);
-            Assert.assertEquals(x1 + tailValue + tailValue, expSample(seed, -1, -1, -1, -1, -1), 0.0);
+            Assertions.assertEquals(x0 + tailValue + tailValue, expSample(seed, -1, -1, -1, -1));
+            Assertions.assertEquals(x1 + tailValue + tailValue, expSample(seed, -1, -1, -1, -1, -1));
         }
     }
 
@@ -244,9 +244,10 @@ public class ZigguratSamplerTest {
 
         final ChiSquareTest chiSquareTest = new ChiSquareTest();
         // Pass if we cannot reject null hypothesis that the distributions are the same.
-        double chi2 = chiSquareTest.chiSquareTest(expected, observed);
-        Assert.assertFalse(String.format("(%s <= x < %s) Chi-square p-value = %s",
-            lowerBound, values[bins - 1], chi2), chi2 < 0.001);
+        final double chi2 = chiSquareTest.chiSquareTest(expected, observed);
+        Assertions.assertFalse(chi2 < 0.001,
+            () -> String.format("(%s <= x < %s) Chi-square p-value = %s",
+                                lowerBound, values[bins - 1], chi2));
 
         // Test bins sampled from the edge of the ziggurat. This is always around zero.
         for (final double range : new double[] {0.5, 0.25, 0.1, 0.05}) {
@@ -254,10 +255,10 @@ public class ZigguratSamplerTest {
             final int max = findIndex(values, range);
             final long[] observed2 = Arrays.copyOfRange(observed, min, max + 1);
             final double[] expected2 = Arrays.copyOfRange(expected, min, max + 1);
-            chi2 = chiSquareTest.chiSquareTest(expected2, observed2);
-            Assert.assertFalse(String.format("(%s <= x < %s) Chi-square p-value = %s",
-                min == 0 ? lowerBound : values[min - 1], values[max], chi2),
-                chi2 < significanceLevel);
+            final double chi2b = chiSquareTest.chiSquareTest(expected2, observed2);
+            Assertions.assertFalse(chi2b < significanceLevel,
+                () -> String.format("(%s <= x < %s) Chi-square p-value = %s",
+                                    min == 0 ? lowerBound : values[min - 1], values[max], chi2b));
         }
     }
 
@@ -293,9 +294,9 @@ public class ZigguratSamplerTest {
             }
         }
         // Verify the index is correct
-        Assert.assertTrue(x < data[low]);
+        Assertions.assertTrue(x < data[low]);
         if (low != 0) {
-            Assert.assertTrue(x >= data[low - 1]);
+            Assertions.assertTrue(x >= data[low - 1]);
         }
         return low;
     }
diff --git a/commons-rng-sampling/src/test/java/org/apache/commons/rng/sampling/shape/BoxSamplerTest.java b/commons-rng-sampling/src/test/java/org/apache/commons/rng/sampling/shape/BoxSamplerTest.java
index c841d55..89fa197 100644
--- a/commons-rng-sampling/src/test/java/org/apache/commons/rng/sampling/shape/BoxSamplerTest.java
+++ b/commons-rng-sampling/src/test/java/org/apache/commons/rng/sampling/shape/BoxSamplerTest.java
@@ -18,7 +18,7 @@ package org.apache.commons.rng.sampling.shape;
 
 import java.util.Arrays;
 
-import org.junit.Assert;
+import org.junit.jupiter.api.Assertions;
 import org.junit.Test;
 
 import org.apache.commons.math3.stat.inference.ChiSquareTest;
@@ -55,7 +55,7 @@ public class BoxSamplerTest {
         }) {
             try {
                 BoxSampler.of(rng, c[0], c[1]);
-                Assert.fail(String.format("Did not detect dimension mismatch: %d,%d",
+                Assertions.fail(String.format("Did not detect dimension mismatch: %d,%d",
                     c[0].length, c[1].length));
             } catch (IllegalArgumentException ex) {
                 // Expected
@@ -73,7 +73,7 @@ public class BoxSamplerTest {
         final double[][] c = new double[][] {
             {0, 1, 2}, {-1, 2, 3}
         };
-        Assert.assertNotNull(BoxSampler.of(rng, c[0],  c[1]));
+        Assertions.assertNotNull(BoxSampler.of(rng, c[0],  c[1]));
         final double[] bad = {Double.POSITIVE_INFINITY, Double.NEGATIVE_INFINITY, Double.NaN};
         for (int i = 0; i < c.length; i++) {
             for (int j = 0; j < c[0].length; j++) {
@@ -82,7 +82,7 @@ public class BoxSamplerTest {
                     c[i][j] = d;
                     try {
                         BoxSampler.of(rng, c[0], c[1]);
-                        Assert.fail(String.format("Did not detect non-finite coordinate: %d,%d = %s", i, j, d));
+                        Assertions.fail(String.format("Did not detect non-finite coordinate: %d,%d = %s", i, j, d));
                     } catch (IllegalArgumentException ex) {
                         // Expected
                     }
@@ -142,8 +142,8 @@ public class BoxSamplerTest {
             }
         }
         // Show the box is too big to compute vectors between points.
-        Assert.assertEquals("Expect vector b - a to be infinite in the x dimension",
-            Double.POSITIVE_INFINITY, c2[1][0] - c2[0][0], 0.0);
+        Assertions.assertEquals(Double.POSITIVE_INFINITY, c2[1][0] - c2[0][0],
+            "Expect vector b - a to be infinite in the x dimension");
 
         final BoxSampler sampler1 = BoxSampler.of(
             RandomSource.XO_RO_SHI_RO_128_PP.create(seed), c1[0], c1[1]);
@@ -156,7 +156,7 @@ public class BoxSamplerTest {
             for (int i = 0; i < a.length; i++) {
                 a[i] *= scale;
             }
-            Assert.assertArrayEquals(a, b, 0.0);
+            Assertions.assertArrayEquals(a, b);
         }
     }
 
@@ -227,11 +227,11 @@ public class BoxSamplerTest {
             final long[] observed = new long[expected.length];
             for (int i = 0; i < samples; i++) {
                 final double[] x = sampler.sample();
-                Assert.assertEquals(dimension, x.length);
+                Assertions.assertEquals(dimension, x.length);
                 int index = 0;
                 for (int j = 0; j < dimension; j++) {
                     final double c = (x[j] - a[j]) * scale[j];
-                    Assert.assertTrue("Not within the box", c >= 0.0 && c <= 1.0);
+                    Assertions.assertTrue(c >= 0.0 && c <= 1.0, "Not within the box");
                     // Get the bin for this dimension (assumes c != 1.0)
                     final int bin = (int) (c * bins);
                     // Add to the final bin index
@@ -241,7 +241,7 @@ public class BoxSamplerTest {
                 observed[index]++;
             }
             final double p = new ChiSquareTest().chiSquareTest(expected, observed);
-            Assert.assertFalse("p-value too small: " + p, p < 0.001);
+            Assertions.assertFalse(p < 0.001, () -> "p-value too small: " + p);
         }
     }
 
@@ -330,11 +330,11 @@ public class BoxSamplerTest {
         for (int n = 0; n < 3; n++) {
             final double[] s1 = sampler1.sample();
             final double[] s2 = sampler2.sample();
-            Assert.assertEquals(s1.length, s2.length);
-            Assert.assertFalse("First sampler has used the vertices by reference",
-                Arrays.equals(s1, s2));
+            Assertions.assertEquals(s1.length, s2.length);
+            Assertions.assertFalse(Arrays.equals(s1, s2),
+                "First sampler has used the vertices by reference");
             for (int i = 0; i < dimension; i++) {
-                Assert.assertEquals(s1[i] + offset, s2[i], 1e-10);
+                Assertions.assertEquals(s1[i] + offset, s2[i], 1e-10);
             }
         }
     }
diff --git a/commons-rng-sampling/src/test/java/org/apache/commons/rng/sampling/shape/CoordinatesTest.java b/commons-rng-sampling/src/test/java/org/apache/commons/rng/sampling/shape/CoordinatesTest.java
index cbfc336..941b58f 100644
--- a/commons-rng-sampling/src/test/java/org/apache/commons/rng/sampling/shape/CoordinatesTest.java
+++ b/commons-rng-sampling/src/test/java/org/apache/commons/rng/sampling/shape/CoordinatesTest.java
@@ -16,7 +16,7 @@
  */
 package org.apache.commons.rng.sampling.shape;
 
-import org.junit.Assert;
+import org.junit.jupiter.api.Assertions;
 import org.junit.Test;
 
 /**
@@ -30,7 +30,7 @@ public class CoordinatesTest {
     public void testRequireFiniteWithMessageThrows() {
         final double[] c = {0, 1, 2};
         final String message = "This should be prepended";
-        Assert.assertSame(c, Coordinates.requireFinite(c, message));
+        Assertions.assertSame(c, Coordinates.requireFinite(c, message));
         final double[] bad = {Double.POSITIVE_INFINITY, Double.NEGATIVE_INFINITY, Double.NaN};
         for (int i = 0; i < c.length; i++) {
             for (final double d : bad) {
@@ -38,9 +38,9 @@ public class CoordinatesTest {
                 c[i] = d;
                 try {
                     Coordinates.requireFinite(c, message);
-                    Assert.fail(String.format("Did not detect non-finite coordinate: %d = %s", i, d));
+                    Assertions.fail(String.format("Did not detect non-finite coordinate: %d = %s", i, d));
                 } catch (IllegalArgumentException ex) {
-                    Assert.assertTrue("Missing message prefix", ex.getMessage().startsWith(message));
+                    Assertions.assertTrue(ex.getMessage().startsWith(message), "Missing message prefix");
                 }
                 c[i] = value;
             }
@@ -55,18 +55,18 @@ public class CoordinatesTest {
         final String message = "This should be prepended";
         for (final double[] c : new double[][] {{0, 1}, {0, 1, 2}}) {
             final int length = c.length;
-            Assert.assertSame(c, Coordinates.requireLength(c, length, message));
+            Assertions.assertSame(c, Coordinates.requireLength(c, length, message));
             try {
                 Coordinates.requireLength(c, length - 1, message);
-                Assert.fail("Did not detect length was too long: " + (length - 1));
+                Assertions.fail("Did not detect length was too long: " + (length - 1));
             } catch (IllegalArgumentException ex) {
-                Assert.assertTrue("Missing message prefix", ex.getMessage().startsWith(message));
+                Assertions.assertTrue(ex.getMessage().startsWith(message), "Missing message prefix");
             }
             try {
                 Coordinates.requireLength(c, length + 1, message);
-                Assert.fail("Did not detect length was too short: " + (length + 1));
+                Assertions.fail("Did not detect length was too short: " + (length + 1));
             } catch (IllegalArgumentException ex) {
-                Assert.assertTrue("Missing message prefix", ex.getMessage().startsWith(message));
+                Assertions.assertTrue(ex.getMessage().startsWith(message), "Missing message prefix");
             }
         }
     }
diff --git a/commons-rng-sampling/src/test/java/org/apache/commons/rng/sampling/shape/LineSamplerTest.java b/commons-rng-sampling/src/test/java/org/apache/commons/rng/sampling/shape/LineSamplerTest.java
index ef3e802..b30a734 100644
--- a/commons-rng-sampling/src/test/java/org/apache/commons/rng/sampling/shape/LineSamplerTest.java
+++ b/commons-rng-sampling/src/test/java/org/apache/commons/rng/sampling/shape/LineSamplerTest.java
@@ -18,7 +18,7 @@ package org.apache.commons.rng.sampling.shape;
 
 import java.util.Arrays;
 
-import org.junit.Assert;
+import org.junit.jupiter.api.Assertions;
 import org.junit.Test;
 
 import org.apache.commons.math3.stat.inference.ChiSquareTest;
@@ -55,7 +55,7 @@ public class LineSamplerTest {
         }) {
             try {
                 LineSampler.of(rng, c[0], c[1]);
-                Assert.fail(String.format("Did not detect dimension mismatch: %d,%d",
+                Assertions.fail(String.format("Did not detect dimension mismatch: %d,%d",
                     c[0].length, c[1].length));
             } catch (IllegalArgumentException ex) {
                 // Expected
@@ -73,7 +73,7 @@ public class LineSamplerTest {
         final double[][] c = new double[][] {
             {0, 1, 2}, {-1, 2, 3}
         };
-        Assert.assertNotNull(LineSampler.of(rng, c[0],  c[1]));
+        Assertions.assertNotNull(LineSampler.of(rng, c[0],  c[1]));
         final double[] bad = {Double.POSITIVE_INFINITY, Double.NEGATIVE_INFINITY, Double.NaN};
         for (int i = 0; i < c.length; i++) {
             for (int j = 0; j < c[0].length; j++) {
@@ -82,7 +82,7 @@ public class LineSamplerTest {
                     c[i][j] = d;
                     try {
                         LineSampler.of(rng, c[0], c[1]);
-                        Assert.fail(String.format("Did not detect non-finite coordinate: %d,%d = %s",
+                        Assertions.fail(String.format("Did not detect non-finite coordinate: %d,%d = %s",
                             i, j, d));
                     } catch (IllegalArgumentException ex) {
                         // Expected
@@ -152,8 +152,8 @@ public class LineSamplerTest {
             }
         }
         // Show the line is too big to compute vectors between points.
-        Assert.assertEquals("Expect vector b - a to be infinite in the x dimension",
-            Double.POSITIVE_INFINITY, c2[1][0] - c2[0][0], 0.0);
+        Assertions.assertEquals(Double.POSITIVE_INFINITY, c2[1][0] - c2[0][0],
+            "Expect vector b - a to be infinite in the x dimension");
 
         final LineSampler sampler1 = LineSampler.of(
             RandomSource.XO_RO_SHI_RO_128_PP.create(seed), c1[0], c1[1]);
@@ -166,7 +166,7 @@ public class LineSamplerTest {
             for (int i = 0; i < a.length; i++) {
                 a[i] *= scale;
             }
-            Assert.assertArrayEquals(a, b, 0.0);
+            Assertions.assertArrayEquals(a, b);
         }
     }
 
@@ -250,17 +250,17 @@ public class LineSamplerTest {
             final long[] observed = new long[expected.length];
             for (int i = 0; i < samples; i++) {
                 final double[] x = sampler.sample();
-                Assert.assertEquals(dimension, x.length);
+                Assertions.assertEquals(dimension, x.length);
                 final double c = (x[0] - a[0]) * scale[0];
-                Assert.assertTrue("Not uniformly distributed", c >= 0.0 && c <= 1.0);
+                Assertions.assertTrue(c >= 0.0 && c <= 1.0, "Not uniformly distributed");
                 for (int j = 1; j < dimension; j++) {
-                    Assert.assertEquals("Not on the line", c, (x[j] - a[j]) * scale[j], 1e-14);
+                    Assertions.assertEquals(c, (x[j] - a[j]) * scale[j], 1e-14, "Not on the line");
                 }
                 // Assign the uniform deviate to a bin. Assumes c != 1.0.
                 observed[(int) (c * bins)]++;
             }
             final double p = new ChiSquareTest().chiSquareTest(expected, observed);
-            Assert.assertFalse("p-value too small: " + p, p < 0.001);
+            Assertions.assertFalse(p < 0.001, () -> "p-value too small: " + p);
         }
     }
 
@@ -365,11 +365,11 @@ public class LineSamplerTest {
         for (int n = 0; n < 3; n++) {
             final double[] s1 = sampler1.sample();
             final double[] s2 = sampler2.sample();
-            Assert.assertEquals(s1.length, s2.length);
-            Assert.assertFalse("First sampler has used the vertices by reference",
-                Arrays.equals(s1, s2));
+            Assertions.assertEquals(s1.length, s2.length);
+            Assertions.assertFalse(Arrays.equals(s1, s2),
+                "First sampler has used the vertices by reference");
             for (int i = 0; i < dimension; i++) {
-                Assert.assertEquals(s1[i] + offset, s2[i], 1e-10);
+                Assertions.assertEquals(s1[i] + offset, s2[i], 1e-10);
             }
         }
     }
diff --git a/commons-rng-sampling/src/test/java/org/apache/commons/rng/sampling/shape/TetrahedronSamplerTest.java b/commons-rng-sampling/src/test/java/org/apache/commons/rng/sampling/shape/TetrahedronSamplerTest.java
index ab4dec2..37b2280 100644
--- a/commons-rng-sampling/src/test/java/org/apache/commons/rng/sampling/shape/TetrahedronSamplerTest.java
+++ b/commons-rng-sampling/src/test/java/org/apache/commons/rng/sampling/shape/TetrahedronSamplerTest.java
@@ -18,7 +18,7 @@ package org.apache.commons.rng.sampling.shape;
 
 import java.util.Arrays;
 
-import org.junit.Assert;
+import org.junit.jupiter.api.Assertions;
 import org.junit.Test;
 
 import org.apache.commons.math3.stat.inference.ChiSquareTest;
@@ -44,7 +44,7 @@ public class TetrahedronSamplerTest {
             c[i] = bad;
             try {
                 TetrahedronSampler.of(rng, c[0], c[1], c[2], c[3]);
-                Assert.fail(String.format("Did not detect invalid dimension for vertex: %d", i));
+                Assertions.fail(String.format("Did not detect invalid dimension for vertex: %d", i));
             } catch (IllegalArgumentException ex) {
                 // Expected
             }
@@ -62,7 +62,7 @@ public class TetrahedronSamplerTest {
         final double[][] c = new double[][] {
             {1, 1, 1}, {1, -1, 1}, {-1, 1, 1}, {1, 1, -1}
         };
-        Assert.assertNotNull(TetrahedronSampler.of(rng, c[0], c[1], c[2], c[3]));
+        Assertions.assertNotNull(TetrahedronSampler.of(rng, c[0], c[1], c[2], c[3]));
         final double[] bad = {Double.POSITIVE_INFINITY, Double.NEGATIVE_INFINITY, Double.NaN};
         for (int i = 0; i < c.length; i++) {
             for (int j = 0; j < c[0].length; j++) {
@@ -71,7 +71,7 @@ public class TetrahedronSamplerTest {
                     c[i][j] = d;
                     try {
                         TetrahedronSampler.of(rng, c[0], c[1], c[2], c[3]);
-                        Assert.fail(String.format("Did not detect non-finite coordinate: %d,%d = %s", i, j, d));
+                        Assertions.fail(String.format("Did not detect non-finite coordinate: %d,%d = %s", i, j, d));
                     } catch (IllegalArgumentException ex) {
                         // Expected
                     }
@@ -103,12 +103,12 @@ public class TetrahedronSamplerTest {
             }
         }
         // Show the tetrahedron is too big to compute vectors between points.
-        Assert.assertEquals("Expect vector c - a to be infinite in the x dimension",
-                Double.NEGATIVE_INFINITY, c2[2][0] - c2[0][0], 0.0);
-        Assert.assertEquals("Expect vector c - d to be infinite in the y dimension",
-                Double.NEGATIVE_INFINITY, c2[2][1] - c2[3][1], 0.0);
-        Assert.assertEquals("Expect vector c - b to be infinite in the z dimension",
-                Double.POSITIVE_INFINITY, c2[2][2] - c2[1][2], 0.0);
+        Assertions.assertEquals(Double.NEGATIVE_INFINITY, c2[2][0] - c2[0][0],
+            "Expect vector c - a to be infinite in the x dimension");
+        Assertions.assertEquals(Double.NEGATIVE_INFINITY, c2[2][1] - c2[3][1],
+            "Expect vector c - d to be infinite in the y dimension");
+        Assertions.assertEquals(Double.POSITIVE_INFINITY, c2[2][2] - c2[1][2],
+            "Expect vector c - b to be infinite in the z dimension");
 
         final TetrahedronSampler sampler1 = TetrahedronSampler.of(
                 RandomSource.XO_RO_SHI_RO_128_PP.create(seed), c1[0], c1[1], c1[2], c1[3]);
@@ -121,7 +121,7 @@ public class TetrahedronSamplerTest {
             for (int i = 0; i < a.length; i++) {
                 a[i] *= scale;
             }
-            Assert.assertArrayEquals(a, b, 0.0);
+            Assertions.assertArrayEquals(a, b);
         }
     }
 
@@ -202,7 +202,7 @@ public class TetrahedronSamplerTest {
                 }
             }
             final double p = new ChiSquareTest().chiSquareTest(expected, observed);
-            Assert.assertFalse("p-value too small: " + p, p < 0.001);
+            Assertions.assertFalse(p < 0.001, () -> "p-value too small: " + p);
         }
     }
 
@@ -232,9 +232,9 @@ public class TetrahedronSamplerTest {
                                        double lx, double ly, double lz,
                                        double sx, double sy, double sz,
                                        Tetrahedron tetrahedron) {
-        Assert.assertEquals(3, v.length);
+        Assertions.assertEquals(3, v.length);
         // Test the point is inside the correct tetrahedron
-        Assert.assertTrue("Not inside the tetrahedron", tetrahedron.contains(v));
+        Assertions.assertTrue(tetrahedron.contains(v), "Not inside the tetrahedron");
         final double x = v[0];
         final double y = v[1];
         final double z = v[2];
@@ -288,10 +288,10 @@ public class TetrahedronSamplerTest {
         for (int n = 0; n < 5; n++) {
             final double[] s1 = sampler1.sample();
             final double[] s2 = sampler2.sample();
-            Assert.assertEquals(3, s1.length);
-            Assert.assertEquals(3, s2.length);
+            Assertions.assertEquals(3, s1.length);
+            Assertions.assertEquals(3, s2.length);
             for (int i = 0; i < 3; i++) {
-                Assert.assertEquals(s1[i] + offset, s2[i], 1e-10);
+                Assertions.assertEquals(s1[i] + offset, s2[i], 1e-10);
             }
         }
     }
@@ -309,36 +309,36 @@ public class TetrahedronSamplerTest {
         final double epsilon = 1e-14;
         // Vertices
         for (int i = 0; i < 4; i++) {
-            Assert.assertTrue(tetrahedron.contains(c1[i], epsilon));
+            Assertions.assertTrue(tetrahedron.contains(c1[i], epsilon));
         }
         // Edge
-        Assert.assertTrue(tetrahedron.contains(new double[] {1, 0, 0}, epsilon));
-        Assert.assertTrue(tetrahedron.contains(new double[] {0.5, 0.5, 1}, epsilon));
+        Assertions.assertTrue(tetrahedron.contains(new double[] {1, 0, 0}, epsilon));
+        Assertions.assertTrue(tetrahedron.contains(new double[] {0.5, 0.5, 1}, epsilon));
         // Just inside the edge
-        Assert.assertTrue(tetrahedron.contains(new double[] {1 - 1e-10, 0, 0}));
-        Assert.assertTrue(tetrahedron.contains(new double[] {0.5, 0.5, 1 - 1e-10}));
+        Assertions.assertTrue(tetrahedron.contains(new double[] {1 - 1e-10, 0, 0}));
+        Assertions.assertTrue(tetrahedron.contains(new double[] {0.5, 0.5, 1 - 1e-10}));
         // Just outside the edge
-        Assert.assertFalse(tetrahedron.contains(new double[] {1, 0, 1e-10}, epsilon));
-        Assert.assertFalse(tetrahedron.contains(new double[] {0.5, 0.5 + 1e-10, 1}, epsilon));
+        Assertions.assertFalse(tetrahedron.contains(new double[] {1, 0, 1e-10}, epsilon));
+        Assertions.assertFalse(tetrahedron.contains(new double[] {0.5, 0.5 + 1e-10, 1}, epsilon));
         // Face
         double x = 1.0 / 3;
-        Assert.assertTrue(tetrahedron.contains(new double[] {x, -x, x}, epsilon));
-        Assert.assertTrue(tetrahedron.contains(new double[] {-x, -x, -x}, epsilon));
-        Assert.assertTrue(tetrahedron.contains(new double[] {x, x, -x}, epsilon));
-        Assert.assertTrue(tetrahedron.contains(new double[] {-x, x, x}, epsilon));
+        Assertions.assertTrue(tetrahedron.contains(new double[] {x, -x, x}, epsilon));
+        Assertions.assertTrue(tetrahedron.contains(new double[] {-x, -x, -x}, epsilon));
+        Assertions.assertTrue(tetrahedron.contains(new double[] {x, x, -x}, epsilon));
+        Assertions.assertTrue(tetrahedron.contains(new double[] {-x, x, x}, epsilon));
         // Just outside the face
         x += 1e-10;
-        Assert.assertFalse(tetrahedron.contains(new double[] {x, -x, x}, epsilon));
-        Assert.assertFalse(tetrahedron.contains(new double[] {-x, -x, -x}, epsilon));
-        Assert.assertFalse(tetrahedron.contains(new double[] {x, x, -x}, epsilon));
-        Assert.assertFalse(tetrahedron.contains(new double[] {-x, x, x}, epsilon));
+        Assertions.assertFalse(tetrahedron.contains(new double[] {x, -x, x}, epsilon));
+        Assertions.assertFalse(tetrahedron.contains(new double[] {-x, -x, -x}, epsilon));
+        Assertions.assertFalse(tetrahedron.contains(new double[] {x, x, -x}, epsilon));
+        Assertions.assertFalse(tetrahedron.contains(new double[] {-x, x, x}, epsilon));
         // Inside
-        Assert.assertTrue(tetrahedron.contains(new double[] {0, 0, 0}));
-        Assert.assertTrue(tetrahedron.contains(new double[] {0.5, 0.25, -0.1}));
+        Assertions.assertTrue(tetrahedron.contains(new double[] {0, 0, 0}));
+        Assertions.assertTrue(tetrahedron.contains(new double[] {0.5, 0.25, -0.1}));
         // Outside
-        Assert.assertFalse(tetrahedron.contains(new double[] {0, 20, 0}));
-        Assert.assertFalse(tetrahedron.contains(new double[] {-20, 0, 0}));
-        Assert.assertFalse(tetrahedron.contains(new double[] {6, 6, 4}));
+        Assertions.assertFalse(tetrahedron.contains(new double[] {0, 20, 0}));
+        Assertions.assertFalse(tetrahedron.contains(new double[] {-20, 0, 0}));
+        Assertions.assertFalse(tetrahedron.contains(new double[] {6, 6, 4}));
     }
 
     /**
diff --git a/commons-rng-sampling/src/test/java/org/apache/commons/rng/sampling/shape/TriangleSamplerTest.java b/commons-rng-sampling/src/test/java/org/apache/commons/rng/sampling/shape/TriangleSamplerTest.java
index fadb3c5..5f51c02 100644
--- a/commons-rng-sampling/src/test/java/org/apache/commons/rng/sampling/shape/TriangleSamplerTest.java
+++ b/commons-rng-sampling/src/test/java/org/apache/commons/rng/sampling/shape/TriangleSamplerTest.java
@@ -18,7 +18,7 @@ package org.apache.commons.rng.sampling.shape;
 
 import java.util.Arrays;
 
-import org.junit.Assert;
+import org.junit.jupiter.api.Assertions;
 import org.junit.Test;
 
 import org.apache.commons.math3.stat.inference.ChiSquareTest;
@@ -73,18 +73,18 @@ public class TriangleSamplerTest {
         // Test that (1 - (1-s) - (1-t)) is not equal to (s + t - 1).
         // This is due to the rounding to store s + t as a double.
         final double expected = 1 - (1 - s) - (1 - t);
-        Assert.assertNotEquals(expected, spt - 1, 0.0);
-        Assert.assertNotEquals(expected, s + t - 1, 0.0);
+        Assertions.assertNotEquals(expected, spt - 1);
+        Assertions.assertNotEquals(expected, s + t - 1);
         // For any uniform deviate u in [0, 1], u - 1 is exact, thus s - 1 is exact
         // and s - 1 + t is exact.
-        Assert.assertEquals(expected, s - 1 + t, 0.0);
+        Assertions.assertEquals(expected, s - 1 + t);
 
         // Test that a(1 - s - t) + sb + tc does not overflow is s+t = 1
         final double max = Double.MAX_VALUE;
         s -= delta;
         final UniformRandomProvider rng = RandomSource.XO_RO_SHI_RO_128_PP.create();
         for (int n = 0; n < 100; n++) {
-            Assert.assertNotEquals(Double.POSITIVE_INFINITY, (1 - s - t) * max + s * max + t * max, 0.0);
+            Assertions.assertNotEquals(Double.POSITIVE_INFINITY, (1 - s - t) * max + s * max + t * max);
             s = rng.nextDouble();
             t = 1.0 - s;
         }
@@ -117,7 +117,7 @@ public class TriangleSamplerTest {
         }) {
             try {
                 TriangleSampler.of(rng, c[0], c[1], c[2]);
-                Assert.fail(String.format("Did not detect dimension mismatch: %d,%d,%d",
+                Assertions.fail(String.format("Did not detect dimension mismatch: %d,%d,%d",
                         c[0].length, c[1].length, c[2].length));
             } catch (IllegalArgumentException ex) {
                 // Expected
@@ -135,7 +135,7 @@ public class TriangleSamplerTest {
         final double[][] c = new double[][] {
             {0, 0, 1}, {2, 1, 0}, {-1, 2, 3}
         };
-        Assert.assertNotNull(TriangleSampler.of(rng, c[0],  c[1],  c[2]));
+        Assertions.assertNotNull(TriangleSampler.of(rng, c[0],  c[1],  c[2]));
         final double[] bad = {Double.POSITIVE_INFINITY, Double.NEGATIVE_INFINITY, Double.NaN};
         for (int i = 0; i < c.length; i++) {
             for (int j = 0; j < c[0].length; j++) {
@@ -144,7 +144,7 @@ public class TriangleSamplerTest {
                     c[i][j] = d;
                     try {
                         TriangleSampler.of(rng, c[0], c[1], c[2]);
-                        Assert.fail(String.format("Did not detect non-finite coordinate: %d,%d = %s", i, j, d));
+                        Assertions.fail(String.format("Did not detect non-finite coordinate: %d,%d = %s", i, j, d));
                     } catch (IllegalArgumentException ex) {
                         // Expected
                     }
@@ -212,10 +212,10 @@ public class TriangleSamplerTest {
             }
         }
         // Show the triangle is too big to compute vectors between points.
-        Assert.assertEquals("Expect vector c - a to be infinite in the x dimension",
-                Double.POSITIVE_INFINITY, c2[2][0] - c2[0][0], 0.0);
-        Assert.assertEquals("Expect vector c - b to be infinite in the y dimension",
-                Double.NEGATIVE_INFINITY, c2[2][1] - c2[1][1], 0.0);
+        Assertions.assertEquals(Double.POSITIVE_INFINITY, c2[2][0] - c2[0][0],
+            "Expect vector c - a to be infinite in the x dimension");
+        Assertions.assertEquals(Double.NEGATIVE_INFINITY, c2[2][1] - c2[1][1],
+            "Expect vector c - b to be infinite in the y dimension");
 
         final TriangleSampler sampler1 = TriangleSampler.of(
                 RandomSource.XO_RO_SHI_RO_128_PP.create(seed), c1[0], c1[1], c1[2]);
@@ -228,7 +228,7 @@ public class TriangleSamplerTest {
             for (int i = 0; i < a.length; i++) {
                 a[i] *= scale;
             }
-            Assert.assertArrayEquals(a, b, 0.0);
+            Assertions.assertArrayEquals(a, b);
         }
     }
 
@@ -334,7 +334,7 @@ public class TriangleSamplerTest {
                 addObservation(reverse.apply(sampler3.sample()), observed, bins, sx, sy, triangle3);
             }
             final double p = new ChiSquareTest().chiSquareTest(expected, observed);
-            Assert.assertFalse("p-value too small: " + p, p < 0.001);
+            Assertions.assertFalse(p < 0.001, () -> "p-value too small: " + p);
         }
     }
 
@@ -358,7 +358,7 @@ public class TriangleSamplerTest {
         final double x = v[0];
         final double y = v[1];
         // Test the point is triangle the triangle
-        Assert.assertTrue(triangle.contains(x, y));
+        Assertions.assertTrue(triangle.contains(x, y));
         // Add to the correct bin after using the offset
         final int binx = (int) (x * sx);
         final int biny = (int) (y * sy);
@@ -453,11 +453,11 @@ public class TriangleSamplerTest {
         for (int n = 0; n < 3; n++) {
             final double[] s1 = sampler1.sample();
             final double[] s2 = sampler2.sample();
-            Assert.assertEquals(s1.length, s2.length);
-            Assert.assertFalse("First sampler has used the vertices by reference",
-                    Arrays.equals(s1, s2));
+            Assertions.assertEquals(s1.length, s2.length);
+            Assertions.assertFalse(Arrays.equals(s1, s2),
+                    "First sampler has used the vertices by reference");
             for (int i = 0; i < dimension; i++) {
-                Assert.assertEquals(s1[i] + offset, s2[i], 1e-10);
+                Assertions.assertEquals(s1[i] + offset, s2[i], 1e-10);
             }
         }
     }
@@ -519,15 +519,15 @@ public class TriangleSamplerTest {
         for (int n = 0; n < 10; n++) {
             final double[] a = new double[] {rng.nextDouble(), rng.nextDouble()};
             final double[] b = forward.apply(a);
-            Assert.assertEquals(dimension, b.length);
+            Assertions.assertEquals(dimension, b.length);
             for (int i = 2; i < dimension; i++) {
                 sum += Math.abs(b[i]);
             }
             final double[] c = reverse.apply(b);
-            Assert.assertArrayEquals(a, c, 1e-10);
+            Assertions.assertArrayEquals(a, c, 1e-10);
         }
         // Check that higher dimension coordinates are generated
-        Assert.assertTrue(sum > 0.5);
+        Assertions.assertTrue(sum > 0.5);
     }
 
     /**
@@ -537,10 +537,10 @@ public class TriangleSamplerTest {
     public void testRotations3D() {
         final double[] x = {1, 0.5, 0};
         final double[] y = multiply(F3, x);
-        Assert.assertArrayEquals(new double[] {0.465475314831549, 1.004183876910958, -0.157947689551155}, y, 1e-10);
-        Assert.assertEquals(length(x), length(y), 1e-10);
+        Assertions.assertArrayEquals(new double[] {0.465475314831549, 1.004183876910958, -0.157947689551155}, y, 1e-10);
+        Assertions.assertEquals(length(x), length(y), 1e-10);
         final double[] x2 = multiply(R3, y);
-        Assert.assertArrayEquals(x, x2, 1e-10);
+        Assertions.assertArrayEquals(x, x2, 1e-10);
     }
 
     /**
@@ -550,11 +550,11 @@ public class TriangleSamplerTest {
     public void testRotations4D() {
         final double[] x = {1, 0.5, 0, 0};
         final double[] y = multiply(F4, x);
-        Assert.assertArrayEquals(
+        Assertions.assertArrayEquals(
                 new double[] {0.676776695296637, 0.780330085889911, 0.323223304703363, -0.280330085889911}, y, 1e-10);
-        Assert.assertEquals(length(x), length(y), 1e-10);
+        Assertions.assertEquals(length(x), length(y), 1e-10);
         final double[] x2 = multiply(R4, y);
-        Assert.assertArrayEquals(x, x2, 1e-10);
+        Assertions.assertArrayEquals(x, x2, 1e-10);
     }
 
     /**
@@ -597,27 +597,27 @@ public class TriangleSamplerTest {
     public void testTriangleContains() {
         final Triangle triangle = new Triangle(1, 2, 3, 1, 0.5, 6);
         // Vertices
-        Assert.assertTrue(triangle.contains(1, 2));
-        Assert.assertTrue(triangle.contains(3, 1));
-        Assert.assertTrue(triangle.contains(0.5, 6));
+        Assertions.assertTrue(triangle.contains(1, 2));
+        Assertions.assertTrue(triangle.contains(3, 1));
+        Assertions.assertTrue(triangle.contains(0.5, 6));
         // Edge
-        Assert.assertTrue(triangle.contains(0.75, 4));
+        Assertions.assertTrue(triangle.contains(0.75, 4));
         // Inside
-        Assert.assertTrue(triangle.contains(1.5, 3));
+        Assertions.assertTrue(triangle.contains(1.5, 3));
         // Outside
-        Assert.assertFalse(triangle.contains(0, 20));
-        Assert.assertFalse(triangle.contains(-20, 0));
-        Assert.assertFalse(triangle.contains(6, 6));
+        Assertions.assertFalse(triangle.contains(0, 20));
+        Assertions.assertFalse(triangle.contains(-20, 0));
+        Assertions.assertFalse(triangle.contains(6, 6));
         // Just outside
-        Assert.assertFalse(triangle.contains(0.75, 4 - 1e-10));
+        Assertions.assertFalse(triangle.contains(0.75, 4 - 1e-10));
 
         // Note:
         // Touching triangles can both have the point triangle.
         // This predicate is not suitable for assigning points uniquely to
         // non-overlapping triangles that share an edge.
         final Triangle triangle2 = new Triangle(1, 2, 3, 1, 0, -2);
-        Assert.assertTrue(triangle.contains(2, 1.5));
-        Assert.assertTrue(triangle2.contains(2, 1.5));
+        Assertions.assertTrue(triangle.contains(2, 1.5));
+        Assertions.assertTrue(triangle2.contains(2, 1.5));
     }
 
     /**
@@ -671,11 +671,11 @@ public class TriangleSamplerTest {
 
         @Override
         public double[] apply(double[] coord) {
-            Assert.assertEquals(n, coord.length);
+            Assertions.assertEquals(n, coord.length);
             final double[] x = multiply(r, coord);
             // This should reverse the 2D transform and return to the XY plane.
             for (int i = 2; i < x.length; i++) {
-                Assert.assertEquals(0.0, x[i], 1e-14);
+                Assertions.assertEquals(0.0, x[i], 1e-14);
             }
             return new double[] {x[0], x[1]};
         }
@@ -687,7 +687,7 @@ public class TriangleSamplerTest {
     private static class Transform2Dto2D implements Transform {
         @Override
         public double[] apply(double[] coord) {
-            Assert.assertEquals(2, coord.length);
+            Assertions.assertEquals(2, coord.length);
             return coord;
         }
     }
diff --git a/commons-rng-sampling/src/test/java/org/apache/commons/rng/sampling/shape/UnitBallSamplerTest.java b/commons-rng-sampling/src/test/java/org/apache/commons/rng/sampling/shape/UnitBallSamplerTest.java
index 72b400b..66221d5 100644
--- a/commons-rng-sampling/src/test/java/org/apache/commons/rng/sampling/shape/UnitBallSamplerTest.java
+++ b/commons-rng-sampling/src/test/java/org/apache/commons/rng/sampling/shape/UnitBallSamplerTest.java
@@ -18,7 +18,7 @@ package org.apache.commons.rng.sampling.shape;
 
 import java.util.Arrays;
 import java.util.function.DoubleUnaryOperator;
-import org.junit.Assert;
+import org.junit.jupiter.api.Assertions;
 import org.junit.Test;
 
 import org.apache.commons.math3.stat.inference.ChiSquareTest;
@@ -143,10 +143,10 @@ public class UnitBallSamplerTest {
                     }
                 }
                 // Radius above 1
-                Assert.fail("Invalid sample length: " + length);
+                Assertions.fail("Invalid sample length: " + length);
             }
             final double p = new ChiSquareTest().chiSquareTest(expected, observed);
-            Assert.assertFalse("p-value too small: " + p, p < 0.001);
+            Assertions.assertFalse(p < 0.001, () -> "p-value too small: " + p);
         }
     }
 
@@ -184,9 +184,9 @@ public class UnitBallSamplerTest {
         };
 
         final double[] vector = UnitBallSampler.of(bad, dimension).sample();
-        Assert.assertEquals(dimension, vector.length);
+        Assertions.assertEquals(dimension, vector.length);
         // A non-zero coordinate should occur with a SplitMix which returns 0 only once.
-        Assert.assertNotEquals(0.0, length(vector));
+        Assertions.assertNotEquals(0.0, length(vector));
     }
 
     /**
@@ -273,7 +273,7 @@ public class UnitBallSamplerTest {
             final DoubleUnaryOperator volume = createVolumeFunction(n);
             final DoubleUnaryOperator radius = createRadiusFunction(n);
             for (final double r : radii) {
-                Assert.assertEquals(r, radius.applyAsDouble(volume.applyAsDouble(r)), 1e-10);
+                Assertions.assertEquals(r, radius.applyAsDouble(volume.applyAsDouble(r)), 1e-10);
             }
         }
     }
diff --git a/commons-rng-simple/src/test/java/org/apache/commons/rng/simple/JDKRandomBridgeTest.java b/commons-rng-simple/src/test/java/org/apache/commons/rng/simple/JDKRandomBridgeTest.java
index 6e735c7..e920400 100644
--- a/commons-rng-simple/src/test/java/org/apache/commons/rng/simple/JDKRandomBridgeTest.java
+++ b/commons-rng-simple/src/test/java/org/apache/commons/rng/simple/JDKRandomBridgeTest.java
@@ -22,7 +22,7 @@ import java.io.ObjectInputStream;
 import java.io.ByteArrayOutputStream;
 import java.io.ByteArrayInputStream;
 import java.util.Random;
-import org.junit.Assert;
+import org.junit.jupiter.api.Assertions;
 import org.junit.Test;
 
 /**
@@ -39,7 +39,7 @@ public class JDKRandomBridgeTest {
 
         // Reseed.
         final long newSeed = RandomSource.createLong();
-        Assert.assertNotEquals(seed, newSeed);
+        Assertions.assertNotEquals(seed, newSeed);
         rng1.setSeed(newSeed);
         rng2.setSeed(newSeed);
         checkSameSequence(rng1, rng2);
@@ -76,36 +76,33 @@ public class JDKRandomBridgeTest {
     private void checkSameSequence(Random rng1,
                                    Random rng2) {
         for (int i = 0; i < 4; i++) {
-            Assert.assertEquals(rng1.nextInt(),
-                                rng2.nextInt());
+            Assertions.assertEquals(rng1.nextInt(),
+                                    rng2.nextInt());
         }
         for (int i = 0; i < 7; i++) {
-            Assert.assertEquals(rng1.nextLong(),
-                                rng2.nextLong());
+            Assertions.assertEquals(rng1.nextLong(),
+                                    rng2.nextLong());
         }
         for (int i = 0; i < 9; i++) {
-            Assert.assertEquals(rng1.nextFloat(),
-                                rng2.nextFloat(),
-                                0f);
+            Assertions.assertEquals(rng1.nextFloat(),
+                                    rng2.nextFloat());
         }
         for (int i = 0; i < 12; i++) {
-            Assert.assertEquals(rng1.nextDouble(),
-                                rng2.nextDouble(),
-                                0d);
+            Assertions.assertEquals(rng1.nextDouble(),
+                                    rng2.nextDouble());
         }
         for (int i = 0; i < 17; i++) {
-            Assert.assertEquals(rng1.nextGaussian(),
-                                rng2.nextGaussian(),
-                                0d);
+            Assertions.assertEquals(rng1.nextGaussian(),
+                                    rng2.nextGaussian());
         }
         for (int i = 0; i < 18; i++) {
-            Assert.assertEquals(rng1.nextBoolean(),
-                                rng2.nextBoolean());
+            Assertions.assertEquals(rng1.nextBoolean(),
+                                    rng2.nextBoolean());
         }
         for (int i = 0; i < 19; i++) {
             final int max = i + 123456;
-            Assert.assertEquals(rng1.nextInt(max),
-                                rng2.nextInt(max));
+            Assertions.assertEquals(rng1.nextInt(max),
+                                    rng2.nextInt(max));
         }
 
         final int len = 233;
@@ -114,8 +111,8 @@ public class JDKRandomBridgeTest {
         rng1.nextBytes(store1);
         rng2.nextBytes(store2);
         for (int i = 0; i < len; i++) {
-            Assert.assertEquals(store1[i],
-                                store2[i]);
+            Assertions.assertEquals(store1[i],
+                                    store2[i]);
         }
     }
 }
diff --git a/commons-rng-simple/src/test/java/org/apache/commons/rng/simple/JDKRandomWrapperTest.java b/commons-rng-simple/src/test/java/org/apache/commons/rng/simple/JDKRandomWrapperTest.java
index e4e9895..e6a0559 100644
--- a/commons-rng-simple/src/test/java/org/apache/commons/rng/simple/JDKRandomWrapperTest.java
+++ b/commons-rng-simple/src/test/java/org/apache/commons/rng/simple/JDKRandomWrapperTest.java
@@ -20,7 +20,7 @@ import java.util.Random;
 
 import org.apache.commons.rng.UniformRandomProvider;
 import org.apache.commons.rng.core.source64.LongProvider;
-import org.junit.Assert;
+import org.junit.jupiter.api.Assertions;
 import org.junit.Test;
 
 /**
@@ -48,31 +48,29 @@ public class JDKRandomWrapperTest {
     private static void checkSameSequence(Random rng1,
                                           UniformRandomProvider rng2) {
         for (int i = 0; i < 4; i++) {
-            Assert.assertEquals(rng1.nextInt(),
-                                rng2.nextInt());
+            Assertions.assertEquals(rng1.nextInt(),
+                                    rng2.nextInt());
         }
         for (int i = 0; i < 7; i++) {
-            Assert.assertEquals(rng1.nextLong(),
-                                rng2.nextLong());
+            Assertions.assertEquals(rng1.nextLong(),
+                                    rng2.nextLong());
         }
         for (int i = 0; i < 9; i++) {
-            Assert.assertEquals(rng1.nextFloat(),
-                                rng2.nextFloat(),
-                                0f);
+            Assertions.assertEquals(rng1.nextFloat(),
+                                    rng2.nextFloat());
         }
         for (int i = 0; i < 12; i++) {
-            Assert.assertEquals(rng1.nextDouble(),
-                                rng2.nextDouble(),
-                                0d);
+            Assertions.assertEquals(rng1.nextDouble(),
+                                    rng2.nextDouble());
         }
         for (int i = 0; i < 18; i++) {
-            Assert.assertEquals(rng1.nextBoolean(),
-                                rng2.nextBoolean());
+            Assertions.assertEquals(rng1.nextBoolean(),
+                                    rng2.nextBoolean());
         }
         for (int i = 0; i < 19; i++) {
             final int max = i + 123456;
-            Assert.assertEquals(rng1.nextInt(max),
-                                rng2.nextInt(max));
+            Assertions.assertEquals(rng1.nextInt(max),
+                                    rng2.nextInt(max));
         }
 
         final int len = 233;
@@ -81,8 +79,8 @@ public class JDKRandomWrapperTest {
         rng1.nextBytes(store1);
         rng2.nextBytes(store2);
         for (int i = 0; i < len; i++) {
-            Assert.assertEquals(store1[i],
-                                store2[i]);
+            Assertions.assertEquals(store1[i],
+                                    store2[i]);
         }
     }
 
@@ -116,7 +114,7 @@ public class JDKRandomWrapperTest {
         //                  all code paths.
         for (final long max : new long[] {1, 256, 56757, 1L << 32, (1L << 62) + 1}) {
             for (int i = 0; i < 10; i++) {
-                Assert.assertEquals(rng1.nextLong(max),
+                Assertions.assertEquals(rng1.nextLong(max),
                                     rng2.nextLong(max));
             }
         }
@@ -163,7 +161,7 @@ public class JDKRandomWrapperTest {
         rng1.nextBytes(store1);
         rng2.nextBytes(store2, start, length);
         for (int i = 0; i < length; i++) {
-            Assert.assertEquals(store1[i],
+            Assertions.assertEquals(store1[i],
                                 store2[i + start]);
         }
     }
diff --git a/commons-rng-simple/src/test/java/org/apache/commons/rng/simple/ProvidersCommonParametricTest.java b/commons-rng-simple/src/test/java/org/apache/commons/rng/simple/ProvidersCommonParametricTest.java
index ba4f60c..036790b 100644
--- a/commons-rng-simple/src/test/java/org/apache/commons/rng/simple/ProvidersCommonParametricTest.java
+++ b/commons-rng-simple/src/test/java/org/apache/commons/rng/simple/ProvidersCommonParametricTest.java
@@ -26,9 +26,9 @@ import java.io.ObjectInputStream;
 import java.io.ByteArrayOutputStream;
 import java.io.ByteArrayInputStream;
 
-import org.junit.Assert;
+import org.junit.jupiter.api.Assertions;
 import org.junit.Test;
-import org.junit.Assume;
+import org.junit.jupiter.api.Assumptions;
 import org.junit.runner.RunWith;
 import org.junit.runners.Parameterized;
 import org.junit.runners.Parameterized.Parameters;
@@ -86,10 +86,10 @@ public class ProvidersCommonParametricTest {
     @Test
     public void testFactoryCreateMethod() {
         // Cannot test providers that require arguments
-        Assume.assumeTrue(originalArgs == null);
+        Assumptions.assumeTrue(originalArgs == null);
         @SuppressWarnings("deprecation")
         final UniformRandomProvider rng = RandomSource.create(originalSource);
-        Assert.assertEquals(generator.getClass(), rng.getClass());
+        Assertions.assertEquals(generator.getClass(), rng.getClass());
     }
 
     /**
@@ -100,11 +100,11 @@ public class ProvidersCommonParametricTest {
     public void testFactoryCreateMethodWithSeed() {
         @SuppressWarnings("deprecation")
         final UniformRandomProvider rng1 = RandomSource.create(originalSource, originalSeed, originalArgs);
-        Assert.assertEquals(rng1.getClass(), generator.getClass());
+        Assertions.assertEquals(rng1.getClass(), generator.getClass());
         // Check the output
         final UniformRandomProvider rng2 = originalSource.create(originalSeed, originalArgs);
         for (int i = 0; i < 10; i++) {
-            Assert.assertEquals(rng2.nextLong(), rng1.nextLong());
+            Assertions.assertEquals(rng2.nextLong(), rng1.nextLong());
         }
     }
 
@@ -120,7 +120,7 @@ public class ProvidersCommonParametricTest {
                 int arg1 = 123;
                 double arg2 = 456.0;
                 originalSource.create(arg1, arg2);
-                Assert.fail("Source does not require arguments: " + originalSource);
+                Assertions.fail("Source does not require arguments: " + originalSource);
             } catch (IllegalArgumentException ex) {
                 // Expected
             }
@@ -128,7 +128,7 @@ public class ProvidersCommonParametricTest {
             try {
                 // Try no arguments for a provider that does require them
                 originalSource.create();
-                Assert.fail("Source requires arguments: " + originalSource);
+                Assertions.fail("Source requires arguments: " + originalSource);
             } catch (IllegalArgumentException ex) {
                 // Expected
             }
@@ -155,9 +155,9 @@ public class ProvidersCommonParametricTest {
         for (Object s : seeds) {
             ++seedCount;
             if (originalSource.isNativeSeed(s)) {
-                Assert.assertNotNull("Identified native seed is null", s);
-                Assert.assertEquals("Incorrect identification of native seed type",
-                                    s.getClass(), originalSeed.getClass());
+                Assertions.assertNotNull(s, "Identified native seed is null");
+                Assertions.assertEquals(s.getClass(), originalSeed.getClass(),
+                    "Incorrect identification of native seed type");
             } else {
                 ++nonNativeSeedCount;
             }
@@ -165,8 +165,8 @@ public class ProvidersCommonParametricTest {
             originalSource.create(s, originalArgs);
         }
 
-        Assert.assertEquals(6, seedCount);
-        Assert.assertEquals(5, nonNativeSeedCount);
+        Assertions.assertEquals(6, seedCount);
+        Assertions.assertEquals(5, nonNativeSeedCount);
     }
 
     @Test
@@ -181,7 +181,7 @@ public class ProvidersCommonParametricTest {
     @Test
     public void testEmptyIntArraySeed() {
         final int[] empty = new int[0];
-        Assume.assumeTrue(originalSource.isNativeSeed(empty));
+        Assumptions.assumeTrue(originalSource.isNativeSeed(empty));
 
         // Exercise the default seeding procedure.
         final UniformRandomProvider rng = originalSource.create(empty, originalArgs);
@@ -191,9 +191,9 @@ public class ProvidersCommonParametricTest {
     @Test
     public void testEmptyLongArraySeed() {
         final long[] empty = new long[0];
-        Assume.assumeTrue(originalSource.isNativeSeed(empty));
+        Assumptions.assumeTrue(originalSource.isNativeSeed(empty));
         // The Middle-Square Weyl Sequence generator cannot self-seed
-        Assume.assumeFalse(originalSource == RandomSource.MSWS);
+        Assumptions.assumeFalse(originalSource == RandomSource.MSWS);
 
         // Exercise the default seeding procedure.
         final UniformRandomProvider rng = originalSource.create(empty, originalArgs);
@@ -205,8 +205,8 @@ public class ProvidersCommonParametricTest {
         // Exercise capacity to escape all "zero" state.
         final int[] zero = new int[2000]; // Large enough to fill the entire state with zeroes.
         final UniformRandomProvider rng = originalSource.create(zero, originalArgs);
-        Assume.assumeTrue("RNG is non-functional with an all zero seed: " + originalSource,
-                createsNonZeroLongOutput(rng, 2000));
+        Assumptions.assumeTrue(createsNonZeroLongOutput(rng, 2000),
+            () -> "RNG is non-functional with an all zero seed: " + originalSource);
         checkNextIntegerInRange(rng, 10, 10000);
     }
 
@@ -215,8 +215,8 @@ public class ProvidersCommonParametricTest {
         // Exercise capacity to escape all "zero" state.
         final long[] zero = new long[2000]; // Large enough to fill the entire state with zeroes.
         final UniformRandomProvider rng = originalSource.create(zero, originalArgs);
-        Assume.assumeTrue("RNG is non-functional with an all zero seed: " + originalSource,
-                createsNonZeroLongOutput(rng, 2000));
+        Assumptions.assumeTrue(createsNonZeroLongOutput(rng, 2000),
+            () -> "RNG is non-functional with an all zero seed: " + originalSource);
         checkNextIntegerInRange(rng, 10, 10000);
     }
 
@@ -250,7 +250,7 @@ public class ProvidersCommonParametricTest {
         // Cast must fail.
         try {
             final RestorableUniformRandomProvider dummy = (RestorableUniformRandomProvider) rng2;
-            Assert.fail("Cast should have failed");
+            Assertions.fail("Cast should have failed");
         } catch (ClassCastException e) {
             // Expected.
         }
@@ -278,40 +278,42 @@ public class ProvidersCommonParametricTest {
 
         // Discard a few more.
         final List<Number> listDiscard = makeList(n);
-        Assert.assertNotEquals(0, listDiscard.size());
-        Assert.assertNotEquals(listOrig, listDiscard);
+        Assertions.assertNotEquals(0, listDiscard.size());
+        Assertions.assertNotEquals(listOrig, listDiscard);
 
         // Retrieve from serialized stream.
         ByteArrayInputStream bis = new ByteArrayInputStream(bos.toByteArray());
         ObjectInputStream ois = new ObjectInputStream(bis);
         final RandomProviderState stateNew = new RandomProviderDefaultState((byte[]) ois.readObject());
 
-        Assert.assertNotSame(stateOrig, stateNew);
+        Assertions.assertNotSame(stateOrig, stateNew);
 
         // Reset.
         restorable.restoreState(stateNew);
 
         // Replay.
         final List<Number> listReplay = makeList(n);
-        Assert.assertNotSame(listOrig, listReplay);
+        Assertions.assertNotSame(listOrig, listReplay);
 
         // Check that the serialized data recreated the orginal state.
-        Assert.assertEquals(listOrig, listReplay);
+        Assertions.assertEquals(listOrig, listReplay);
     }
 
     @Test
     public void testUnrestorableToString() {
-        Assert.assertEquals(generator.toString(),
+        Assertions.assertEquals(generator.toString(),
                             RandomSource.unrestorable(generator).toString());
     }
 
     @Test
     public void testSupportedInterfaces() {
         final UniformRandomProvider rng = originalSource.create(null, originalArgs);
-        Assert.assertEquals("isJumpable", rng instanceof JumpableUniformRandomProvider,
-                            originalSource.isJumpable());
-        Assert.assertEquals("isLongJumpable", rng instanceof LongJumpableUniformRandomProvider,
-                            originalSource.isLongJumpable());
+        Assertions.assertEquals(rng instanceof JumpableUniformRandomProvider,
+                                originalSource.isJumpable(),
+                                "isJumpable");
+        Assertions.assertEquals(rng instanceof LongJumpableUniformRandomProvider,
+                                originalSource.isLongJumpable(),
+                                "isLongJumpable");
     }
 
     ///// Support methods below.
@@ -422,7 +424,7 @@ public class ProvidersCommonParametricTest {
                 Arrays.fill(observed, 0);
                 for (int j = 0; j < sampleSize; j++) {
                     final long value = nextMethod.call().longValue();
-                    Assert.assertTrue("Range", value >= 0 && value < n);
+                    Assertions.assertTrue(value >= 0 && value < n, "Range");
 
                     for (int k = 0; k < numBins; k++) {
                         if (value < binUpperBounds[k]) {
@@ -458,7 +460,7 @@ public class ProvidersCommonParametricTest {
         // 12    0.00190
 
         if (numFailures > 11) { // Test will fail with 0.5% probability
-            Assert.fail(generator + ": Too many failures for n = " + n +
+            Assertions.fail(generator + ": Too many failures for n = " + n +
                         " (" + numFailures + " out of " + numTests + " tests failed)");
         }
     }
diff --git a/commons-rng-simple/src/test/java/org/apache/commons/rng/simple/RandomAssert.java b/commons-rng-simple/src/test/java/org/apache/commons/rng/simple/RandomAssert.java
index e38f6b0..d295528 100644
--- a/commons-rng-simple/src/test/java/org/apache/commons/rng/simple/RandomAssert.java
+++ b/commons-rng-simple/src/test/java/org/apache/commons/rng/simple/RandomAssert.java
@@ -17,7 +17,7 @@
 
 package org.apache.commons.rng.simple;
 
-import org.junit.Assert;
+import org.junit.jupiter.api.Assertions;
 
 import org.apache.commons.rng.UniformRandomProvider;
 
@@ -40,31 +40,31 @@ public final class RandomAssert {
     public static void assertProduceSameSequence(UniformRandomProvider rng1,
                                                  UniformRandomProvider rng2) {
         for (int i = 0; i < 54; i++) {
-            Assert.assertEquals(rng1.nextBoolean(), rng2.nextBoolean());
+            Assertions.assertEquals(rng1.nextBoolean(), rng2.nextBoolean());
         }
         for (int i = 0; i < 23; i++) {
-            Assert.assertEquals(rng1.nextInt(), rng2.nextInt());
+            Assertions.assertEquals(rng1.nextInt(), rng2.nextInt());
         }
         for (int i = 0; i < 4; i++) {
             for (int j = 0; j < 5; j++) {
                 final int max = 107 * i + 374 * j + 11;
-                Assert.assertEquals(rng1.nextInt(max), rng2.nextInt(max));
+                Assertions.assertEquals(rng1.nextInt(max), rng2.nextInt(max));
             }
         }
         for (int i = 0; i < 23; i++) {
-            Assert.assertEquals(rng1.nextLong(), rng2.nextLong());
+            Assertions.assertEquals(rng1.nextLong(), rng2.nextLong());
         }
         for (int i = 0; i < 4; i++) {
             for (int j = 0; j < 5; j++) {
                 final long max = (Long.MAX_VALUE << 2) + 107 * i + 374 * j + 11;
-                Assert.assertEquals(rng1.nextLong(max), rng2.nextLong(max));
+                Assertions.assertEquals(rng1.nextLong(max), rng2.nextLong(max));
             }
         }
         for (int i = 0; i < 103; i++) {
-            Assert.assertEquals(rng1.nextFloat(), rng2.nextFloat(), 0);
+            Assertions.assertEquals(rng1.nextFloat(), rng2.nextFloat());
         }
         for (int i = 0; i < 79; i++) {
-            Assert.assertEquals(rng1.nextDouble(), rng2.nextDouble(), 0);
+            Assertions.assertEquals(rng1.nextDouble(), rng2.nextDouble());
         }
 
         final int size = 345;
@@ -74,7 +74,7 @@ public final class RandomAssert {
         for (int i = 0; i < 3; i++) {
             rng1.nextBytes(a1);
             rng2.nextBytes(a2);
-            Assert.assertArrayEquals(a1, a2);
+            Assertions.assertArrayEquals(a1, a2);
         }
 
         for (int i = 0; i < 5; i++) {
@@ -82,7 +82,7 @@ public final class RandomAssert {
             final int n = 23 + i;
             rng1.nextBytes(a1, offset, n);
             rng2.nextBytes(a2, offset, n);
-            Assert.assertArrayEquals(a1, a2);
+            Assertions.assertArrayEquals(a1, a2);
         }
     }
 }
diff --git a/commons-rng-simple/src/test/java/org/apache/commons/rng/simple/RandomSourceTest.java b/commons-rng-simple/src/test/java/org/apache/commons/rng/simple/RandomSourceTest.java
index 5739246..b4e983c 100644
--- a/commons-rng-simple/src/test/java/org/apache/commons/rng/simple/RandomSourceTest.java
+++ b/commons-rng-simple/src/test/java/org/apache/commons/rng/simple/RandomSourceTest.java
@@ -16,7 +16,7 @@
  */
 package org.apache.commons.rng.simple;
 
-import org.junit.Assert;
+import org.junit.jupiter.api.Assertions;
 import org.junit.Test;
 
 /**
@@ -28,8 +28,8 @@ public class RandomSourceTest {
         final int n = 4;
         for (int i = 0; i < n; i++) {
             // Can fail, but unlikely given the range.
-            Assert.assertNotEquals(RandomSource.createInt(),
-                                   RandomSource.createInt());
+            Assertions.assertNotEquals(RandomSource.createInt(),
+                                       RandomSource.createInt());
         }
     }
 
@@ -38,8 +38,8 @@ public class RandomSourceTest {
         final int n = 6;
         for (int i = 0; i < n; i++) {
             // Can fail, but unlikely given the range.
-            Assert.assertNotEquals(RandomSource.createLong(),
-                                   RandomSource.createLong());
+            Assertions.assertNotEquals(RandomSource.createLong(),
+                                       RandomSource.createLong());
         }
     }
 
@@ -47,11 +47,11 @@ public class RandomSourceTest {
     public void testCreateIntArray() {
         final int n = 13;
         final int[] seed = RandomSource.createIntArray(n);
-        Assert.assertEquals(n, seed.length);
+        Assertions.assertEquals(n, seed.length);
 
         for (int i = 1; i < n; i++) {
             // Can fail, but unlikely given the range.
-            Assert.assertNotEquals(seed[i - 1], seed[i]);
+            Assertions.assertNotEquals(seed[i - 1], seed[i]);
         }
     }
 
@@ -59,25 +59,25 @@ public class RandomSourceTest {
     public void testCreateLongArray() {
         final int n = 9;
         final long[] seed = RandomSource.createLongArray(n);
-        Assert.assertEquals(n, seed.length);
+        Assertions.assertEquals(n, seed.length);
 
         for (int i = 1; i < n; i++) {
             // Can fail, but unlikely given the range.
-            Assert.assertNotEquals(seed[i - 1], seed[i]);
+            Assertions.assertNotEquals(seed[i - 1], seed[i]);
         }
     }
 
     @Test
     public void testIsJumpable() {
-        Assert.assertFalse("JDK is not Jumpable", RandomSource.JDK.isJumpable());
-        Assert.assertTrue("XOR_SHIFT_1024_S_PHI is Jumpable", RandomSource.XOR_SHIFT_1024_S_PHI.isJumpable());
-        Assert.assertTrue("XO_SHI_RO_256_SS is Jumpable", RandomSource.XO_SHI_RO_256_SS.isJumpable());
+        Assertions.assertFalse(RandomSource.JDK.isJumpable(), "JDK is not Jumpable");
+        Assertions.assertTrue(RandomSource.XOR_SHIFT_1024_S_PHI.isJumpable(), "XOR_SHIFT_1024_S_PHI is Jumpable");
+        Assertions.assertTrue(RandomSource.XO_SHI_RO_256_SS.isJumpable(), "XO_SHI_RO_256_SS is Jumpable");
     }
 
     @Test
     public void testIsLongJumpable() {
-        Assert.assertFalse("JDK is not LongJumpable", RandomSource.JDK.isLongJumpable());
-        Assert.assertFalse("XOR_SHIFT_1024_S_PHI is not LongJumpable", RandomSource.XOR_SHIFT_1024_S_PHI.isLongJumpable());
-        Assert.assertTrue("XO_SHI_RO_256_SS is LongJumpable", RandomSource.XO_SHI_RO_256_SS.isLongJumpable());
+        Assertions.assertFalse(RandomSource.JDK.isLongJumpable(), "JDK is not LongJumpable");
+        Assertions.assertFalse(RandomSource.XOR_SHIFT_1024_S_PHI.isLongJumpable(), "XOR_SHIFT_1024_S_PHI is not LongJumpable");
+        Assertions.assertTrue(RandomSource.XO_SHI_RO_256_SS.isLongJumpable(), "XO_SHI_RO_256_SS is LongJumpable");
     }
 }
diff --git a/commons-rng-simple/src/test/java/org/apache/commons/rng/simple/ThreadLocalRandomSourceTest.java b/commons-rng-simple/src/test/java/org/apache/commons/rng/simple/ThreadLocalRandomSourceTest.java
index eefabac..613fc6c 100644
--- a/commons-rng-simple/src/test/java/org/apache/commons/rng/simple/ThreadLocalRandomSourceTest.java
+++ b/commons-rng-simple/src/test/java/org/apache/commons/rng/simple/ThreadLocalRandomSourceTest.java
@@ -17,7 +17,7 @@
 package org.apache.commons.rng.simple;
 
 import org.apache.commons.rng.UniformRandomProvider;
-import org.junit.Assert;
+import org.junit.jupiter.api.Assertions;
 import org.junit.BeforeClass;
 import org.junit.Test;
 
@@ -61,19 +61,21 @@ public class ThreadLocalRandomSourceTest {
         final UniformRandomProvider[] rngs = new UniformRandomProvider[sources.length];
 
         for (int i = 0; i < sources.length; i++) {
-            if (toIgnore.contains(sources[i])) {
+            final RandomSource source = sources[i];
+            if (toIgnore.contains(source)) {
                 continue;
             }
-            final UniformRandomProvider rng = getCurrent(sources[i]);
-            Assert.assertNotNull("Failed to create source: " + sources[i], rng);
+            final UniformRandomProvider rng = getCurrent(source);
+            Assertions.assertNotNull(rng, () -> "Failed to create source: " + source);
             rngs[i] = rng;
         }
         for (int i = 0; i < sources.length; i++) {
-            if (toIgnore.contains(sources[i])) {
+            final RandomSource source = sources[i];
+            if (toIgnore.contains(source)) {
                 continue;
             }
-            final UniformRandomProvider rng = getCurrent(sources[i]);
-            Assert.assertSame("Failed to return same source: " + sources[i], rngs[i], rng);
+            final UniformRandomProvider rng = getCurrent(source);
+            Assertions.assertSame(rngs[i], rng, () -> "Failed to return same source: " + source);
         }
 
         // Build on a new thread
@@ -98,10 +100,11 @@ public class ThreadLocalRandomSourceTest {
 
         // The RNG from the new thread should be different
         for (int i = 0; i < sources.length; i++) {
-            if (toIgnore.contains(sources[i])) {
+            final RandomSource source = sources[i];
+            if (toIgnore.contains(source)) {
                 continue;
             }
-            Assert.assertNotSame("Failed to return different source: " + sources[i], rngs[i], rngs2[i]);
+            Assertions.assertNotSame(rngs[i], rngs2[i], () -> "Failed to return different source: " + source);
         }
     }
 
diff --git a/commons-rng-simple/src/test/java/org/apache/commons/rng/simple/internal/ByteArray2IntArrayTest.java b/commons-rng-simple/src/test/java/org/apache/commons/rng/simple/internal/ByteArray2IntArrayTest.java
index dddc7a4..b3980d8 100644
--- a/commons-rng-simple/src/test/java/org/apache/commons/rng/simple/internal/ByteArray2IntArrayTest.java
+++ b/commons-rng-simple/src/test/java/org/apache/commons/rng/simple/internal/ByteArray2IntArrayTest.java
@@ -16,7 +16,7 @@
  */
 package org.apache.commons.rng.simple.internal;
 
-import org.junit.Assert;
+import org.junit.jupiter.api.Assertions;
 import org.junit.Test;
 
 /**
@@ -27,7 +27,7 @@ public class ByteArray2IntArrayTest {
     public void testSeedSizeIsMultipleOfIntSize() {
         final byte[] seed = new byte[128];
         final int[] out = new ByteArray2IntArray().convert(seed);
-        Assert.assertEquals(32, out.length);
+        Assertions.assertEquals(32, out.length);
     }
 
     @Test
@@ -37,7 +37,7 @@ public class ByteArray2IntArrayTest {
         for (int i = 1; i < 4; i++) {
             final byte[] seed = new byte[len + i];
             final int[] out = conv.convert(seed);
-            Assert.assertEquals(5, out.length);
+            Assertions.assertEquals(5, out.length);
         }
     }
 }
diff --git a/commons-rng-simple/src/test/java/org/apache/commons/rng/simple/internal/ByteArray2LongArrayTest.java b/commons-rng-simple/src/test/java/org/apache/commons/rng/simple/internal/ByteArray2LongArrayTest.java
index 1c9a424..a681738 100644
--- a/commons-rng-simple/src/test/java/org/apache/commons/rng/simple/internal/ByteArray2LongArrayTest.java
+++ b/commons-rng-simple/src/test/java/org/apache/commons/rng/simple/internal/ByteArray2LongArrayTest.java
@@ -16,7 +16,7 @@
  */
 package org.apache.commons.rng.simple.internal;
 
-import org.junit.Assert;
+import org.junit.jupiter.api.Assertions;
 import org.junit.Test;
 
 /**
@@ -27,7 +27,7 @@ public class ByteArray2LongArrayTest {
     public void testSeedSizeIsMultipleOfLongSize() {
         final byte[] seed = new byte[128];
         final long[] out = new ByteArray2LongArray().convert(seed);
-        Assert.assertEquals(16, out.length);
+        Assertions.assertEquals(16, out.length);
     }
 
     @Test
@@ -37,7 +37,7 @@ public class ByteArray2LongArrayTest {
         for (int i = 1; i < 8; i++) {
             final byte[] seed = new byte[len + i];
             final long[] out = conv.convert(seed);
-            Assert.assertEquals(3, out.length);
+            Assertions.assertEquals(3, out.length);
         }
     }
 }
diff --git a/commons-rng-simple/src/test/java/org/apache/commons/rng/simple/internal/IntArray2LongArrayTest.java b/commons-rng-simple/src/test/java/org/apache/commons/rng/simple/internal/IntArray2LongArrayTest.java
index e665ca2..4a276dd 100644
--- a/commons-rng-simple/src/test/java/org/apache/commons/rng/simple/internal/IntArray2LongArrayTest.java
+++ b/commons-rng-simple/src/test/java/org/apache/commons/rng/simple/internal/IntArray2LongArrayTest.java
@@ -16,7 +16,7 @@
  */
 package org.apache.commons.rng.simple.internal;
 
-import org.junit.Assert;
+import org.junit.jupiter.api.Assertions;
 import org.junit.Test;
 
 /**
@@ -27,13 +27,13 @@ public class IntArray2LongArrayTest {
     public void testSeedSizeIsMultipleOfLongSize() {
         final int[] seed = new int[12];
         final long[] out = new IntArray2LongArray().convert(seed);
-        Assert.assertEquals(6, out.length);
+        Assertions.assertEquals(6, out.length);
     }
 
     @Test
     public void testSeedSizeIsNotMultipleOfLongSize() {
         final int[] seed = new int[13];
         final long[] out = new IntArray2LongArray().convert(seed);
-        Assert.assertEquals(7, out.length);
+        Assertions.assertEquals(7, out.length);
     }
 }
diff --git a/commons-rng-simple/src/test/java/org/apache/commons/rng/simple/internal/Long2IntArrayTest.java b/commons-rng-simple/src/test/java/org/apache/commons/rng/simple/internal/Long2IntArrayTest.java
index 97c915a..7a2d04d 100644
--- a/commons-rng-simple/src/test/java/org/apache/commons/rng/simple/internal/Long2IntArrayTest.java
+++ b/commons-rng-simple/src/test/java/org/apache/commons/rng/simple/internal/Long2IntArrayTest.java
@@ -16,7 +16,7 @@
  */
 package org.apache.commons.rng.simple.internal;
 
-import org.junit.Assert;
+import org.junit.jupiter.api.Assertions;
 import org.junit.Test;
 
 /**
@@ -33,11 +33,11 @@ public class Long2IntArrayTest {
     private static void testFixedLengthConversion(int length) {
         final Long seed = 567L;
         final int[] out = new Long2IntArray(length).convert(seed);
-        Assert.assertEquals(length, out.length);
+        Assertions.assertEquals(length, out.length);
         // This very seed dependent but the algorithm
         // should only produce 0 about 1 in 2^32 times.
         for (int i = 0; i < length; i++) {
-            Assert.assertNotEquals(0, out[i]);
+            Assertions.assertNotEquals(0, out[i]);
         }
     }
 }
diff --git a/commons-rng-simple/src/test/java/org/apache/commons/rng/simple/internal/Long2LongArrayTest.java b/commons-rng-simple/src/test/java/org/apache/commons/rng/simple/internal/Long2LongArrayTest.java
index 36d3960..d0efaef 100644
--- a/commons-rng-simple/src/test/java/org/apache/commons/rng/simple/internal/Long2LongArrayTest.java
+++ b/commons-rng-simple/src/test/java/org/apache/commons/rng/simple/internal/Long2LongArrayTest.java
@@ -16,7 +16,7 @@
  */
 package org.apache.commons.rng.simple.internal;
 
-import org.junit.Assert;
+import org.junit.jupiter.api.Assertions;
 import org.junit.Test;
 
 /**
@@ -28,6 +28,6 @@ public class Long2LongArrayTest {
         final Long seed = 567L;
         final int length = 3;
         final long[] out = new Long2LongArray(length).convert(seed);
-        Assert.assertEquals(length, out.length);
+        Assertions.assertEquals(length, out.length);
     }
 }
diff --git a/commons-rng-simple/src/test/java/org/apache/commons/rng/simple/internal/NativeSeedTypeParametricTest.java b/commons-rng-simple/src/test/java/org/apache/commons/rng/simple/internal/NativeSeedTypeParametricTest.java
index 3913341..8469047 100644
--- a/commons-rng-simple/src/test/java/org/apache/commons/rng/simple/internal/NativeSeedTypeParametricTest.java
+++ b/commons-rng-simple/src/test/java/org/apache/commons/rng/simple/internal/NativeSeedTypeParametricTest.java
@@ -16,13 +16,14 @@
  */
 package org.apache.commons.rng.simple.internal;
 
-import org.junit.Assert;
+import org.junit.jupiter.api.Assertions;
 import org.junit.Test;
 import org.junit.runner.RunWith;
 import org.junit.runners.Parameterized;
 import org.junit.runners.Parameterized.Parameters;
 
 import java.lang.reflect.Array;
+import java.util.function.Supplier;
 
 /**
  * Tests for the {@link NativeSeedType} seed conversions. This test
@@ -76,8 +77,8 @@ public class NativeSeedTypeParametricTest {
     public static Object[] getTypes() {
         // Check that there are enum values for all supported types.
         // This ensures the test is maintained to correspond to the enum.
-        Assert.assertEquals("Incorrect number of enum values for the supported native types",
-            SUPPORTED_NATIVE_TYPES.length, NativeSeedType.values().length);
+        Assertions.assertEquals(SUPPORTED_NATIVE_TYPES.length, NativeSeedType.values().length,
+            "Incorrect number of enum values for the supported native types");
 
         return SUPPORTED_NATIVE_TYPES;
     }
@@ -104,10 +105,10 @@ public class NativeSeedTypeParametricTest {
     public void testCreateSeed() {
         final int size = 3;
         final Object seed = nativeSeedType.createSeed(size);
-        Assert.assertNotNull(seed);
-        Assert.assertEquals("Seed was not the correct class", type, seed.getClass());
+        Assertions.assertNotNull(seed);
+        Assertions.assertEquals(type, seed.getClass(), "Seed was not the correct class");
         if (type.isArray()) {
-            Assert.assertEquals("Seed was not created the correct length", size, Array.getLength(seed));
+            Assertions.assertEquals(size, Array.getLength(seed), "Seed was not created the correct length");
         }
     }
 
@@ -118,18 +119,18 @@ public class NativeSeedTypeParametricTest {
     public void testConvertSeedToBytes() {
         final int size = 3;
         final Object seed = nativeSeedType.createSeed(size);
-        Assert.assertNotNull("Null seed", seed);
+        Assertions.assertNotNull(seed, "Null seed");
 
         final byte[] bytes = NativeSeedType.convertSeedToBytes(seed);
-        Assert.assertNotNull("Null byte[] seed", bytes);
+        Assertions.assertNotNull(bytes, "Null byte[] seed");
 
         final Object seed2 = nativeSeedType.convertSeed(bytes, size);
         if (type.isArray()) {
             // This handles nested primitive arrays
-            Assert.assertArrayEquals("byte[] seed was not converted back",
-                                     new Object[] {seed}, new Object[] {seed2});
+            Assertions.assertArrayEquals(new Object[] {seed}, new Object[] {seed2},
+                "byte[] seed was not converted back");
         } else {
-            Assert.assertEquals("byte[] seed was not converted back", seed, seed2);
+            Assertions.assertEquals(seed, seed2, "byte[] seed was not converted back");
         }
     }
 
@@ -142,9 +143,9 @@ public class NativeSeedTypeParametricTest {
         final int size = 3;
         for (final Object input : SUPPORTED_SEEDS) {
             final Object seed = nativeSeedType.convertSeed(input, size);
-            final String msg = input.getClass() + " input seed was not converted";
-            Assert.assertNotNull(msg, seed);
-            Assert.assertEquals(msg, type, seed.getClass());
+            final Supplier<String> msg = () -> input.getClass() + " input seed was not converted";
+            Assertions.assertNotNull(seed, msg);
+            Assertions.assertEquals(type, seed.getClass(), msg);
         }
     }
 
@@ -157,7 +158,7 @@ public class NativeSeedTypeParametricTest {
         for (final Object input : UNSUPPORTED_SEEDS) {
             try {
                 nativeSeedType.convertSeed(input, size);
-                Assert.fail(input.getClass() + " input seed was not rejected as unsupported");
+                Assertions.fail(input.getClass() + " input seed was not rejected as unsupported");
             } catch (UnsupportedOperationException ex) {
                 // This is expected
             }
diff --git a/commons-rng-simple/src/test/java/org/apache/commons/rng/simple/internal/NativeSeedTypeTest.java b/commons-rng-simple/src/test/java/org/apache/commons/rng/simple/internal/NativeSeedTypeTest.java
index be699ae..e325d39 100644
--- a/commons-rng-simple/src/test/java/org/apache/commons/rng/simple/internal/NativeSeedTypeTest.java
+++ b/commons-rng-simple/src/test/java/org/apache/commons/rng/simple/internal/NativeSeedTypeTest.java
@@ -16,7 +16,7 @@
  */
 package org.apache.commons.rng.simple.internal;
 
-import org.junit.Assert;
+import org.junit.jupiter.api.Assertions;
 import org.junit.Test;
 
 /**
@@ -39,6 +39,6 @@ public class NativeSeedTypeTest {
     @Test
     public void testConvertSeedToBytesUsingByteArray() {
         final byte[] seed = {42, 78, 99};
-        Assert.assertSame(seed, NativeSeedType.convertSeedToBytes(seed));
+        Assertions.assertSame(seed, NativeSeedType.convertSeedToBytes(seed));
     }
 }
diff --git a/commons-rng-simple/src/test/java/org/apache/commons/rng/simple/internal/NoOpConverterTest.java b/commons-rng-simple/src/test/java/org/apache/commons/rng/simple/internal/NoOpConverterTest.java
index 759f004..db4e270 100644
--- a/commons-rng-simple/src/test/java/org/apache/commons/rng/simple/internal/NoOpConverterTest.java
+++ b/commons-rng-simple/src/test/java/org/apache/commons/rng/simple/internal/NoOpConverterTest.java
@@ -16,7 +16,7 @@
  */
 package org.apache.commons.rng.simple.internal;
 
-import org.junit.Assert;
+import org.junit.jupiter.api.Assertions;
 import org.junit.Test;
 
 /**
@@ -27,13 +27,13 @@ public class NoOpConverterTest {
     public void testNoOpIntegerCoversion() {
         final NoOpConverter<Integer> converter = new NoOpConverter<Integer>();
         final Integer in = 123;
-        Assert.assertSame(in, converter.convert(in));
+        Assertions.assertSame(in, converter.convert(in));
     }
 
     @Test
     public void testNoOpLongArrayCoversion() {
         final NoOpConverter<long[]> converter = new NoOpConverter<long[]>();
         final long[] in = {123L, 456L, Long.MAX_VALUE};
-        Assert.assertSame(in, converter.convert(in));
+        Assertions.assertSame(in, converter.convert(in));
     }
 }
diff --git a/commons-rng-simple/src/test/java/org/apache/commons/rng/simple/internal/RandomSourceInternalParametricTest.java b/commons-rng-simple/src/test/java/org/apache/commons/rng/simple/internal/RandomSourceInternalParametricTest.java
index 4c8f118..5948223 100644
--- a/commons-rng-simple/src/test/java/org/apache/commons/rng/simple/internal/RandomSourceInternalParametricTest.java
+++ b/commons-rng-simple/src/test/java/org/apache/commons/rng/simple/internal/RandomSourceInternalParametricTest.java
@@ -18,13 +18,14 @@ package org.apache.commons.rng.simple.internal;
 
 import org.apache.commons.rng.core.source64.SplitMix64;
 import org.apache.commons.rng.simple.internal.ProviderBuilder.RandomSourceInternal;
-import org.junit.Assert;
+import org.junit.jupiter.api.Assertions;
 import org.junit.Test;
 import org.junit.runner.RunWith;
 import org.junit.runners.Parameterized;
 import org.junit.runners.Parameterized.Parameters;
 
 import java.util.EnumMap;
+import java.util.function.Supplier;
 
 /**
  * Tests for the {@link ProviderBuilder.RandomSourceInternal} seed conversions. This test
@@ -136,9 +137,9 @@ public class RandomSourceInternalParametricTest {
     @Test
     public void testCreateSeed() {
         final Object seed = randomSourceInternal.createSeed();
-        Assert.assertNotNull(seed);
-        Assert.assertEquals("Seed was not the correct class", type, seed.getClass());
-        Assert.assertTrue("Seed was not identified as the native type", randomSourceInternal.isNativeSeed(seed));
+        Assertions.assertNotNull(seed);
+        Assertions.assertEquals(type, seed.getClass(), "Seed was not the correct class");
+        Assertions.assertTrue(randomSourceInternal.isNativeSeed(seed), "Seed was not identified as the native type");
     }
 
     /**
@@ -148,10 +149,10 @@ public class RandomSourceInternalParametricTest {
     public void testConvertSupportedSeed() {
         for (final Object input : SUPPORTED_SEEDS) {
             final Object seed = randomSourceInternal.convertSeed(input);
-            final String msg = input.getClass() + " input seed was not converted";
-            Assert.assertNotNull(msg, seed);
-            Assert.assertEquals(msg, type, seed.getClass());
-            Assert.assertTrue(msg, randomSourceInternal.isNativeSeed(seed));
+            final Supplier<String> msg = () -> input.getClass() + " input seed was not converted";
+            Assertions.assertNotNull(seed, msg);
+            Assertions.assertEquals(type, seed.getClass(), msg);
+            Assertions.assertTrue(randomSourceInternal.isNativeSeed(seed), msg);
         }
     }
 
@@ -163,7 +164,7 @@ public class RandomSourceInternalParametricTest {
         for (final Object input : UNSUPPORTED_SEEDS) {
             try {
                 randomSourceInternal.convertSeed(input);
-                Assert.fail(input.getClass() + " input seed was not rejected as unsupported");
+                Assertions.fail(input.getClass() + " input seed was not rejected as unsupported");
             } catch (UnsupportedOperationException ex) {
                 // This is expected
             }
@@ -180,18 +181,18 @@ public class RandomSourceInternalParametricTest {
         final byte[] seed = randomSourceInternal.createSeedBytes(new SplitMix64(12345L));
 
         final int size = seed.length;
-        Assert.assertNotEquals("Seed is empty", 0, size);
+        Assertions.assertNotEquals(0, size, "Seed is empty");
 
         if (randomSourceInternal.isNativeSeed(Integer.valueOf(0))) {
-            Assert.assertEquals("Expect 4 bytes for Integer", 4, size);
+            Assertions.assertEquals(4, size, "Expect 4 bytes for Integer");
         } else if (randomSourceInternal.isNativeSeed(Long.valueOf(0))) {
-            Assert.assertEquals("Expect 8 bytes for Long", 8, size);
+            Assertions.assertEquals(8, size, "Expect 8 bytes for Long");
         } else if (randomSourceInternal.isNativeSeed(new int[0])) {
-            Assert.assertEquals("Expect 4n bytes for int[]", 0, size % 4);
+            Assertions.assertEquals(0, size % 4, "Expect 4n bytes for int[]");
         } else if (randomSourceInternal.isNativeSeed(new long[0])) {
-            Assert.assertEquals("Expect 8n bytes for long[]", 0, size % 8);
+            Assertions.assertEquals(0, size % 8, "Expect 8n bytes for long[]");
         } else {
-            Assert.fail("Unknown native seed type");
+            Assertions.fail("Unknown native seed type");
         }
     }
 
@@ -210,8 +211,7 @@ public class RandomSourceInternalParametricTest {
         final int size = seed.length;
 
         final Integer expected = EXPECTED_SEED_BYTES.get(randomSourceInternal);
-        Assert.assertNotNull("Missing expected seed byte size: " + randomSourceInternal, expected);
-        Assert.assertEquals(randomSourceInternal.toString(),
-                            expected.intValue(), size);
+        Assertions.assertNotNull(expected, () -> "Missing expected seed byte size: " + randomSourceInternal);
+        Assertions.assertEquals(expected.intValue(), size, () -> randomSourceInternal.toString());
     }
 }
diff --git a/commons-rng-simple/src/test/java/org/apache/commons/rng/simple/internal/SeedConverterComposerTest.java b/commons-rng-simple/src/test/java/org/apache/commons/rng/simple/internal/SeedConverterComposerTest.java
index 3554dba..ea3a838 100644
--- a/commons-rng-simple/src/test/java/org/apache/commons/rng/simple/internal/SeedConverterComposerTest.java
+++ b/commons-rng-simple/src/test/java/org/apache/commons/rng/simple/internal/SeedConverterComposerTest.java
@@ -16,7 +16,7 @@
  */
 package org.apache.commons.rng.simple.internal;
 
-import org.junit.Assert;
+import org.junit.jupiter.api.Assertions;
 import org.junit.Test;
 
 /**
@@ -31,7 +31,7 @@ public class SeedConverterComposerTest {
                 new SeedConverterComposer<Integer, Long, long[]>(int2Long, long2LongArray);
         final Integer in = 123;
         final Object out = composer.convert(in);
-        Assert.assertTrue("Bad type conversion", out instanceof long[]);
-        Assert.assertEquals("Incorrect long[] length", 3, ((long[])out).length);
+        Assertions.assertTrue(out instanceof long[], "Bad type conversion");
+        Assertions.assertEquals(3, ((long[])out).length, "Incorrect long[] length");
     }
 }
diff --git a/commons-rng-simple/src/test/java/org/apache/commons/rng/simple/internal/SeedFactoryTest.java b/commons-rng-simple/src/test/java/org/apache/commons/rng/simple/internal/SeedFactoryTest.java
index b936d81..ab6fe36 100644
--- a/commons-rng-simple/src/test/java/org/apache/commons/rng/simple/internal/SeedFactoryTest.java
+++ b/commons-rng-simple/src/test/java/org/apache/commons/rng/simple/internal/SeedFactoryTest.java
@@ -18,7 +18,7 @@ package org.apache.commons.rng.simple.internal;
 
 import java.util.Map;
 import java.util.HashMap;
-import org.junit.Assert;
+import org.junit.jupiter.api.Assertions;
 import org.junit.Test;
 import org.apache.commons.rng.UniformRandomProvider;
 import org.apache.commons.rng.core.source32.IntProvider;
@@ -54,7 +54,7 @@ public class SeedFactoryTest {
 
         final int n = 100000;
         final long[] array = SeedFactory.createLongArray(n);
-        Assert.assertEquals(n, array.length);
+        Assertions.assertEquals(n, array.length);
 
         for (long v : array) {
             Integer count = values.get(v);
@@ -109,7 +109,7 @@ public class SeedFactoryTest {
         }
 
         if (duplicates > 0) {
-            Assert.fail(duplicates + " duplicates\n" + sb);
+            Assertions.fail(duplicates + " duplicates\n" + sb);
         }
     }
 
@@ -134,7 +134,7 @@ public class SeedFactoryTest {
      */
     private static void assertCreateIntArray(int n) {
         final int[] array = SeedFactory.createIntArray(n);
-        Assert.assertEquals("Incorrect array length", n, array.length);
+        Assertions.assertEquals(n, array.length, "Incorrect array length");
         // The bit count should be 50%.
         int bitCount = 0;
         for (final int i : array) {
@@ -165,7 +165,7 @@ public class SeedFactoryTest {
      */
     private static void assertCreateLongArray(int n) {
         final long[] array = SeedFactory.createLongArray(n);
-        Assert.assertEquals("Incorrect array length", n, array.length);
+        Assertions.assertEquals(n, array.length, "Incorrect array length");
         // The bit count should be 50%.
         int bitCount = 0;
         for (final long i : array) {
@@ -201,10 +201,10 @@ public class SeedFactoryTest {
         // (Re-runs are not configured for this test.)
         final double absSum = Math.abs(sum);
         final double max = Math.sqrt(numberOfBits) * 3.891;
-        Assert.assertTrue("Walked too far astray: " + absSum +
-                          " > " + max +
-                          " (test will fail randomly about 1 in 10,000 times)",
-                          absSum <= max);
+        Assertions.assertTrue(absSum <= max,
+            () -> "Walked too far astray: " + absSum +
+                  " > " + max +
+                  " (test will fail randomly about 1 in 10,000 times)");
     }
 
     @Test
@@ -233,7 +233,7 @@ public class SeedFactoryTest {
         final UniformRandomProvider rng = new IntProvider() {
             @Override
             public int next() {
-                Assert.fail("This method should not be used");
+                Assertions.fail("This method should not be used");
                 return 0;
             }
 
@@ -244,7 +244,7 @@ public class SeedFactoryTest {
         };
 
         final byte[] seed = SeedFactory.createByteArray(rng, expected.length);
-        Assert.assertArrayEquals(expected, seed);
+        Assertions.assertArrayEquals(expected, seed);
     }
 
     @Test
@@ -258,9 +258,9 @@ public class SeedFactoryTest {
         };
         // Test the method only replaces position 0
         final byte[] seed = SeedFactory.createByteArray(rng, 4);
-        Assert.assertNotEquals("Zero at position 0 should be modified", 0, seed[0]);
+        Assertions.assertNotEquals(0, seed[0], "Zero at position 0 should be modified");
         for (int i = 1; i < seed.length; i++) {
-            Assert.assertEquals("Position above 0 should be unmodified", 0, seed[i]);
+            Assertions.assertEquals(0, seed[i], "Position above 0 should be unmodified");
         }
     }
 
@@ -278,9 +278,9 @@ public class SeedFactoryTest {
         final int[] seed = new int[] {position0, 0, 0, 0};
         final int[] before = seed.clone();
         SeedFactory.ensureNonZero(seed);
-        Assert.assertEquals("Non-zero at position 0 should be unmodified", position0, seed[0]);
+        Assertions.assertEquals(position0, seed[0], "Non-zero at position 0 should be unmodified");
         for (int i = 1; i < seed.length; i++) {
-            Assert.assertEquals("Position above 0 should be unmodified", before[i], seed[i]);
+            Assertions.assertEquals(before[i], seed[i], "Position above 0 should be unmodified");
         }
     }
 
@@ -290,9 +290,9 @@ public class SeedFactoryTest {
         final int[] seed = new int[] {0, 123, 456, 789};
         final int[] before = seed.clone();
         SeedFactory.ensureNonZero(seed);
-        Assert.assertNotEquals("Zero at position 0 should be modified", 0, seed[0]);
+        Assertions.assertNotEquals(0, seed[0], "Zero at position 0 should be modified");
         for (int i = 1; i < seed.length; i++) {
-            Assert.assertEquals("Position above 0 should be unmodified", before[i], seed[i]);
+            Assertions.assertEquals(before[i], seed[i], "Position above 0 should be unmodified");
         }
     }
 
@@ -310,9 +310,9 @@ public class SeedFactoryTest {
         final long[] seed = new long[] {position0, 0, 0, 0};
         final long[] before = seed.clone();
         SeedFactory.ensureNonZero(seed);
-        Assert.assertEquals("Non-zero at position 0 should be unmodified", position0, seed[0]);
+        Assertions.assertEquals(position0, seed[0], "Non-zero at position 0 should be unmodified");
         for (int i = 1; i < seed.length; i++) {
-            Assert.assertEquals("Position above 0 should be unmodified", before[i], seed[i]);
+            Assertions.assertEquals(before[i], seed[i], "Position above 0 should be unmodified");
         }
     }
 
@@ -322,9 +322,9 @@ public class SeedFactoryTest {
         final long[] seed = new long[] {0, 123, 456, 789};
         final long[] before = seed.clone();
         SeedFactory.ensureNonZero(seed);
-        Assert.assertNotEquals("Zero at position 0 should be modified", 0, seed[0]);
+        Assertions.assertNotEquals(0, seed[0], "Zero at position 0 should be modified");
         for (int i = 1; i < seed.length; i++) {
-            Assert.assertEquals("Position above 0 should be unmodified", before[i], seed[i]);
+            Assertions.assertEquals(before[i], seed[i], "Position above 0 should be unmodified");
         }
     }
 
@@ -337,11 +337,11 @@ public class SeedFactoryTest {
                 return expected;
             }
         };
-        Assert.assertEquals("Zero should be replaced using the random source",
-                expected, SeedFactory.ensureNonZero(source, 0));
+        Assertions.assertEquals(expected, SeedFactory.ensureNonZero(source, 0),
+            "Zero should be replaced using the random source");
         for (final long nonZero : new long[] {Long.MIN_VALUE, -1, 1, 9876654321L, Long.MAX_VALUE}) {
-            Assert.assertEquals("Non-zero should be unmodified",
-                    nonZero, SeedFactory.ensureNonZero(source, nonZero));
+            Assertions.assertEquals(nonZero, SeedFactory.ensureNonZero(source, nonZero),
+                "Non-zero should be unmodified");
         }
     }
 }
diff --git a/commons-rng-simple/src/test/java/org/apache/commons/rng/simple/internal/SeedUtilsTest.java b/commons-rng-simple/src/test/java/org/apache/commons/rng/simple/internal/SeedUtilsTest.java
index 412cc8c..d14373e 100644
--- a/commons-rng-simple/src/test/java/org/apache/commons/rng/simple/internal/SeedUtilsTest.java
+++ b/commons-rng-simple/src/test/java/org/apache/commons/rng/simple/internal/SeedUtilsTest.java
@@ -20,7 +20,7 @@ package org.apache.commons.rng.simple.internal;
 import org.apache.commons.math3.stat.inference.ChiSquareTest;
 import org.apache.commons.rng.UniformRandomProvider;
 import org.apache.commons.rng.core.source64.SplitMix64;
-import org.junit.Assert;
+import org.junit.jupiter.api.Assertions;
 import org.junit.Test;
 
 import java.util.Arrays;
@@ -43,7 +43,7 @@ public class SeedUtilsTest {
             int observed = 0;
             for (int j = 0; j < 8; j++) {
                 final int digit = sample & 0xf;
-                Assert.assertEquals("Duplicate digit in sample", 0, observed & (1 << digit));
+                Assertions.assertEquals(0, observed & (1 << digit), "Duplicate digit in sample");
                 observed |= 1 << digit;
                 samples[j][digit]++;
                 sample >>>= 4;
@@ -55,8 +55,8 @@ public class SeedUtilsTest {
         Arrays.fill(expected, 1.0 / 16);
         // Pass if we cannot reject null hypothesis that distributions are the same.
         for (int j = 0; j < 8; j++) {
-            Assert.assertFalse("Not uniform in digit " + j,
-                    chiSquareTest.chiSquareTest(expected, samples[j], 0.001));
+            Assertions.assertFalse(chiSquareTest.chiSquareTest(expected, samples[j], 0.001),
+                "Not uniform in digit " + j);
         }
     }
 
@@ -76,7 +76,7 @@ public class SeedUtilsTest {
             long observed = 0;
             for (int j = 0; j < 8; j++) {
                 final int digit = (int) (sample & 0xfL);
-                Assert.assertEquals("Duplicate digit in lower sample", 0, observed & (1 << digit));
+                Assertions.assertEquals(0, observed & (1 << digit), "Duplicate digit in lower sample");
                 observed |= 1 << digit;
                 samples[j][digit]++;
                 sample >>>= 4;
@@ -85,7 +85,7 @@ public class SeedUtilsTest {
             observed = 0;
             for (int j = 8; j < 16; j++) {
                 final int digit = (int) (sample & 0xfL);
-                Assert.assertEquals("Duplicate digit in upper sample", 0, observed & (1 << digit));
+                Assertions.assertEquals(0, observed & (1 << digit), "Duplicate digit in upper sample");
                 observed |= 1 << digit;
                 samples[j][digit]++;
                 sample >>>= 4;
@@ -97,8 +97,8 @@ public class SeedUtilsTest {
         Arrays.fill(expected, 1.0 / 16);
         // Pass if we cannot reject null hypothesis that distributions are the same.
         for (int j = 0; j < 16; j++) {
-            Assert.assertFalse("Not uniform in digit " + j,
-                    chiSquareTest.chiSquareTest(expected, samples[j], 0.001));
+            Assertions.assertFalse(chiSquareTest.chiSquareTest(expected, samples[j], 0.001),
+                "Not uniform in digit " + j);
         }
     }
 }

[commons-rng] 06/13: RNG-163: Update JUnit 4 @Test to JUnit 5 @Test

Posted by ah...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

aherbert pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/commons-rng.git

commit c50b6781f076827c5542c818bb54d53d7a790c3b
Author: Alex Herbert <ah...@apache.org>
AuthorDate: Sun Aug 15 21:30:13 2021 +0100

    RNG-163: Update JUnit 4 @Test to JUnit 5 @Test
    
    Requires changing:
    
    - @BeforeClass to @BeforeAll
    - @Rule timeout to Assertions.assertTimeout
---
 .../org/apache/commons/rng/core/BaseProviderTest.java  |  2 +-
 .../rng/core/RandomProviderDefaultStateTest.java       |  2 +-
 .../source32/DotyHumphreySmallFastCounting32Test.java  |  2 +-
 .../commons/rng/core/source32/ISAACRandomTest.java     |  2 +-
 .../commons/rng/core/source32/IntProviderTest.java     |  2 +-
 .../commons/rng/core/source32/JDKRandomTest.java       |  2 +-
 .../rng/core/source32/JenkinsSmallFast32Test.java      |  2 +-
 .../commons/rng/core/source32/KISSRandomTest.java      |  2 +-
 .../commons/rng/core/source32/MersenneTwisterTest.java |  2 +-
 .../core/source32/MiddleSquareWeylSequenceTest.java    |  2 +-
 .../rng/core/source32/MultiplyWithCarry256Test.java    |  2 +-
 .../commons/rng/core/source32/PcgMcgXshRr32Test.java   |  2 +-
 .../commons/rng/core/source32/PcgMcgXshRs32Test.java   |  2 +-
 .../commons/rng/core/source32/PcgXshRr32Test.java      |  2 +-
 .../commons/rng/core/source32/PcgXshRs32Test.java      |  2 +-
 .../commons/rng/core/source32/Well1024aTest.java       |  2 +-
 .../commons/rng/core/source32/Well19937aTest.java      |  2 +-
 .../commons/rng/core/source32/Well19937cTest.java      |  2 +-
 .../commons/rng/core/source32/Well44497aTest.java      |  2 +-
 .../commons/rng/core/source32/Well44497bTest.java      |  2 +-
 .../apache/commons/rng/core/source32/Well512aTest.java |  2 +-
 .../rng/core/source32/XoRoShiRo64StarStarTest.java     |  2 +-
 .../commons/rng/core/source32/XoRoShiRo64StarTest.java |  2 +-
 .../rng/core/source32/XoShiRo128PlusPlusTest.java      |  2 +-
 .../commons/rng/core/source32/XoShiRo128PlusTest.java  |  2 +-
 .../rng/core/source32/XoShiRo128StarStarTest.java      |  2 +-
 .../source64/DotyHumphreySmallFastCounting64Test.java  |  2 +-
 .../rng/core/source64/JenkinsSmallFast64Test.java      |  2 +-
 .../commons/rng/core/source64/LongProviderTest.java    |  2 +-
 .../rng/core/source64/MersenneTwister64Test.java       |  2 +-
 .../commons/rng/core/source64/PcgRxsMXs64Test.java     |  2 +-
 .../commons/rng/core/source64/SplitMix64Test.java      |  2 +-
 .../apache/commons/rng/core/source64/TwoCmresTest.java |  2 +-
 .../rng/core/source64/XoRoShiRo1024PlusPlusTest.java   |  2 +-
 .../rng/core/source64/XoRoShiRo1024StarStarTest.java   |  2 +-
 .../rng/core/source64/XoRoShiRo1024StarTest.java       |  2 +-
 .../rng/core/source64/XoRoShiRo128PlusPlusTest.java    |  2 +-
 .../rng/core/source64/XoRoShiRo128PlusTest.java        |  2 +-
 .../rng/core/source64/XoRoShiRo128StarStarTest.java    |  2 +-
 .../rng/core/source64/XoShiRo256PlusPlusTest.java      |  2 +-
 .../commons/rng/core/source64/XoShiRo256PlusTest.java  |  2 +-
 .../rng/core/source64/XoShiRo256StarStarTest.java      |  2 +-
 .../rng/core/source64/XoShiRo512PlusPlusTest.java      |  2 +-
 .../commons/rng/core/source64/XoShiRo512PlusTest.java  |  2 +-
 .../rng/core/source64/XoShiRo512StarStarTest.java      |  2 +-
 .../rng/core/source64/XorShift1024StarPhiTest.java     |  2 +-
 .../rng/core/source64/XorShift1024StarTest.java        |  2 +-
 .../commons/rng/core/util/NumberFactoryTest.java       |  2 +-
 .../apache/commons/rng/examples/stress/HexTest.java    |  2 +-
 .../commons/rng/examples/stress/RngDataOutputTest.java |  2 +-
 .../commons/rng/sampling/CollectionSamplerTest.java    |  2 +-
 .../commons/rng/sampling/CombinationSamplerTest.java   |  2 +-
 .../commons/rng/sampling/CompositeSamplersTest.java    |  2 +-
 .../DiscreteProbabilityCollectionSamplerTest.java      |  2 +-
 .../apache/commons/rng/sampling/ListSamplerTest.java   |  2 +-
 .../commons/rng/sampling/PermutationSamplerTest.java   |  2 +-
 .../commons/rng/sampling/UnitSphereSamplerTest.java    |  2 +-
 .../AhrensDieterExponentialSamplerTest.java            | 18 +++++++-----------
 .../AhrensDieterMarsagliaTsangGammaSamplerTest.java    |  2 +-
 .../distribution/AliasMethodDiscreteSamplerTest.java   |  2 +-
 .../distribution/BoxMullerGaussianSamplerTest.java     |  2 +-
 .../distribution/BoxMullerLogNormalSamplerTest.java    |  2 +-
 .../BoxMullerNormalisedGaussianSamplerTest.java        |  2 +-
 .../sampling/distribution/ChengBetaSamplerTest.java    |  2 +-
 .../distribution/ContinuousUniformSamplerTest.java     |  2 +-
 .../sampling/distribution/DirichletSamplerTest.java    |  2 +-
 .../distribution/DiscreteUniformSamplerTest.java       |  2 +-
 .../rng/sampling/distribution/GaussianSamplerTest.java |  2 +-
 .../sampling/distribution/GeometricSamplerTest.java    |  2 +-
 .../distribution/GuideTableDiscreteSamplerTest.java    |  2 +-
 .../rng/sampling/distribution/InternalUtilsTest.java   |  2 +-
 .../InverseTransformContinuousSamplerTest.java         |  2 +-
 .../InverseTransformDiscreteSamplerTest.java           |  2 +-
 .../InverseTransformParetoSamplerTest.java             |  2 +-
 .../distribution/KempSmallMeanPoissonSamplerTest.java  |  2 +-
 .../distribution/LargeMeanPoissonSamplerTest.java      |  2 +-
 .../rng/sampling/distribution/LevySamplerTest.java     |  2 +-
 .../sampling/distribution/LogNormalSamplerTest.java    |  2 +-
 .../MarsagliaNormalisedGaussianSamplerTest.java        |  2 +-
 .../MarsagliaTsangWangDiscreteSamplerTest.java         |  2 +-
 .../sampling/distribution/PoissonSamplerCacheTest.java |  2 +-
 .../rng/sampling/distribution/PoissonSamplerTest.java  |  2 +-
 .../RejectionInversionZipfSamplerTest.java             |  2 +-
 .../rng/sampling/distribution/SamplerBaseTest.java     |  2 +-
 .../distribution/SmallMeanPoissonSamplerTest.java      |  2 +-
 .../rng/sampling/distribution/StableSamplerTest.java   |  2 +-
 .../sampling/distribution/UniformLongSamplerTest.java  |  2 +-
 .../ZigguratNormalizedGaussianSamplerTest.java         |  2 +-
 .../rng/sampling/distribution/ZigguratSamplerTest.java |  2 +-
 .../commons/rng/sampling/shape/BoxSamplerTest.java     |  2 +-
 .../commons/rng/sampling/shape/CoordinatesTest.java    |  2 +-
 .../commons/rng/sampling/shape/LineSamplerTest.java    |  2 +-
 .../rng/sampling/shape/TetrahedronSamplerTest.java     |  2 +-
 .../rng/sampling/shape/TriangleSamplerTest.java        |  2 +-
 .../rng/sampling/shape/UnitBallSamplerTest.java        |  2 +-
 .../apache/commons/rng/simple/JDKRandomBridgeTest.java |  2 +-
 .../commons/rng/simple/JDKRandomWrapperTest.java       |  2 +-
 .../apache/commons/rng/simple/RandomSourceTest.java    |  2 +-
 .../rng/simple/ThreadLocalRandomSourceTest.java        |  6 +++---
 .../rng/simple/internal/ByteArray2IntArrayTest.java    |  2 +-
 .../rng/simple/internal/ByteArray2LongArrayTest.java   |  2 +-
 .../rng/simple/internal/IntArray2LongArrayTest.java    |  2 +-
 .../commons/rng/simple/internal/Long2IntArrayTest.java |  2 +-
 .../rng/simple/internal/Long2LongArrayTest.java        |  2 +-
 .../simple/internal/NativeSeedTypeParametricTest.java  |  2 +-
 .../rng/simple/internal/NativeSeedTypeTest.java        |  2 +-
 .../commons/rng/simple/internal/NoOpConverterTest.java |  2 +-
 .../rng/simple/internal/SeedConverterComposerTest.java |  2 +-
 .../commons/rng/simple/internal/SeedFactoryTest.java   |  2 +-
 .../commons/rng/simple/internal/SeedUtilsTest.java     |  2 +-
 110 files changed, 118 insertions(+), 122 deletions(-)

diff --git a/commons-rng-core/src/test/java/org/apache/commons/rng/core/BaseProviderTest.java b/commons-rng-core/src/test/java/org/apache/commons/rng/core/BaseProviderTest.java
index 1731bd8..7c8795c 100644
--- a/commons-rng-core/src/test/java/org/apache/commons/rng/core/BaseProviderTest.java
+++ b/commons-rng-core/src/test/java/org/apache/commons/rng/core/BaseProviderTest.java
@@ -16,7 +16,7 @@
  */
 package org.apache.commons.rng.core;
 
-import org.junit.Test;
+import org.junit.jupiter.api.Test;
 import org.junit.jupiter.api.Assertions;
 import org.junit.jupiter.api.Assumptions;
 
diff --git a/commons-rng-core/src/test/java/org/apache/commons/rng/core/RandomProviderDefaultStateTest.java b/commons-rng-core/src/test/java/org/apache/commons/rng/core/RandomProviderDefaultStateTest.java
index e13e4f9..d366576 100644
--- a/commons-rng-core/src/test/java/org/apache/commons/rng/core/RandomProviderDefaultStateTest.java
+++ b/commons-rng-core/src/test/java/org/apache/commons/rng/core/RandomProviderDefaultStateTest.java
@@ -17,7 +17,7 @@
 package org.apache.commons.rng.core;
 
 
-import org.junit.Test;
+import org.junit.jupiter.api.Test;
 import org.junit.jupiter.api.Assertions;
 
 /**
diff --git a/commons-rng-core/src/test/java/org/apache/commons/rng/core/source32/DotyHumphreySmallFastCounting32Test.java b/commons-rng-core/src/test/java/org/apache/commons/rng/core/source32/DotyHumphreySmallFastCounting32Test.java
index ca61e2c..3ce92b3 100644
--- a/commons-rng-core/src/test/java/org/apache/commons/rng/core/source32/DotyHumphreySmallFastCounting32Test.java
+++ b/commons-rng-core/src/test/java/org/apache/commons/rng/core/source32/DotyHumphreySmallFastCounting32Test.java
@@ -18,7 +18,7 @@
 package org.apache.commons.rng.core.source32;
 
 import org.apache.commons.rng.core.RandomAssert;
-import org.junit.Test;
+import org.junit.jupiter.api.Test;
 
 public class DotyHumphreySmallFastCounting32Test {
     @Test
diff --git a/commons-rng-core/src/test/java/org/apache/commons/rng/core/source32/ISAACRandomTest.java b/commons-rng-core/src/test/java/org/apache/commons/rng/core/source32/ISAACRandomTest.java
index 766f6a4..d8aa6ab 100644
--- a/commons-rng-core/src/test/java/org/apache/commons/rng/core/source32/ISAACRandomTest.java
+++ b/commons-rng-core/src/test/java/org/apache/commons/rng/core/source32/ISAACRandomTest.java
@@ -18,7 +18,7 @@
 package org.apache.commons.rng.core.source32;
 
 import org.apache.commons.rng.core.RandomAssert;
-import org.junit.Test;
+import org.junit.jupiter.api.Test;
 
 public final class ISAACRandomTest {
     private static final int[] SEED_1 = {
diff --git a/commons-rng-core/src/test/java/org/apache/commons/rng/core/source32/IntProviderTest.java b/commons-rng-core/src/test/java/org/apache/commons/rng/core/source32/IntProviderTest.java
index 041b9fd..208c56c 100644
--- a/commons-rng-core/src/test/java/org/apache/commons/rng/core/source32/IntProviderTest.java
+++ b/commons-rng-core/src/test/java/org/apache/commons/rng/core/source32/IntProviderTest.java
@@ -17,7 +17,7 @@
 package org.apache.commons.rng.core.source32;
 
 import org.junit.jupiter.api.Assertions;
-import org.junit.Test;
+import org.junit.jupiter.api.Test;
 
 /**
  * The tests the caching of calls to {@link IntProvider#nextInt()} are used as
diff --git a/commons-rng-core/src/test/java/org/apache/commons/rng/core/source32/JDKRandomTest.java b/commons-rng-core/src/test/java/org/apache/commons/rng/core/source32/JDKRandomTest.java
index 8eeeb1f..7730776 100644
--- a/commons-rng-core/src/test/java/org/apache/commons/rng/core/source32/JDKRandomTest.java
+++ b/commons-rng-core/src/test/java/org/apache/commons/rng/core/source32/JDKRandomTest.java
@@ -28,7 +28,7 @@ import org.apache.commons.rng.core.RandomAssert;
 import org.apache.commons.rng.core.RandomProviderDefaultState;
 import org.apache.commons.rng.core.util.NumberFactory;
 import org.junit.jupiter.api.Assertions;
-import org.junit.Test;
+import org.junit.jupiter.api.Test;
 
 public class JDKRandomTest {
     /**
diff --git a/commons-rng-core/src/test/java/org/apache/commons/rng/core/source32/JenkinsSmallFast32Test.java b/commons-rng-core/src/test/java/org/apache/commons/rng/core/source32/JenkinsSmallFast32Test.java
index 87fccc6..94de1ca 100644
--- a/commons-rng-core/src/test/java/org/apache/commons/rng/core/source32/JenkinsSmallFast32Test.java
+++ b/commons-rng-core/src/test/java/org/apache/commons/rng/core/source32/JenkinsSmallFast32Test.java
@@ -18,7 +18,7 @@
 package org.apache.commons.rng.core.source32;
 
 import org.apache.commons.rng.core.RandomAssert;
-import org.junit.Test;
+import org.junit.jupiter.api.Test;
 
 public class JenkinsSmallFast32Test {
     @Test
diff --git a/commons-rng-core/src/test/java/org/apache/commons/rng/core/source32/KISSRandomTest.java b/commons-rng-core/src/test/java/org/apache/commons/rng/core/source32/KISSRandomTest.java
index 937f991..0bfbd8c 100644
--- a/commons-rng-core/src/test/java/org/apache/commons/rng/core/source32/KISSRandomTest.java
+++ b/commons-rng-core/src/test/java/org/apache/commons/rng/core/source32/KISSRandomTest.java
@@ -17,7 +17,7 @@
 package org.apache.commons.rng.core.source32;
 
 import org.apache.commons.rng.core.RandomAssert;
-import org.junit.Test;
+import org.junit.jupiter.api.Test;
 
 public class KISSRandomTest {
     @Test
diff --git a/commons-rng-core/src/test/java/org/apache/commons/rng/core/source32/MersenneTwisterTest.java b/commons-rng-core/src/test/java/org/apache/commons/rng/core/source32/MersenneTwisterTest.java
index 3d356c7..c5936b9 100644
--- a/commons-rng-core/src/test/java/org/apache/commons/rng/core/source32/MersenneTwisterTest.java
+++ b/commons-rng-core/src/test/java/org/apache/commons/rng/core/source32/MersenneTwisterTest.java
@@ -18,7 +18,7 @@ package org.apache.commons.rng.core.source32;
 
 import org.apache.commons.rng.core.RandomAssert;
 import org.junit.jupiter.api.Assertions;
-import org.junit.Test;
+import org.junit.jupiter.api.Test;
 
 public class MersenneTwisterTest {
     @Test
diff --git a/commons-rng-core/src/test/java/org/apache/commons/rng/core/source32/MiddleSquareWeylSequenceTest.java b/commons-rng-core/src/test/java/org/apache/commons/rng/core/source32/MiddleSquareWeylSequenceTest.java
index 50f842b..f1733f8 100644
--- a/commons-rng-core/src/test/java/org/apache/commons/rng/core/source32/MiddleSquareWeylSequenceTest.java
+++ b/commons-rng-core/src/test/java/org/apache/commons/rng/core/source32/MiddleSquareWeylSequenceTest.java
@@ -19,7 +19,7 @@ package org.apache.commons.rng.core.source32;
 import org.apache.commons.rng.core.RandomAssert;
 import org.apache.commons.rng.core.util.NumberFactory;
 import org.junit.jupiter.api.Assertions;
-import org.junit.Test;
+import org.junit.jupiter.api.Test;
 
 public class MiddleSquareWeylSequenceTest {
     @Test
diff --git a/commons-rng-core/src/test/java/org/apache/commons/rng/core/source32/MultiplyWithCarry256Test.java b/commons-rng-core/src/test/java/org/apache/commons/rng/core/source32/MultiplyWithCarry256Test.java
index 7db040b..798fa9c 100644
--- a/commons-rng-core/src/test/java/org/apache/commons/rng/core/source32/MultiplyWithCarry256Test.java
+++ b/commons-rng-core/src/test/java/org/apache/commons/rng/core/source32/MultiplyWithCarry256Test.java
@@ -17,7 +17,7 @@
 package org.apache.commons.rng.core.source32;
 
 import org.apache.commons.rng.core.RandomAssert;
-import org.junit.Test;
+import org.junit.jupiter.api.Test;
 
 public class MultiplyWithCarry256Test {
     /** The size of the array seed. */
diff --git a/commons-rng-core/src/test/java/org/apache/commons/rng/core/source32/PcgMcgXshRr32Test.java b/commons-rng-core/src/test/java/org/apache/commons/rng/core/source32/PcgMcgXshRr32Test.java
index 5ca5a50..9364c83 100644
--- a/commons-rng-core/src/test/java/org/apache/commons/rng/core/source32/PcgMcgXshRr32Test.java
+++ b/commons-rng-core/src/test/java/org/apache/commons/rng/core/source32/PcgMcgXshRr32Test.java
@@ -18,7 +18,7 @@
 package org.apache.commons.rng.core.source32;
 
 import org.apache.commons.rng.core.RandomAssert;
-import org.junit.Test;
+import org.junit.jupiter.api.Test;
 
 public class PcgMcgXshRr32Test {
     @Test
diff --git a/commons-rng-core/src/test/java/org/apache/commons/rng/core/source32/PcgMcgXshRs32Test.java b/commons-rng-core/src/test/java/org/apache/commons/rng/core/source32/PcgMcgXshRs32Test.java
index faf3062..a1d69db 100644
--- a/commons-rng-core/src/test/java/org/apache/commons/rng/core/source32/PcgMcgXshRs32Test.java
+++ b/commons-rng-core/src/test/java/org/apache/commons/rng/core/source32/PcgMcgXshRs32Test.java
@@ -18,7 +18,7 @@
 package org.apache.commons.rng.core.source32;
 
 import org.apache.commons.rng.core.RandomAssert;
-import org.junit.Test;
+import org.junit.jupiter.api.Test;
 
 public class PcgMcgXshRs32Test {
     @Test
diff --git a/commons-rng-core/src/test/java/org/apache/commons/rng/core/source32/PcgXshRr32Test.java b/commons-rng-core/src/test/java/org/apache/commons/rng/core/source32/PcgXshRr32Test.java
index e29c165..7e06fcb 100644
--- a/commons-rng-core/src/test/java/org/apache/commons/rng/core/source32/PcgXshRr32Test.java
+++ b/commons-rng-core/src/test/java/org/apache/commons/rng/core/source32/PcgXshRr32Test.java
@@ -18,7 +18,7 @@
 package org.apache.commons.rng.core.source32;
 
 import org.apache.commons.rng.core.RandomAssert;
-import org.junit.Test;
+import org.junit.jupiter.api.Test;
 
 public class PcgXshRr32Test {
     @Test
diff --git a/commons-rng-core/src/test/java/org/apache/commons/rng/core/source32/PcgXshRs32Test.java b/commons-rng-core/src/test/java/org/apache/commons/rng/core/source32/PcgXshRs32Test.java
index dd751ff..40918f2 100644
--- a/commons-rng-core/src/test/java/org/apache/commons/rng/core/source32/PcgXshRs32Test.java
+++ b/commons-rng-core/src/test/java/org/apache/commons/rng/core/source32/PcgXshRs32Test.java
@@ -18,7 +18,7 @@
 package org.apache.commons.rng.core.source32;
 
 import org.apache.commons.rng.core.RandomAssert;
-import org.junit.Test;
+import org.junit.jupiter.api.Test;
 
 public class PcgXshRs32Test {
     @Test
diff --git a/commons-rng-core/src/test/java/org/apache/commons/rng/core/source32/Well1024aTest.java b/commons-rng-core/src/test/java/org/apache/commons/rng/core/source32/Well1024aTest.java
index 746f096..7597caf 100644
--- a/commons-rng-core/src/test/java/org/apache/commons/rng/core/source32/Well1024aTest.java
+++ b/commons-rng-core/src/test/java/org/apache/commons/rng/core/source32/Well1024aTest.java
@@ -17,7 +17,7 @@
 package org.apache.commons.rng.core.source32;
 
 import org.apache.commons.rng.core.RandomAssert;
-import org.junit.Test;
+import org.junit.jupiter.api.Test;
 
 public class Well1024aTest {
     /** The size of the array seed. */
diff --git a/commons-rng-core/src/test/java/org/apache/commons/rng/core/source32/Well19937aTest.java b/commons-rng-core/src/test/java/org/apache/commons/rng/core/source32/Well19937aTest.java
index cc2a509..e33dea0 100644
--- a/commons-rng-core/src/test/java/org/apache/commons/rng/core/source32/Well19937aTest.java
+++ b/commons-rng-core/src/test/java/org/apache/commons/rng/core/source32/Well19937aTest.java
@@ -17,7 +17,7 @@
 package org.apache.commons.rng.core.source32;
 
 import org.apache.commons.rng.core.RandomAssert;
-import org.junit.Test;
+import org.junit.jupiter.api.Test;
 
 public class Well19937aTest {
     /** The size of the array seed. */
diff --git a/commons-rng-core/src/test/java/org/apache/commons/rng/core/source32/Well19937cTest.java b/commons-rng-core/src/test/java/org/apache/commons/rng/core/source32/Well19937cTest.java
index 4a28d3b..dbf6f3a 100644
--- a/commons-rng-core/src/test/java/org/apache/commons/rng/core/source32/Well19937cTest.java
+++ b/commons-rng-core/src/test/java/org/apache/commons/rng/core/source32/Well19937cTest.java
@@ -17,7 +17,7 @@
 package org.apache.commons.rng.core.source32;
 
 import org.apache.commons.rng.core.RandomAssert;
-import org.junit.Test;
+import org.junit.jupiter.api.Test;
 
 public class Well19937cTest {
     /** The size of the array seed. */
diff --git a/commons-rng-core/src/test/java/org/apache/commons/rng/core/source32/Well44497aTest.java b/commons-rng-core/src/test/java/org/apache/commons/rng/core/source32/Well44497aTest.java
index e42f488..d628fd8 100644
--- a/commons-rng-core/src/test/java/org/apache/commons/rng/core/source32/Well44497aTest.java
+++ b/commons-rng-core/src/test/java/org/apache/commons/rng/core/source32/Well44497aTest.java
@@ -17,7 +17,7 @@
 package org.apache.commons.rng.core.source32;
 
 import org.apache.commons.rng.core.RandomAssert;
-import org.junit.Test;
+import org.junit.jupiter.api.Test;
 
 public class Well44497aTest {
     /** The size of the array seed. */
diff --git a/commons-rng-core/src/test/java/org/apache/commons/rng/core/source32/Well44497bTest.java b/commons-rng-core/src/test/java/org/apache/commons/rng/core/source32/Well44497bTest.java
index a7afa55..b1f7ed4 100644
--- a/commons-rng-core/src/test/java/org/apache/commons/rng/core/source32/Well44497bTest.java
+++ b/commons-rng-core/src/test/java/org/apache/commons/rng/core/source32/Well44497bTest.java
@@ -17,7 +17,7 @@
 package org.apache.commons.rng.core.source32;
 
 import org.apache.commons.rng.core.RandomAssert;
-import org.junit.Test;
+import org.junit.jupiter.api.Test;
 
 public class Well44497bTest {
     /** The size of the array seed. */
diff --git a/commons-rng-core/src/test/java/org/apache/commons/rng/core/source32/Well512aTest.java b/commons-rng-core/src/test/java/org/apache/commons/rng/core/source32/Well512aTest.java
index 5e858be..efd0db1 100644
--- a/commons-rng-core/src/test/java/org/apache/commons/rng/core/source32/Well512aTest.java
+++ b/commons-rng-core/src/test/java/org/apache/commons/rng/core/source32/Well512aTest.java
@@ -17,7 +17,7 @@
 package org.apache.commons.rng.core.source32;
 
 import org.apache.commons.rng.core.RandomAssert;
-import org.junit.Test;
+import org.junit.jupiter.api.Test;
 
 public class Well512aTest {
     /** The size of the array seed. */
diff --git a/commons-rng-core/src/test/java/org/apache/commons/rng/core/source32/XoRoShiRo64StarStarTest.java b/commons-rng-core/src/test/java/org/apache/commons/rng/core/source32/XoRoShiRo64StarStarTest.java
index 0ede6a1..e52d497 100644
--- a/commons-rng-core/src/test/java/org/apache/commons/rng/core/source32/XoRoShiRo64StarStarTest.java
+++ b/commons-rng-core/src/test/java/org/apache/commons/rng/core/source32/XoRoShiRo64StarStarTest.java
@@ -17,7 +17,7 @@
 package org.apache.commons.rng.core.source32;
 
 import org.apache.commons.rng.core.RandomAssert;
-import org.junit.Test;
+import org.junit.jupiter.api.Test;
 
 public class XoRoShiRo64StarStarTest {
     /** The size of the array seed. */
diff --git a/commons-rng-core/src/test/java/org/apache/commons/rng/core/source32/XoRoShiRo64StarTest.java b/commons-rng-core/src/test/java/org/apache/commons/rng/core/source32/XoRoShiRo64StarTest.java
index 0bf4ea2..ce80fd7 100644
--- a/commons-rng-core/src/test/java/org/apache/commons/rng/core/source32/XoRoShiRo64StarTest.java
+++ b/commons-rng-core/src/test/java/org/apache/commons/rng/core/source32/XoRoShiRo64StarTest.java
@@ -17,7 +17,7 @@
 package org.apache.commons.rng.core.source32;
 
 import org.apache.commons.rng.core.RandomAssert;
-import org.junit.Test;
+import org.junit.jupiter.api.Test;
 
 public class XoRoShiRo64StarTest {
     /** The size of the array seed. */
diff --git a/commons-rng-core/src/test/java/org/apache/commons/rng/core/source32/XoShiRo128PlusPlusTest.java b/commons-rng-core/src/test/java/org/apache/commons/rng/core/source32/XoShiRo128PlusPlusTest.java
index bd21c62..84bb05f 100644
--- a/commons-rng-core/src/test/java/org/apache/commons/rng/core/source32/XoShiRo128PlusPlusTest.java
+++ b/commons-rng-core/src/test/java/org/apache/commons/rng/core/source32/XoShiRo128PlusPlusTest.java
@@ -17,7 +17,7 @@
 package org.apache.commons.rng.core.source32;
 
 import org.apache.commons.rng.core.RandomAssert;
-import org.junit.Test;
+import org.junit.jupiter.api.Test;
 
 public class XoShiRo128PlusPlusTest {
     /** The size of the array seed. */
diff --git a/commons-rng-core/src/test/java/org/apache/commons/rng/core/source32/XoShiRo128PlusTest.java b/commons-rng-core/src/test/java/org/apache/commons/rng/core/source32/XoShiRo128PlusTest.java
index cc1d70e..092f75e 100644
--- a/commons-rng-core/src/test/java/org/apache/commons/rng/core/source32/XoShiRo128PlusTest.java
+++ b/commons-rng-core/src/test/java/org/apache/commons/rng/core/source32/XoShiRo128PlusTest.java
@@ -17,7 +17,7 @@
 package org.apache.commons.rng.core.source32;
 
 import org.apache.commons.rng.core.RandomAssert;
-import org.junit.Test;
+import org.junit.jupiter.api.Test;
 
 public class XoShiRo128PlusTest {
     /** The size of the array seed. */
diff --git a/commons-rng-core/src/test/java/org/apache/commons/rng/core/source32/XoShiRo128StarStarTest.java b/commons-rng-core/src/test/java/org/apache/commons/rng/core/source32/XoShiRo128StarStarTest.java
index 1eb6242..a3319de 100644
--- a/commons-rng-core/src/test/java/org/apache/commons/rng/core/source32/XoShiRo128StarStarTest.java
+++ b/commons-rng-core/src/test/java/org/apache/commons/rng/core/source32/XoShiRo128StarStarTest.java
@@ -17,7 +17,7 @@
 package org.apache.commons.rng.core.source32;
 
 import org.apache.commons.rng.core.RandomAssert;
-import org.junit.Test;
+import org.junit.jupiter.api.Test;
 
 public class XoShiRo128StarStarTest {
     /** The size of the array seed. */
diff --git a/commons-rng-core/src/test/java/org/apache/commons/rng/core/source64/DotyHumphreySmallFastCounting64Test.java b/commons-rng-core/src/test/java/org/apache/commons/rng/core/source64/DotyHumphreySmallFastCounting64Test.java
index 154532f..95e031b 100644
--- a/commons-rng-core/src/test/java/org/apache/commons/rng/core/source64/DotyHumphreySmallFastCounting64Test.java
+++ b/commons-rng-core/src/test/java/org/apache/commons/rng/core/source64/DotyHumphreySmallFastCounting64Test.java
@@ -18,7 +18,7 @@
 package org.apache.commons.rng.core.source64;
 
 import org.apache.commons.rng.core.RandomAssert;
-import org.junit.Test;
+import org.junit.jupiter.api.Test;
 
 public class DotyHumphreySmallFastCounting64Test {
     @Test
diff --git a/commons-rng-core/src/test/java/org/apache/commons/rng/core/source64/JenkinsSmallFast64Test.java b/commons-rng-core/src/test/java/org/apache/commons/rng/core/source64/JenkinsSmallFast64Test.java
index 3b5d951..938ea28 100644
--- a/commons-rng-core/src/test/java/org/apache/commons/rng/core/source64/JenkinsSmallFast64Test.java
+++ b/commons-rng-core/src/test/java/org/apache/commons/rng/core/source64/JenkinsSmallFast64Test.java
@@ -18,7 +18,7 @@
 package org.apache.commons.rng.core.source64;
 
 import org.apache.commons.rng.core.RandomAssert;
-import org.junit.Test;
+import org.junit.jupiter.api.Test;
 
 public class JenkinsSmallFast64Test {
     @Test
diff --git a/commons-rng-core/src/test/java/org/apache/commons/rng/core/source64/LongProviderTest.java b/commons-rng-core/src/test/java/org/apache/commons/rng/core/source64/LongProviderTest.java
index 356efda..1e4529f 100644
--- a/commons-rng-core/src/test/java/org/apache/commons/rng/core/source64/LongProviderTest.java
+++ b/commons-rng-core/src/test/java/org/apache/commons/rng/core/source64/LongProviderTest.java
@@ -17,7 +17,7 @@
 package org.apache.commons.rng.core.source64;
 
 import org.junit.jupiter.api.Assertions;
-import org.junit.Test;
+import org.junit.jupiter.api.Test;
 
 /**
  * The tests the caching of calls to {@link LongProvider#nextLong()} are used as
diff --git a/commons-rng-core/src/test/java/org/apache/commons/rng/core/source64/MersenneTwister64Test.java b/commons-rng-core/src/test/java/org/apache/commons/rng/core/source64/MersenneTwister64Test.java
index a7b8662..2b10447 100644
--- a/commons-rng-core/src/test/java/org/apache/commons/rng/core/source64/MersenneTwister64Test.java
+++ b/commons-rng-core/src/test/java/org/apache/commons/rng/core/source64/MersenneTwister64Test.java
@@ -18,7 +18,7 @@ package org.apache.commons.rng.core.source64;
 
 import org.apache.commons.rng.core.RandomAssert;
 import org.junit.jupiter.api.Assertions;
-import org.junit.Test;
+import org.junit.jupiter.api.Test;
 
 public class MersenneTwister64Test {
     @Test
diff --git a/commons-rng-core/src/test/java/org/apache/commons/rng/core/source64/PcgRxsMXs64Test.java b/commons-rng-core/src/test/java/org/apache/commons/rng/core/source64/PcgRxsMXs64Test.java
index af29eb8..2615462 100644
--- a/commons-rng-core/src/test/java/org/apache/commons/rng/core/source64/PcgRxsMXs64Test.java
+++ b/commons-rng-core/src/test/java/org/apache/commons/rng/core/source64/PcgRxsMXs64Test.java
@@ -18,7 +18,7 @@
 package org.apache.commons.rng.core.source64;
 
 import org.apache.commons.rng.core.RandomAssert;
-import org.junit.Test;
+import org.junit.jupiter.api.Test;
 
 public class PcgRxsMXs64Test {
     @Test
diff --git a/commons-rng-core/src/test/java/org/apache/commons/rng/core/source64/SplitMix64Test.java b/commons-rng-core/src/test/java/org/apache/commons/rng/core/source64/SplitMix64Test.java
index 5ec141c..234b1c0 100644
--- a/commons-rng-core/src/test/java/org/apache/commons/rng/core/source64/SplitMix64Test.java
+++ b/commons-rng-core/src/test/java/org/apache/commons/rng/core/source64/SplitMix64Test.java
@@ -17,7 +17,7 @@
 package org.apache.commons.rng.core.source64;
 
 import org.apache.commons.rng.core.RandomAssert;
-import org.junit.Test;
+import org.junit.jupiter.api.Test;
 
 public class SplitMix64Test {
     @Test
diff --git a/commons-rng-core/src/test/java/org/apache/commons/rng/core/source64/TwoCmresTest.java b/commons-rng-core/src/test/java/org/apache/commons/rng/core/source64/TwoCmresTest.java
index c7e738c..f368f42 100644
--- a/commons-rng-core/src/test/java/org/apache/commons/rng/core/source64/TwoCmresTest.java
+++ b/commons-rng-core/src/test/java/org/apache/commons/rng/core/source64/TwoCmresTest.java
@@ -19,7 +19,7 @@ package org.apache.commons.rng.core.source64;
 import org.apache.commons.rng.core.RandomAssert;
 import org.apache.commons.rng.core.source64.TwoCmres.Cmres;
 import org.junit.jupiter.api.Assertions;
-import org.junit.Test;
+import org.junit.jupiter.api.Test;
 
 import java.util.ArrayList;
 
diff --git a/commons-rng-core/src/test/java/org/apache/commons/rng/core/source64/XoRoShiRo1024PlusPlusTest.java b/commons-rng-core/src/test/java/org/apache/commons/rng/core/source64/XoRoShiRo1024PlusPlusTest.java
index 0816400..3c8a02f 100644
--- a/commons-rng-core/src/test/java/org/apache/commons/rng/core/source64/XoRoShiRo1024PlusPlusTest.java
+++ b/commons-rng-core/src/test/java/org/apache/commons/rng/core/source64/XoRoShiRo1024PlusPlusTest.java
@@ -17,7 +17,7 @@
 package org.apache.commons.rng.core.source64;
 
 import org.apache.commons.rng.core.RandomAssert;
-import org.junit.Test;
+import org.junit.jupiter.api.Test;
 
 public class XoRoShiRo1024PlusPlusTest {
     /** The size of the array SEED. */
diff --git a/commons-rng-core/src/test/java/org/apache/commons/rng/core/source64/XoRoShiRo1024StarStarTest.java b/commons-rng-core/src/test/java/org/apache/commons/rng/core/source64/XoRoShiRo1024StarStarTest.java
index de35a76..7ae986d 100644
--- a/commons-rng-core/src/test/java/org/apache/commons/rng/core/source64/XoRoShiRo1024StarStarTest.java
+++ b/commons-rng-core/src/test/java/org/apache/commons/rng/core/source64/XoRoShiRo1024StarStarTest.java
@@ -17,7 +17,7 @@
 package org.apache.commons.rng.core.source64;
 
 import org.apache.commons.rng.core.RandomAssert;
-import org.junit.Test;
+import org.junit.jupiter.api.Test;
 
 public class XoRoShiRo1024StarStarTest {
     /** The size of the array SEED. */
diff --git a/commons-rng-core/src/test/java/org/apache/commons/rng/core/source64/XoRoShiRo1024StarTest.java b/commons-rng-core/src/test/java/org/apache/commons/rng/core/source64/XoRoShiRo1024StarTest.java
index add5b74..f768221 100644
--- a/commons-rng-core/src/test/java/org/apache/commons/rng/core/source64/XoRoShiRo1024StarTest.java
+++ b/commons-rng-core/src/test/java/org/apache/commons/rng/core/source64/XoRoShiRo1024StarTest.java
@@ -17,7 +17,7 @@
 package org.apache.commons.rng.core.source64;
 
 import org.apache.commons.rng.core.RandomAssert;
-import org.junit.Test;
+import org.junit.jupiter.api.Test;
 
 public class XoRoShiRo1024StarTest {
     /** The size of the array SEED. */
diff --git a/commons-rng-core/src/test/java/org/apache/commons/rng/core/source64/XoRoShiRo128PlusPlusTest.java b/commons-rng-core/src/test/java/org/apache/commons/rng/core/source64/XoRoShiRo128PlusPlusTest.java
index 42f871a..660f78b 100644
--- a/commons-rng-core/src/test/java/org/apache/commons/rng/core/source64/XoRoShiRo128PlusPlusTest.java
+++ b/commons-rng-core/src/test/java/org/apache/commons/rng/core/source64/XoRoShiRo128PlusPlusTest.java
@@ -17,7 +17,7 @@
 package org.apache.commons.rng.core.source64;
 
 import org.apache.commons.rng.core.RandomAssert;
-import org.junit.Test;
+import org.junit.jupiter.api.Test;
 import org.junit.jupiter.api.Assertions;
 
 public class XoRoShiRo128PlusPlusTest {
diff --git a/commons-rng-core/src/test/java/org/apache/commons/rng/core/source64/XoRoShiRo128PlusTest.java b/commons-rng-core/src/test/java/org/apache/commons/rng/core/source64/XoRoShiRo128PlusTest.java
index c16475c..c7482f5 100644
--- a/commons-rng-core/src/test/java/org/apache/commons/rng/core/source64/XoRoShiRo128PlusTest.java
+++ b/commons-rng-core/src/test/java/org/apache/commons/rng/core/source64/XoRoShiRo128PlusTest.java
@@ -17,7 +17,7 @@
 package org.apache.commons.rng.core.source64;
 
 import org.apache.commons.rng.core.RandomAssert;
-import org.junit.Test;
+import org.junit.jupiter.api.Test;
 
 public class XoRoShiRo128PlusTest {
     /** The size of the array SEED. */
diff --git a/commons-rng-core/src/test/java/org/apache/commons/rng/core/source64/XoRoShiRo128StarStarTest.java b/commons-rng-core/src/test/java/org/apache/commons/rng/core/source64/XoRoShiRo128StarStarTest.java
index ecadb5b..ec05345 100644
--- a/commons-rng-core/src/test/java/org/apache/commons/rng/core/source64/XoRoShiRo128StarStarTest.java
+++ b/commons-rng-core/src/test/java/org/apache/commons/rng/core/source64/XoRoShiRo128StarStarTest.java
@@ -17,7 +17,7 @@
 package org.apache.commons.rng.core.source64;
 
 import org.apache.commons.rng.core.RandomAssert;
-import org.junit.Test;
+import org.junit.jupiter.api.Test;
 
 public class XoRoShiRo128StarStarTest {
     /** The size of the array SEED. */
diff --git a/commons-rng-core/src/test/java/org/apache/commons/rng/core/source64/XoShiRo256PlusPlusTest.java b/commons-rng-core/src/test/java/org/apache/commons/rng/core/source64/XoShiRo256PlusPlusTest.java
index 9d6fd16..9664197 100644
--- a/commons-rng-core/src/test/java/org/apache/commons/rng/core/source64/XoShiRo256PlusPlusTest.java
+++ b/commons-rng-core/src/test/java/org/apache/commons/rng/core/source64/XoShiRo256PlusPlusTest.java
@@ -17,7 +17,7 @@
 package org.apache.commons.rng.core.source64;
 
 import org.apache.commons.rng.core.RandomAssert;
-import org.junit.Test;
+import org.junit.jupiter.api.Test;
 
 public class XoShiRo256PlusPlusTest {
     /** The size of the array SEED. */
diff --git a/commons-rng-core/src/test/java/org/apache/commons/rng/core/source64/XoShiRo256PlusTest.java b/commons-rng-core/src/test/java/org/apache/commons/rng/core/source64/XoShiRo256PlusTest.java
index d9c3855..9c6a1c4 100644
--- a/commons-rng-core/src/test/java/org/apache/commons/rng/core/source64/XoShiRo256PlusTest.java
+++ b/commons-rng-core/src/test/java/org/apache/commons/rng/core/source64/XoShiRo256PlusTest.java
@@ -17,7 +17,7 @@
 package org.apache.commons.rng.core.source64;
 
 import org.apache.commons.rng.core.RandomAssert;
-import org.junit.Test;
+import org.junit.jupiter.api.Test;
 
 public class XoShiRo256PlusTest {
     /** The size of the array SEED. */
diff --git a/commons-rng-core/src/test/java/org/apache/commons/rng/core/source64/XoShiRo256StarStarTest.java b/commons-rng-core/src/test/java/org/apache/commons/rng/core/source64/XoShiRo256StarStarTest.java
index 5c7abdf..1e0a7df 100644
--- a/commons-rng-core/src/test/java/org/apache/commons/rng/core/source64/XoShiRo256StarStarTest.java
+++ b/commons-rng-core/src/test/java/org/apache/commons/rng/core/source64/XoShiRo256StarStarTest.java
@@ -17,7 +17,7 @@
 package org.apache.commons.rng.core.source64;
 
 import org.apache.commons.rng.core.RandomAssert;
-import org.junit.Test;
+import org.junit.jupiter.api.Test;
 
 public class XoShiRo256StarStarTest {
     /** The size of the array SEED. */
diff --git a/commons-rng-core/src/test/java/org/apache/commons/rng/core/source64/XoShiRo512PlusPlusTest.java b/commons-rng-core/src/test/java/org/apache/commons/rng/core/source64/XoShiRo512PlusPlusTest.java
index 68310a8..1e3dc36 100644
--- a/commons-rng-core/src/test/java/org/apache/commons/rng/core/source64/XoShiRo512PlusPlusTest.java
+++ b/commons-rng-core/src/test/java/org/apache/commons/rng/core/source64/XoShiRo512PlusPlusTest.java
@@ -17,7 +17,7 @@
 package org.apache.commons.rng.core.source64;
 
 import org.apache.commons.rng.core.RandomAssert;
-import org.junit.Test;
+import org.junit.jupiter.api.Test;
 
 public class XoShiRo512PlusPlusTest {
     /** The size of the array SEED. */
diff --git a/commons-rng-core/src/test/java/org/apache/commons/rng/core/source64/XoShiRo512PlusTest.java b/commons-rng-core/src/test/java/org/apache/commons/rng/core/source64/XoShiRo512PlusTest.java
index 68ced8b..4b16cd1 100644
--- a/commons-rng-core/src/test/java/org/apache/commons/rng/core/source64/XoShiRo512PlusTest.java
+++ b/commons-rng-core/src/test/java/org/apache/commons/rng/core/source64/XoShiRo512PlusTest.java
@@ -17,7 +17,7 @@
 package org.apache.commons.rng.core.source64;
 
 import org.apache.commons.rng.core.RandomAssert;
-import org.junit.Test;
+import org.junit.jupiter.api.Test;
 
 public class XoShiRo512PlusTest {
     /** The size of the array SEED. */
diff --git a/commons-rng-core/src/test/java/org/apache/commons/rng/core/source64/XoShiRo512StarStarTest.java b/commons-rng-core/src/test/java/org/apache/commons/rng/core/source64/XoShiRo512StarStarTest.java
index 610dab6..cc19dd8 100644
--- a/commons-rng-core/src/test/java/org/apache/commons/rng/core/source64/XoShiRo512StarStarTest.java
+++ b/commons-rng-core/src/test/java/org/apache/commons/rng/core/source64/XoShiRo512StarStarTest.java
@@ -17,7 +17,7 @@
 package org.apache.commons.rng.core.source64;
 
 import org.apache.commons.rng.core.RandomAssert;
-import org.junit.Test;
+import org.junit.jupiter.api.Test;
 
 public class XoShiRo512StarStarTest {
     /** The size of the array SEED. */
diff --git a/commons-rng-core/src/test/java/org/apache/commons/rng/core/source64/XorShift1024StarPhiTest.java b/commons-rng-core/src/test/java/org/apache/commons/rng/core/source64/XorShift1024StarPhiTest.java
index f9a1fce..28f5feb 100644
--- a/commons-rng-core/src/test/java/org/apache/commons/rng/core/source64/XorShift1024StarPhiTest.java
+++ b/commons-rng-core/src/test/java/org/apache/commons/rng/core/source64/XorShift1024StarPhiTest.java
@@ -17,7 +17,7 @@
 package org.apache.commons.rng.core.source64;
 
 import org.apache.commons.rng.core.RandomAssert;
-import org.junit.Test;
+import org.junit.jupiter.api.Test;
 
 public class XorShift1024StarPhiTest {
     /** The size of the array SEED. */
diff --git a/commons-rng-core/src/test/java/org/apache/commons/rng/core/source64/XorShift1024StarTest.java b/commons-rng-core/src/test/java/org/apache/commons/rng/core/source64/XorShift1024StarTest.java
index 5aa4b04..82f80f4 100644
--- a/commons-rng-core/src/test/java/org/apache/commons/rng/core/source64/XorShift1024StarTest.java
+++ b/commons-rng-core/src/test/java/org/apache/commons/rng/core/source64/XorShift1024StarTest.java
@@ -17,7 +17,7 @@
 package org.apache.commons.rng.core.source64;
 
 import org.apache.commons.rng.core.RandomAssert;
-import org.junit.Test;
+import org.junit.jupiter.api.Test;
 
 public class XorShift1024StarTest {
     /** The size of the array SEED. */
diff --git a/commons-rng-core/src/test/java/org/apache/commons/rng/core/util/NumberFactoryTest.java b/commons-rng-core/src/test/java/org/apache/commons/rng/core/util/NumberFactoryTest.java
index 5bf1eea..b3312d2 100644
--- a/commons-rng-core/src/test/java/org/apache/commons/rng/core/util/NumberFactoryTest.java
+++ b/commons-rng-core/src/test/java/org/apache/commons/rng/core/util/NumberFactoryTest.java
@@ -18,7 +18,7 @@ package org.apache.commons.rng.core.util;
 
 import org.apache.commons.math3.util.Precision;
 import org.junit.jupiter.api.Assertions;
-import org.junit.Test;
+import org.junit.jupiter.api.Test;
 
 /**
  * Tests for the {@link NumberFactory}.
diff --git a/commons-rng-examples/examples-stress/src/test/java/org/apache/commons/rng/examples/stress/HexTest.java b/commons-rng-examples/examples-stress/src/test/java/org/apache/commons/rng/examples/stress/HexTest.java
index 5b9f948..cba3d5e 100644
--- a/commons-rng-examples/examples-stress/src/test/java/org/apache/commons/rng/examples/stress/HexTest.java
+++ b/commons-rng-examples/examples-stress/src/test/java/org/apache/commons/rng/examples/stress/HexTest.java
@@ -17,7 +17,7 @@
 package org.apache.commons.rng.examples.stress;
 
 import org.junit.jupiter.api.Assertions;
-import org.junit.Test;
+import org.junit.jupiter.api.Test;
 
 import java.util.Arrays;
 import java.util.Locale;
diff --git a/commons-rng-examples/examples-stress/src/test/java/org/apache/commons/rng/examples/stress/RngDataOutputTest.java b/commons-rng-examples/examples-stress/src/test/java/org/apache/commons/rng/examples/stress/RngDataOutputTest.java
index 90619a4..12f6312 100644
--- a/commons-rng-examples/examples-stress/src/test/java/org/apache/commons/rng/examples/stress/RngDataOutputTest.java
+++ b/commons-rng-examples/examples-stress/src/test/java/org/apache/commons/rng/examples/stress/RngDataOutputTest.java
@@ -22,7 +22,7 @@ import org.apache.commons.rng.core.source32.RandomIntSource;
 import org.apache.commons.rng.core.source64.RandomLongSource;
 import org.apache.commons.rng.simple.RandomSource;
 import org.junit.jupiter.api.Assertions;
-import org.junit.Test;
+import org.junit.jupiter.api.Test;
 
 import java.io.ByteArrayOutputStream;
 import java.io.DataOutputStream;
diff --git a/commons-rng-sampling/src/test/java/org/apache/commons/rng/sampling/CollectionSamplerTest.java b/commons-rng-sampling/src/test/java/org/apache/commons/rng/sampling/CollectionSamplerTest.java
index 815ae06..ba9ad22 100644
--- a/commons-rng-sampling/src/test/java/org/apache/commons/rng/sampling/CollectionSamplerTest.java
+++ b/commons-rng-sampling/src/test/java/org/apache/commons/rng/sampling/CollectionSamplerTest.java
@@ -21,7 +21,7 @@ import java.util.Arrays;
 import java.util.List;
 
 import org.junit.jupiter.api.Assertions;
-import org.junit.Test;
+import org.junit.jupiter.api.Test;
 import org.apache.commons.rng.UniformRandomProvider;
 import org.apache.commons.rng.simple.RandomSource;
 
diff --git a/commons-rng-sampling/src/test/java/org/apache/commons/rng/sampling/CombinationSamplerTest.java b/commons-rng-sampling/src/test/java/org/apache/commons/rng/sampling/CombinationSamplerTest.java
index e5dbe86..baa48f6 100644
--- a/commons-rng-sampling/src/test/java/org/apache/commons/rng/sampling/CombinationSamplerTest.java
+++ b/commons-rng-sampling/src/test/java/org/apache/commons/rng/sampling/CombinationSamplerTest.java
@@ -19,7 +19,7 @@ package org.apache.commons.rng.sampling;
 import java.util.Arrays;
 
 import org.junit.jupiter.api.Assertions;
-import org.junit.Test;
+import org.junit.jupiter.api.Test;
 
 import org.apache.commons.math3.stat.inference.ChiSquareTest;
 import org.apache.commons.math3.util.CombinatoricsUtils;
diff --git a/commons-rng-sampling/src/test/java/org/apache/commons/rng/sampling/CompositeSamplersTest.java b/commons-rng-sampling/src/test/java/org/apache/commons/rng/sampling/CompositeSamplersTest.java
index f733891..441242c 100644
--- a/commons-rng-sampling/src/test/java/org/apache/commons/rng/sampling/CompositeSamplersTest.java
+++ b/commons-rng-sampling/src/test/java/org/apache/commons/rng/sampling/CompositeSamplersTest.java
@@ -20,7 +20,7 @@ package org.apache.commons.rng.sampling;
 import java.util.Arrays;
 import java.util.concurrent.atomic.AtomicInteger;
 import org.junit.jupiter.api.Assertions;
-import org.junit.Test;
+import org.junit.jupiter.api.Test;
 
 import org.apache.commons.math3.stat.inference.ChiSquareTest;
 import org.apache.commons.rng.UniformRandomProvider;
diff --git a/commons-rng-sampling/src/test/java/org/apache/commons/rng/sampling/DiscreteProbabilityCollectionSamplerTest.java b/commons-rng-sampling/src/test/java/org/apache/commons/rng/sampling/DiscreteProbabilityCollectionSamplerTest.java
index ada0146..ca4025a 100644
--- a/commons-rng-sampling/src/test/java/org/apache/commons/rng/sampling/DiscreteProbabilityCollectionSamplerTest.java
+++ b/commons-rng-sampling/src/test/java/org/apache/commons/rng/sampling/DiscreteProbabilityCollectionSamplerTest.java
@@ -25,7 +25,7 @@ import java.util.Map;
 import java.util.TreeMap;
 
 import org.junit.jupiter.api.Assertions;
-import org.junit.Test;
+import org.junit.jupiter.api.Test;
 import org.apache.commons.rng.UniformRandomProvider;
 import org.apache.commons.rng.simple.RandomSource;
 
diff --git a/commons-rng-sampling/src/test/java/org/apache/commons/rng/sampling/ListSamplerTest.java b/commons-rng-sampling/src/test/java/org/apache/commons/rng/sampling/ListSamplerTest.java
index 156ad65..1c15f74 100644
--- a/commons-rng-sampling/src/test/java/org/apache/commons/rng/sampling/ListSamplerTest.java
+++ b/commons-rng-sampling/src/test/java/org/apache/commons/rng/sampling/ListSamplerTest.java
@@ -26,7 +26,7 @@ import java.util.ArrayList;
 import java.util.Collection;
 
 import org.junit.jupiter.api.Assertions;
-import org.junit.Test;
+import org.junit.jupiter.api.Test;
 
 import org.apache.commons.math3.stat.inference.ChiSquareTest;
 
diff --git a/commons-rng-sampling/src/test/java/org/apache/commons/rng/sampling/PermutationSamplerTest.java b/commons-rng-sampling/src/test/java/org/apache/commons/rng/sampling/PermutationSamplerTest.java
index 2a2fece..af4937c 100644
--- a/commons-rng-sampling/src/test/java/org/apache/commons/rng/sampling/PermutationSamplerTest.java
+++ b/commons-rng-sampling/src/test/java/org/apache/commons/rng/sampling/PermutationSamplerTest.java
@@ -19,7 +19,7 @@ package org.apache.commons.rng.sampling;
 import java.util.Arrays;
 
 import org.junit.jupiter.api.Assertions;
-import org.junit.Test;
+import org.junit.jupiter.api.Test;
 
 import org.apache.commons.math3.stat.inference.ChiSquareTest;
 
diff --git a/commons-rng-sampling/src/test/java/org/apache/commons/rng/sampling/UnitSphereSamplerTest.java b/commons-rng-sampling/src/test/java/org/apache/commons/rng/sampling/UnitSphereSamplerTest.java
index d9ae4ee..ef1af4b 100644
--- a/commons-rng-sampling/src/test/java/org/apache/commons/rng/sampling/UnitSphereSamplerTest.java
+++ b/commons-rng-sampling/src/test/java/org/apache/commons/rng/sampling/UnitSphereSamplerTest.java
@@ -17,7 +17,7 @@
 package org.apache.commons.rng.sampling;
 
 import org.junit.jupiter.api.Assertions;
-import org.junit.Test;
+import org.junit.jupiter.api.Test;
 import org.apache.commons.rng.simple.RandomSource;
 import java.util.Arrays;
 import org.apache.commons.math3.stat.inference.ChiSquareTest;
diff --git a/commons-rng-sampling/src/test/java/org/apache/commons/rng/sampling/distribution/AhrensDieterExponentialSamplerTest.java b/commons-rng-sampling/src/test/java/org/apache/commons/rng/sampling/distribution/AhrensDieterExponentialSamplerTest.java
index c6374fa..3de03dd 100644
--- a/commons-rng-sampling/src/test/java/org/apache/commons/rng/sampling/distribution/AhrensDieterExponentialSamplerTest.java
+++ b/commons-rng-sampling/src/test/java/org/apache/commons/rng/sampling/distribution/AhrensDieterExponentialSamplerTest.java
@@ -16,26 +16,19 @@
  */
 package org.apache.commons.rng.sampling.distribution;
 
-import java.util.concurrent.TimeUnit;
+import java.time.Duration;
 import org.apache.commons.rng.RestorableUniformRandomProvider;
 import org.apache.commons.rng.UniformRandomProvider;
 import org.apache.commons.rng.core.source64.SplitMix64;
 import org.apache.commons.rng.sampling.RandomAssert;
 import org.apache.commons.rng.simple.RandomSource;
 import org.junit.jupiter.api.Assertions;
-import org.junit.Rule;
-import org.junit.Test;
-import org.junit.rules.Timeout;
+import org.junit.jupiter.api.Test;
 
 /**
  * Test for the {@link AhrensDieterExponentialSampler}. The tests hit edge cases for the sampler.
  */
 public class AhrensDieterExponentialSamplerTest {
-
-    /** The global timeout for tests. Used to kill a test stuck in an infinite loop. */
-    @Rule
-    public Timeout globalTimeout = new Timeout(50, TimeUnit.MILLISECONDS);
-
     /**
      * Test the constructor with a bad mean.
      */
@@ -76,8 +69,11 @@ public class AhrensDieterExponentialSamplerTest {
         };
         final SharedStateContinuousSampler sampler = AhrensDieterExponentialSampler.of(rng, 1);
         // This should not infinite loop
-        final double x = sampler.sample();
-        Assertions.assertTrue(x >= 0);
+        final double[] x = {-1};
+        Assertions.assertTimeout(Duration.ofMillis(50), () -> {
+            x[0] = sampler.sample();
+        });
+        Assertions.assertTrue(x[0] >= 0);
     }
 
     /**
diff --git a/commons-rng-sampling/src/test/java/org/apache/commons/rng/sampling/distribution/AhrensDieterMarsagliaTsangGammaSamplerTest.java b/commons-rng-sampling/src/test/java/org/apache/commons/rng/sampling/distribution/AhrensDieterMarsagliaTsangGammaSamplerTest.java
index fba264d..fee51ac 100644
--- a/commons-rng-sampling/src/test/java/org/apache/commons/rng/sampling/distribution/AhrensDieterMarsagliaTsangGammaSamplerTest.java
+++ b/commons-rng-sampling/src/test/java/org/apache/commons/rng/sampling/distribution/AhrensDieterMarsagliaTsangGammaSamplerTest.java
@@ -21,7 +21,7 @@ import org.apache.commons.rng.UniformRandomProvider;
 import org.apache.commons.rng.sampling.RandomAssert;
 import org.apache.commons.rng.simple.RandomSource;
 import org.junit.jupiter.api.Assertions;
-import org.junit.Test;
+import org.junit.jupiter.api.Test;
 
 /**
  * Test for the {@link AhrensDieterMarsagliaTsangGammaSampler}. The tests hit edge cases for the sampler.
diff --git a/commons-rng-sampling/src/test/java/org/apache/commons/rng/sampling/distribution/AliasMethodDiscreteSamplerTest.java b/commons-rng-sampling/src/test/java/org/apache/commons/rng/sampling/distribution/AliasMethodDiscreteSamplerTest.java
index 6ce5e83..2276444 100644
--- a/commons-rng-sampling/src/test/java/org/apache/commons/rng/sampling/distribution/AliasMethodDiscreteSamplerTest.java
+++ b/commons-rng-sampling/src/test/java/org/apache/commons/rng/sampling/distribution/AliasMethodDiscreteSamplerTest.java
@@ -23,7 +23,7 @@ import org.apache.commons.rng.UniformRandomProvider;
 import org.apache.commons.rng.sampling.RandomAssert;
 import org.apache.commons.rng.simple.RandomSource;
 import org.junit.jupiter.api.Assertions;
-import org.junit.Test;
+import org.junit.jupiter.api.Test;
 
 import java.util.Arrays;
 
diff --git a/commons-rng-sampling/src/test/java/org/apache/commons/rng/sampling/distribution/BoxMullerGaussianSamplerTest.java b/commons-rng-sampling/src/test/java/org/apache/commons/rng/sampling/distribution/BoxMullerGaussianSamplerTest.java
index e99eff3..84135a3 100644
--- a/commons-rng-sampling/src/test/java/org/apache/commons/rng/sampling/distribution/BoxMullerGaussianSamplerTest.java
+++ b/commons-rng-sampling/src/test/java/org/apache/commons/rng/sampling/distribution/BoxMullerGaussianSamplerTest.java
@@ -18,7 +18,7 @@ package org.apache.commons.rng.sampling.distribution;
 
 import org.apache.commons.rng.RestorableUniformRandomProvider;
 import org.apache.commons.rng.simple.RandomSource;
-import org.junit.Test;
+import org.junit.jupiter.api.Test;
 import org.junit.jupiter.api.Assertions;
 
 /**
diff --git a/commons-rng-sampling/src/test/java/org/apache/commons/rng/sampling/distribution/BoxMullerLogNormalSamplerTest.java b/commons-rng-sampling/src/test/java/org/apache/commons/rng/sampling/distribution/BoxMullerLogNormalSamplerTest.java
index 138bafe..4c5b1de 100644
--- a/commons-rng-sampling/src/test/java/org/apache/commons/rng/sampling/distribution/BoxMullerLogNormalSamplerTest.java
+++ b/commons-rng-sampling/src/test/java/org/apache/commons/rng/sampling/distribution/BoxMullerLogNormalSamplerTest.java
@@ -18,7 +18,7 @@ package org.apache.commons.rng.sampling.distribution;
 
 import org.apache.commons.rng.RestorableUniformRandomProvider;
 import org.apache.commons.rng.simple.RandomSource;
-import org.junit.Test;
+import org.junit.jupiter.api.Test;
 import org.junit.jupiter.api.Assertions;
 
 /**
diff --git a/commons-rng-sampling/src/test/java/org/apache/commons/rng/sampling/distribution/BoxMullerNormalisedGaussianSamplerTest.java b/commons-rng-sampling/src/test/java/org/apache/commons/rng/sampling/distribution/BoxMullerNormalisedGaussianSamplerTest.java
index 1107356..c9c970a 100644
--- a/commons-rng-sampling/src/test/java/org/apache/commons/rng/sampling/distribution/BoxMullerNormalisedGaussianSamplerTest.java
+++ b/commons-rng-sampling/src/test/java/org/apache/commons/rng/sampling/distribution/BoxMullerNormalisedGaussianSamplerTest.java
@@ -19,7 +19,7 @@ package org.apache.commons.rng.sampling.distribution;
 import org.apache.commons.rng.UniformRandomProvider;
 import org.apache.commons.rng.sampling.RandomAssert;
 import org.apache.commons.rng.simple.RandomSource;
-import org.junit.Test;
+import org.junit.jupiter.api.Test;
 
 /**
  * Test for the {@link BoxMullerNormalizedGaussianSampler}.
diff --git a/commons-rng-sampling/src/test/java/org/apache/commons/rng/sampling/distribution/ChengBetaSamplerTest.java b/commons-rng-sampling/src/test/java/org/apache/commons/rng/sampling/distribution/ChengBetaSamplerTest.java
index c1be6d0..3c8d5ad 100644
--- a/commons-rng-sampling/src/test/java/org/apache/commons/rng/sampling/distribution/ChengBetaSamplerTest.java
+++ b/commons-rng-sampling/src/test/java/org/apache/commons/rng/sampling/distribution/ChengBetaSamplerTest.java
@@ -21,7 +21,7 @@ import org.apache.commons.rng.UniformRandomProvider;
 import org.apache.commons.rng.sampling.RandomAssert;
 import org.apache.commons.rng.simple.RandomSource;
 import org.junit.jupiter.api.Assertions;
-import org.junit.Test;
+import org.junit.jupiter.api.Test;
 
 /**
  * Test for the {@link ChengBetaSampler}. The tests hit edge cases for the sampler.
diff --git a/commons-rng-sampling/src/test/java/org/apache/commons/rng/sampling/distribution/ContinuousUniformSamplerTest.java b/commons-rng-sampling/src/test/java/org/apache/commons/rng/sampling/distribution/ContinuousUniformSamplerTest.java
index 2a55ca1..e25b8db 100644
--- a/commons-rng-sampling/src/test/java/org/apache/commons/rng/sampling/distribution/ContinuousUniformSamplerTest.java
+++ b/commons-rng-sampling/src/test/java/org/apache/commons/rng/sampling/distribution/ContinuousUniformSamplerTest.java
@@ -21,7 +21,7 @@ import org.apache.commons.rng.core.source64.SplitMix64;
 import org.apache.commons.rng.sampling.RandomAssert;
 import org.apache.commons.rng.simple.RandomSource;
 import org.junit.jupiter.api.Assertions;
-import org.junit.Test;
+import org.junit.jupiter.api.Test;
 
 /**
  * Test for the {@link ContinuousUniformSampler}.
diff --git a/commons-rng-sampling/src/test/java/org/apache/commons/rng/sampling/distribution/DirichletSamplerTest.java b/commons-rng-sampling/src/test/java/org/apache/commons/rng/sampling/distribution/DirichletSamplerTest.java
index 931c50c..0d42e1c 100644
--- a/commons-rng-sampling/src/test/java/org/apache/commons/rng/sampling/distribution/DirichletSamplerTest.java
+++ b/commons-rng-sampling/src/test/java/org/apache/commons/rng/sampling/distribution/DirichletSamplerTest.java
@@ -17,7 +17,7 @@
 package org.apache.commons.rng.sampling.distribution;
 
 import org.junit.jupiter.api.Assertions;
-import org.junit.Test;
+import org.junit.jupiter.api.Test;
 import java.util.Arrays;
 import org.apache.commons.math3.linear.Array2DRowRealMatrix;
 import org.apache.commons.math3.stat.correlation.Covariance;
diff --git a/commons-rng-sampling/src/test/java/org/apache/commons/rng/sampling/distribution/DiscreteUniformSamplerTest.java b/commons-rng-sampling/src/test/java/org/apache/commons/rng/sampling/distribution/DiscreteUniformSamplerTest.java
index 6421011..3c85797 100644
--- a/commons-rng-sampling/src/test/java/org/apache/commons/rng/sampling/distribution/DiscreteUniformSamplerTest.java
+++ b/commons-rng-sampling/src/test/java/org/apache/commons/rng/sampling/distribution/DiscreteUniformSamplerTest.java
@@ -21,7 +21,7 @@ import org.apache.commons.rng.core.source32.IntProvider;
 import org.apache.commons.rng.sampling.RandomAssert;
 import org.apache.commons.rng.simple.RandomSource;
 import org.junit.jupiter.api.Assertions;
-import org.junit.Test;
+import org.junit.jupiter.api.Test;
 
 import java.util.Locale;
 
diff --git a/commons-rng-sampling/src/test/java/org/apache/commons/rng/sampling/distribution/GaussianSamplerTest.java b/commons-rng-sampling/src/test/java/org/apache/commons/rng/sampling/distribution/GaussianSamplerTest.java
index d042904..f9e803e 100644
--- a/commons-rng-sampling/src/test/java/org/apache/commons/rng/sampling/distribution/GaussianSamplerTest.java
+++ b/commons-rng-sampling/src/test/java/org/apache/commons/rng/sampling/distribution/GaussianSamplerTest.java
@@ -21,7 +21,7 @@ import org.apache.commons.rng.UniformRandomProvider;
 import org.apache.commons.rng.sampling.RandomAssert;
 import org.apache.commons.rng.sampling.SharedStateSampler;
 import org.apache.commons.rng.simple.RandomSource;
-import org.junit.Test;
+import org.junit.jupiter.api.Test;
 import org.junit.jupiter.api.Assertions;
 
 /**
diff --git a/commons-rng-sampling/src/test/java/org/apache/commons/rng/sampling/distribution/GeometricSamplerTest.java b/commons-rng-sampling/src/test/java/org/apache/commons/rng/sampling/distribution/GeometricSamplerTest.java
index 4f88a2f..6465d78 100644
--- a/commons-rng-sampling/src/test/java/org/apache/commons/rng/sampling/distribution/GeometricSamplerTest.java
+++ b/commons-rng-sampling/src/test/java/org/apache/commons/rng/sampling/distribution/GeometricSamplerTest.java
@@ -20,7 +20,7 @@ import org.apache.commons.rng.UniformRandomProvider;
 import org.apache.commons.rng.sampling.RandomAssert;
 import org.apache.commons.rng.simple.RandomSource;
 import org.junit.jupiter.api.Assertions;
-import org.junit.Test;
+import org.junit.jupiter.api.Test;
 
 /**
  * Test for the {@link GeometricSampler}. The tests hit edge cases for the sampler.
diff --git a/commons-rng-sampling/src/test/java/org/apache/commons/rng/sampling/distribution/GuideTableDiscreteSamplerTest.java b/commons-rng-sampling/src/test/java/org/apache/commons/rng/sampling/distribution/GuideTableDiscreteSamplerTest.java
index 7ae4670..6f30c11 100644
--- a/commons-rng-sampling/src/test/java/org/apache/commons/rng/sampling/distribution/GuideTableDiscreteSamplerTest.java
+++ b/commons-rng-sampling/src/test/java/org/apache/commons/rng/sampling/distribution/GuideTableDiscreteSamplerTest.java
@@ -23,7 +23,7 @@ import org.apache.commons.rng.UniformRandomProvider;
 import org.apache.commons.rng.sampling.RandomAssert;
 import org.apache.commons.rng.simple.RandomSource;
 import org.junit.jupiter.api.Assertions;
-import org.junit.Test;
+import org.junit.jupiter.api.Test;
 
 /**
  * Test for the {@link GuideTableDiscreteSampler}.
diff --git a/commons-rng-sampling/src/test/java/org/apache/commons/rng/sampling/distribution/InternalUtilsTest.java b/commons-rng-sampling/src/test/java/org/apache/commons/rng/sampling/distribution/InternalUtilsTest.java
index 18c5f69..4d6c19c 100644
--- a/commons-rng-sampling/src/test/java/org/apache/commons/rng/sampling/distribution/InternalUtilsTest.java
+++ b/commons-rng-sampling/src/test/java/org/apache/commons/rng/sampling/distribution/InternalUtilsTest.java
@@ -19,7 +19,7 @@ package org.apache.commons.rng.sampling.distribution;
 import org.apache.commons.math3.special.Gamma;
 import org.apache.commons.rng.sampling.distribution.InternalUtils.FactorialLog;
 import org.junit.jupiter.api.Assertions;
-import org.junit.Test;
+import org.junit.jupiter.api.Test;
 
 /**
  * Test for the {@link InternalUtils}.
diff --git a/commons-rng-sampling/src/test/java/org/apache/commons/rng/sampling/distribution/InverseTransformContinuousSamplerTest.java b/commons-rng-sampling/src/test/java/org/apache/commons/rng/sampling/distribution/InverseTransformContinuousSamplerTest.java
index 82762ac..4a7e974 100644
--- a/commons-rng-sampling/src/test/java/org/apache/commons/rng/sampling/distribution/InverseTransformContinuousSamplerTest.java
+++ b/commons-rng-sampling/src/test/java/org/apache/commons/rng/sampling/distribution/InverseTransformContinuousSamplerTest.java
@@ -19,7 +19,7 @@ package org.apache.commons.rng.sampling.distribution;
 import org.apache.commons.rng.UniformRandomProvider;
 import org.apache.commons.rng.sampling.RandomAssert;
 import org.apache.commons.rng.simple.RandomSource;
-import org.junit.Test;
+import org.junit.jupiter.api.Test;
 
 /**
  * Test for the {@link InverseTransformContinuousSampler}.
diff --git a/commons-rng-sampling/src/test/java/org/apache/commons/rng/sampling/distribution/InverseTransformDiscreteSamplerTest.java b/commons-rng-sampling/src/test/java/org/apache/commons/rng/sampling/distribution/InverseTransformDiscreteSamplerTest.java
index d80542d..66abfad 100644
--- a/commons-rng-sampling/src/test/java/org/apache/commons/rng/sampling/distribution/InverseTransformDiscreteSamplerTest.java
+++ b/commons-rng-sampling/src/test/java/org/apache/commons/rng/sampling/distribution/InverseTransformDiscreteSamplerTest.java
@@ -19,7 +19,7 @@ package org.apache.commons.rng.sampling.distribution;
 import org.apache.commons.rng.UniformRandomProvider;
 import org.apache.commons.rng.sampling.RandomAssert;
 import org.apache.commons.rng.simple.RandomSource;
-import org.junit.Test;
+import org.junit.jupiter.api.Test;
 
 /**
  * Test for the {@link InverseTransformDiscreteSampler}.
diff --git a/commons-rng-sampling/src/test/java/org/apache/commons/rng/sampling/distribution/InverseTransformParetoSamplerTest.java b/commons-rng-sampling/src/test/java/org/apache/commons/rng/sampling/distribution/InverseTransformParetoSamplerTest.java
index cda4f9b..6021077 100644
--- a/commons-rng-sampling/src/test/java/org/apache/commons/rng/sampling/distribution/InverseTransformParetoSamplerTest.java
+++ b/commons-rng-sampling/src/test/java/org/apache/commons/rng/sampling/distribution/InverseTransformParetoSamplerTest.java
@@ -20,7 +20,7 @@ import org.apache.commons.rng.RestorableUniformRandomProvider;
 import org.apache.commons.rng.UniformRandomProvider;
 import org.apache.commons.rng.sampling.RandomAssert;
 import org.apache.commons.rng.simple.RandomSource;
-import org.junit.Test;
+import org.junit.jupiter.api.Test;
 import org.junit.jupiter.api.Assertions;
 
 /**
diff --git a/commons-rng-sampling/src/test/java/org/apache/commons/rng/sampling/distribution/KempSmallMeanPoissonSamplerTest.java b/commons-rng-sampling/src/test/java/org/apache/commons/rng/sampling/distribution/KempSmallMeanPoissonSamplerTest.java
index 50508c3..935f4c3 100644
--- a/commons-rng-sampling/src/test/java/org/apache/commons/rng/sampling/distribution/KempSmallMeanPoissonSamplerTest.java
+++ b/commons-rng-sampling/src/test/java/org/apache/commons/rng/sampling/distribution/KempSmallMeanPoissonSamplerTest.java
@@ -21,7 +21,7 @@ import org.apache.commons.rng.UniformRandomProvider;
 import org.apache.commons.rng.sampling.RandomAssert;
 import org.apache.commons.rng.simple.RandomSource;
 import org.junit.jupiter.api.Assertions;
-import org.junit.Test;
+import org.junit.jupiter.api.Test;
 
 /**
  * Test for the {@link KempSmallMeanPoissonSampler}. The tests hit edge cases for the
diff --git a/commons-rng-sampling/src/test/java/org/apache/commons/rng/sampling/distribution/LargeMeanPoissonSamplerTest.java b/commons-rng-sampling/src/test/java/org/apache/commons/rng/sampling/distribution/LargeMeanPoissonSamplerTest.java
index 582898a..b8aa3da 100644
--- a/commons-rng-sampling/src/test/java/org/apache/commons/rng/sampling/distribution/LargeMeanPoissonSamplerTest.java
+++ b/commons-rng-sampling/src/test/java/org/apache/commons/rng/sampling/distribution/LargeMeanPoissonSamplerTest.java
@@ -23,7 +23,7 @@ import org.apache.commons.rng.sampling.RandomAssert;
 import org.apache.commons.rng.sampling.distribution.LargeMeanPoissonSampler.LargeMeanPoissonSamplerState;
 import org.apache.commons.rng.simple.RandomSource;
 import org.junit.jupiter.api.Assertions;
-import org.junit.Test;
+import org.junit.jupiter.api.Test;
 
 /**
  * This test checks the {@link LargeMeanPoissonSampler} can be created
diff --git a/commons-rng-sampling/src/test/java/org/apache/commons/rng/sampling/distribution/LevySamplerTest.java b/commons-rng-sampling/src/test/java/org/apache/commons/rng/sampling/distribution/LevySamplerTest.java
index 4943d06..1d578f5 100644
--- a/commons-rng-sampling/src/test/java/org/apache/commons/rng/sampling/distribution/LevySamplerTest.java
+++ b/commons-rng-sampling/src/test/java/org/apache/commons/rng/sampling/distribution/LevySamplerTest.java
@@ -22,7 +22,7 @@ import org.apache.commons.rng.sampling.RandomAssert;
 import org.apache.commons.rng.simple.RandomSource;
 
 import org.junit.jupiter.api.Assertions;
-import org.junit.Test;
+import org.junit.jupiter.api.Test;
 
 /**
  * Test for the {@link LevySampler}.
diff --git a/commons-rng-sampling/src/test/java/org/apache/commons/rng/sampling/distribution/LogNormalSamplerTest.java b/commons-rng-sampling/src/test/java/org/apache/commons/rng/sampling/distribution/LogNormalSamplerTest.java
index 0ffe543..73d52fb 100644
--- a/commons-rng-sampling/src/test/java/org/apache/commons/rng/sampling/distribution/LogNormalSamplerTest.java
+++ b/commons-rng-sampling/src/test/java/org/apache/commons/rng/sampling/distribution/LogNormalSamplerTest.java
@@ -21,7 +21,7 @@ import org.apache.commons.rng.UniformRandomProvider;
 import org.apache.commons.rng.sampling.RandomAssert;
 import org.apache.commons.rng.sampling.SharedStateSampler;
 import org.apache.commons.rng.simple.RandomSource;
-import org.junit.Test;
+import org.junit.jupiter.api.Test;
 import org.junit.jupiter.api.Assertions;
 
 /**
diff --git a/commons-rng-sampling/src/test/java/org/apache/commons/rng/sampling/distribution/MarsagliaNormalisedGaussianSamplerTest.java b/commons-rng-sampling/src/test/java/org/apache/commons/rng/sampling/distribution/MarsagliaNormalisedGaussianSamplerTest.java
index f766d54..99c53c0 100644
--- a/commons-rng-sampling/src/test/java/org/apache/commons/rng/sampling/distribution/MarsagliaNormalisedGaussianSamplerTest.java
+++ b/commons-rng-sampling/src/test/java/org/apache/commons/rng/sampling/distribution/MarsagliaNormalisedGaussianSamplerTest.java
@@ -21,7 +21,7 @@ import org.apache.commons.rng.core.source32.IntProvider;
 import org.apache.commons.rng.sampling.RandomAssert;
 import org.apache.commons.rng.simple.RandomSource;
 import org.junit.jupiter.api.Assertions;
-import org.junit.Test;
+import org.junit.jupiter.api.Test;
 
 /**
  * Test for the {@link MarsagliaNormalizedGaussianSampler}.
diff --git a/commons-rng-sampling/src/test/java/org/apache/commons/rng/sampling/distribution/MarsagliaTsangWangDiscreteSamplerTest.java b/commons-rng-sampling/src/test/java/org/apache/commons/rng/sampling/distribution/MarsagliaTsangWangDiscreteSamplerTest.java
index 51ec692..e8b3705 100644
--- a/commons-rng-sampling/src/test/java/org/apache/commons/rng/sampling/distribution/MarsagliaTsangWangDiscreteSamplerTest.java
+++ b/commons-rng-sampling/src/test/java/org/apache/commons/rng/sampling/distribution/MarsagliaTsangWangDiscreteSamplerTest.java
@@ -23,7 +23,7 @@ import org.apache.commons.rng.core.source64.SplitMix64;
 import org.apache.commons.rng.sampling.RandomAssert;
 import org.apache.commons.rng.simple.RandomSource;
 import org.junit.jupiter.api.Assertions;
-import org.junit.Test;
+import org.junit.jupiter.api.Test;
 
 /**
  * Test for the {@link MarsagliaTsangWangDiscreteSampler}. The tests hit edge cases for
diff --git a/commons-rng-sampling/src/test/java/org/apache/commons/rng/sampling/distribution/PoissonSamplerCacheTest.java b/commons-rng-sampling/src/test/java/org/apache/commons/rng/sampling/distribution/PoissonSamplerCacheTest.java
index 671f50e..c605968 100644
--- a/commons-rng-sampling/src/test/java/org/apache/commons/rng/sampling/distribution/PoissonSamplerCacheTest.java
+++ b/commons-rng-sampling/src/test/java/org/apache/commons/rng/sampling/distribution/PoissonSamplerCacheTest.java
@@ -19,7 +19,7 @@ package org.apache.commons.rng.sampling.distribution;
 import org.apache.commons.rng.RestorableUniformRandomProvider;
 import org.apache.commons.rng.simple.RandomSource;
 import org.junit.jupiter.api.Assertions;
-import org.junit.Test;
+import org.junit.jupiter.api.Test;
 
 /**
  * This test checks the {@link PoissonSamplerCache} functions exactly like the
diff --git a/commons-rng-sampling/src/test/java/org/apache/commons/rng/sampling/distribution/PoissonSamplerTest.java b/commons-rng-sampling/src/test/java/org/apache/commons/rng/sampling/distribution/PoissonSamplerTest.java
index 63cc85b..0def459 100644
--- a/commons-rng-sampling/src/test/java/org/apache/commons/rng/sampling/distribution/PoissonSamplerTest.java
+++ b/commons-rng-sampling/src/test/java/org/apache/commons/rng/sampling/distribution/PoissonSamplerTest.java
@@ -20,7 +20,7 @@ import org.apache.commons.rng.UniformRandomProvider;
 import org.apache.commons.rng.sampling.RandomAssert;
 import org.apache.commons.rng.simple.RandomSource;
 import org.junit.jupiter.api.Assertions;
-import org.junit.Test;
+import org.junit.jupiter.api.Test;
 
 
 /**
diff --git a/commons-rng-sampling/src/test/java/org/apache/commons/rng/sampling/distribution/RejectionInversionZipfSamplerTest.java b/commons-rng-sampling/src/test/java/org/apache/commons/rng/sampling/distribution/RejectionInversionZipfSamplerTest.java
index 70e8f27..9e640af 100644
--- a/commons-rng-sampling/src/test/java/org/apache/commons/rng/sampling/distribution/RejectionInversionZipfSamplerTest.java
+++ b/commons-rng-sampling/src/test/java/org/apache/commons/rng/sampling/distribution/RejectionInversionZipfSamplerTest.java
@@ -20,7 +20,7 @@ import org.apache.commons.rng.RestorableUniformRandomProvider;
 import org.apache.commons.rng.UniformRandomProvider;
 import org.apache.commons.rng.sampling.RandomAssert;
 import org.apache.commons.rng.simple.RandomSource;
-import org.junit.Test;
+import org.junit.jupiter.api.Test;
 import org.junit.jupiter.api.Assertions;
 
 /**
diff --git a/commons-rng-sampling/src/test/java/org/apache/commons/rng/sampling/distribution/SamplerBaseTest.java b/commons-rng-sampling/src/test/java/org/apache/commons/rng/sampling/distribution/SamplerBaseTest.java
index e5e97cb..52018e4 100644
--- a/commons-rng-sampling/src/test/java/org/apache/commons/rng/sampling/distribution/SamplerBaseTest.java
+++ b/commons-rng-sampling/src/test/java/org/apache/commons/rng/sampling/distribution/SamplerBaseTest.java
@@ -19,7 +19,7 @@ package org.apache.commons.rng.sampling.distribution;
 import org.apache.commons.rng.UniformRandomProvider;
 import org.apache.commons.rng.simple.RandomSource;
 import org.junit.jupiter.api.Assertions;
-import org.junit.Test;
+import org.junit.jupiter.api.Test;
 
 /**
  * Test for the {@link SamplerBase}. The class is deprecated but is public. The methods
diff --git a/commons-rng-sampling/src/test/java/org/apache/commons/rng/sampling/distribution/SmallMeanPoissonSamplerTest.java b/commons-rng-sampling/src/test/java/org/apache/commons/rng/sampling/distribution/SmallMeanPoissonSamplerTest.java
index 617d96c..37de4ea 100644
--- a/commons-rng-sampling/src/test/java/org/apache/commons/rng/sampling/distribution/SmallMeanPoissonSamplerTest.java
+++ b/commons-rng-sampling/src/test/java/org/apache/commons/rng/sampling/distribution/SmallMeanPoissonSamplerTest.java
@@ -20,7 +20,7 @@ import org.apache.commons.rng.UniformRandomProvider;
 import org.apache.commons.rng.sampling.RandomAssert;
 import org.apache.commons.rng.simple.RandomSource;
 import org.junit.jupiter.api.Assertions;
-import org.junit.Test;
+import org.junit.jupiter.api.Test;
 
 /**
  * Test for the {@link SmallMeanPoissonSampler}. The tests hit edge cases for the sampler.
diff --git a/commons-rng-sampling/src/test/java/org/apache/commons/rng/sampling/distribution/StableSamplerTest.java b/commons-rng-sampling/src/test/java/org/apache/commons/rng/sampling/distribution/StableSamplerTest.java
index 70964e7..b5c2399 100644
--- a/commons-rng-sampling/src/test/java/org/apache/commons/rng/sampling/distribution/StableSamplerTest.java
+++ b/commons-rng-sampling/src/test/java/org/apache/commons/rng/sampling/distribution/StableSamplerTest.java
@@ -17,7 +17,7 @@
 package org.apache.commons.rng.sampling.distribution;
 
 import org.junit.jupiter.api.Assertions;
-import org.junit.Test;
+import org.junit.jupiter.api.Test;
 import java.util.function.Supplier;
 import org.apache.commons.rng.UniformRandomProvider;
 import org.apache.commons.rng.core.source64.SplitMix64;
diff --git a/commons-rng-sampling/src/test/java/org/apache/commons/rng/sampling/distribution/UniformLongSamplerTest.java b/commons-rng-sampling/src/test/java/org/apache/commons/rng/sampling/distribution/UniformLongSamplerTest.java
index 1019bf2..5f8c10b 100644
--- a/commons-rng-sampling/src/test/java/org/apache/commons/rng/sampling/distribution/UniformLongSamplerTest.java
+++ b/commons-rng-sampling/src/test/java/org/apache/commons/rng/sampling/distribution/UniformLongSamplerTest.java
@@ -22,7 +22,7 @@ import org.apache.commons.rng.core.source64.SplitMix64;
 import org.apache.commons.rng.sampling.RandomAssert;
 import org.apache.commons.rng.simple.RandomSource;
 import org.junit.jupiter.api.Assertions;
-import org.junit.Test;
+import org.junit.jupiter.api.Test;
 
 import java.util.Locale;
 
diff --git a/commons-rng-sampling/src/test/java/org/apache/commons/rng/sampling/distribution/ZigguratNormalizedGaussianSamplerTest.java b/commons-rng-sampling/src/test/java/org/apache/commons/rng/sampling/distribution/ZigguratNormalizedGaussianSamplerTest.java
index 95aa7ce..dbb03a6 100644
--- a/commons-rng-sampling/src/test/java/org/apache/commons/rng/sampling/distribution/ZigguratNormalizedGaussianSamplerTest.java
+++ b/commons-rng-sampling/src/test/java/org/apache/commons/rng/sampling/distribution/ZigguratNormalizedGaussianSamplerTest.java
@@ -16,7 +16,7 @@
  */
 package org.apache.commons.rng.sampling.distribution;
 
-import org.junit.Test;
+import org.junit.jupiter.api.Test;
 import org.junit.jupiter.api.Assertions;
 import org.apache.commons.rng.UniformRandomProvider;
 import org.apache.commons.rng.sampling.RandomAssert;
diff --git a/commons-rng-sampling/src/test/java/org/apache/commons/rng/sampling/distribution/ZigguratSamplerTest.java b/commons-rng-sampling/src/test/java/org/apache/commons/rng/sampling/distribution/ZigguratSamplerTest.java
index e31a48b..59e2bc3 100644
--- a/commons-rng-sampling/src/test/java/org/apache/commons/rng/sampling/distribution/ZigguratSamplerTest.java
+++ b/commons-rng-sampling/src/test/java/org/apache/commons/rng/sampling/distribution/ZigguratSamplerTest.java
@@ -17,7 +17,7 @@
 package org.apache.commons.rng.sampling.distribution;
 
 import org.junit.jupiter.api.Assertions;
-import org.junit.Test;
+import org.junit.jupiter.api.Test;
 import java.util.Arrays;
 import org.apache.commons.math3.distribution.AbstractRealDistribution;
 import org.apache.commons.math3.distribution.ExponentialDistribution;
diff --git a/commons-rng-sampling/src/test/java/org/apache/commons/rng/sampling/shape/BoxSamplerTest.java b/commons-rng-sampling/src/test/java/org/apache/commons/rng/sampling/shape/BoxSamplerTest.java
index ea31084..a7ca761 100644
--- a/commons-rng-sampling/src/test/java/org/apache/commons/rng/sampling/shape/BoxSamplerTest.java
+++ b/commons-rng-sampling/src/test/java/org/apache/commons/rng/sampling/shape/BoxSamplerTest.java
@@ -19,7 +19,7 @@ package org.apache.commons.rng.sampling.shape;
 import java.util.Arrays;
 
 import org.junit.jupiter.api.Assertions;
-import org.junit.Test;
+import org.junit.jupiter.api.Test;
 
 import org.apache.commons.math3.stat.inference.ChiSquareTest;
 
diff --git a/commons-rng-sampling/src/test/java/org/apache/commons/rng/sampling/shape/CoordinatesTest.java b/commons-rng-sampling/src/test/java/org/apache/commons/rng/sampling/shape/CoordinatesTest.java
index 941b58f..bde6f0f 100644
--- a/commons-rng-sampling/src/test/java/org/apache/commons/rng/sampling/shape/CoordinatesTest.java
+++ b/commons-rng-sampling/src/test/java/org/apache/commons/rng/sampling/shape/CoordinatesTest.java
@@ -17,7 +17,7 @@
 package org.apache.commons.rng.sampling.shape;
 
 import org.junit.jupiter.api.Assertions;
-import org.junit.Test;
+import org.junit.jupiter.api.Test;
 
 /**
  * Test for {@link Coordinates} utility class.
diff --git a/commons-rng-sampling/src/test/java/org/apache/commons/rng/sampling/shape/LineSamplerTest.java b/commons-rng-sampling/src/test/java/org/apache/commons/rng/sampling/shape/LineSamplerTest.java
index a8084b9..1f0aca1 100644
--- a/commons-rng-sampling/src/test/java/org/apache/commons/rng/sampling/shape/LineSamplerTest.java
+++ b/commons-rng-sampling/src/test/java/org/apache/commons/rng/sampling/shape/LineSamplerTest.java
@@ -19,7 +19,7 @@ package org.apache.commons.rng.sampling.shape;
 import java.util.Arrays;
 
 import org.junit.jupiter.api.Assertions;
-import org.junit.Test;
+import org.junit.jupiter.api.Test;
 
 import org.apache.commons.math3.stat.inference.ChiSquareTest;
 
diff --git a/commons-rng-sampling/src/test/java/org/apache/commons/rng/sampling/shape/TetrahedronSamplerTest.java b/commons-rng-sampling/src/test/java/org/apache/commons/rng/sampling/shape/TetrahedronSamplerTest.java
index 37b2280..7a2281b 100644
--- a/commons-rng-sampling/src/test/java/org/apache/commons/rng/sampling/shape/TetrahedronSamplerTest.java
+++ b/commons-rng-sampling/src/test/java/org/apache/commons/rng/sampling/shape/TetrahedronSamplerTest.java
@@ -19,7 +19,7 @@ package org.apache.commons.rng.sampling.shape;
 import java.util.Arrays;
 
 import org.junit.jupiter.api.Assertions;
-import org.junit.Test;
+import org.junit.jupiter.api.Test;
 
 import org.apache.commons.math3.stat.inference.ChiSquareTest;
 
diff --git a/commons-rng-sampling/src/test/java/org/apache/commons/rng/sampling/shape/TriangleSamplerTest.java b/commons-rng-sampling/src/test/java/org/apache/commons/rng/sampling/shape/TriangleSamplerTest.java
index 149d8ad..b5a6495 100644
--- a/commons-rng-sampling/src/test/java/org/apache/commons/rng/sampling/shape/TriangleSamplerTest.java
+++ b/commons-rng-sampling/src/test/java/org/apache/commons/rng/sampling/shape/TriangleSamplerTest.java
@@ -19,7 +19,7 @@ package org.apache.commons.rng.sampling.shape;
 import java.util.Arrays;
 
 import org.junit.jupiter.api.Assertions;
-import org.junit.Test;
+import org.junit.jupiter.api.Test;
 
 import org.apache.commons.math3.stat.inference.ChiSquareTest;
 
diff --git a/commons-rng-sampling/src/test/java/org/apache/commons/rng/sampling/shape/UnitBallSamplerTest.java b/commons-rng-sampling/src/test/java/org/apache/commons/rng/sampling/shape/UnitBallSamplerTest.java
index 7617bcf..b7d242d 100644
--- a/commons-rng-sampling/src/test/java/org/apache/commons/rng/sampling/shape/UnitBallSamplerTest.java
+++ b/commons-rng-sampling/src/test/java/org/apache/commons/rng/sampling/shape/UnitBallSamplerTest.java
@@ -19,7 +19,7 @@ package org.apache.commons.rng.sampling.shape;
 import java.util.Arrays;
 import java.util.function.DoubleUnaryOperator;
 import org.junit.jupiter.api.Assertions;
-import org.junit.Test;
+import org.junit.jupiter.api.Test;
 
 import org.apache.commons.math3.stat.inference.ChiSquareTest;
 
diff --git a/commons-rng-simple/src/test/java/org/apache/commons/rng/simple/JDKRandomBridgeTest.java b/commons-rng-simple/src/test/java/org/apache/commons/rng/simple/JDKRandomBridgeTest.java
index e920400..d470b6c 100644
--- a/commons-rng-simple/src/test/java/org/apache/commons/rng/simple/JDKRandomBridgeTest.java
+++ b/commons-rng-simple/src/test/java/org/apache/commons/rng/simple/JDKRandomBridgeTest.java
@@ -23,7 +23,7 @@ import java.io.ByteArrayOutputStream;
 import java.io.ByteArrayInputStream;
 import java.util.Random;
 import org.junit.jupiter.api.Assertions;
-import org.junit.Test;
+import org.junit.jupiter.api.Test;
 
 /**
  * Tests for the {@link JDKRandomBridge} adaptor class.
diff --git a/commons-rng-simple/src/test/java/org/apache/commons/rng/simple/JDKRandomWrapperTest.java b/commons-rng-simple/src/test/java/org/apache/commons/rng/simple/JDKRandomWrapperTest.java
index 5effced..0cdd20b 100644
--- a/commons-rng-simple/src/test/java/org/apache/commons/rng/simple/JDKRandomWrapperTest.java
+++ b/commons-rng-simple/src/test/java/org/apache/commons/rng/simple/JDKRandomWrapperTest.java
@@ -21,7 +21,7 @@ import java.util.Random;
 import org.apache.commons.rng.UniformRandomProvider;
 import org.apache.commons.rng.core.source64.LongProvider;
 import org.junit.jupiter.api.Assertions;
-import org.junit.Test;
+import org.junit.jupiter.api.Test;
 
 /**
  * Tests for the {@link JDKRandomWrapper} class.
diff --git a/commons-rng-simple/src/test/java/org/apache/commons/rng/simple/RandomSourceTest.java b/commons-rng-simple/src/test/java/org/apache/commons/rng/simple/RandomSourceTest.java
index b4e983c..1b884e6 100644
--- a/commons-rng-simple/src/test/java/org/apache/commons/rng/simple/RandomSourceTest.java
+++ b/commons-rng-simple/src/test/java/org/apache/commons/rng/simple/RandomSourceTest.java
@@ -17,7 +17,7 @@
 package org.apache.commons.rng.simple;
 
 import org.junit.jupiter.api.Assertions;
-import org.junit.Test;
+import org.junit.jupiter.api.Test;
 
 /**
  * Tests for {@link RandomSource}.
diff --git a/commons-rng-simple/src/test/java/org/apache/commons/rng/simple/ThreadLocalRandomSourceTest.java b/commons-rng-simple/src/test/java/org/apache/commons/rng/simple/ThreadLocalRandomSourceTest.java
index a100973..78fb31b 100644
--- a/commons-rng-simple/src/test/java/org/apache/commons/rng/simple/ThreadLocalRandomSourceTest.java
+++ b/commons-rng-simple/src/test/java/org/apache/commons/rng/simple/ThreadLocalRandomSourceTest.java
@@ -18,8 +18,8 @@ package org.apache.commons.rng.simple;
 
 import org.apache.commons.rng.UniformRandomProvider;
 import org.junit.jupiter.api.Assertions;
-import org.junit.BeforeClass;
-import org.junit.Test;
+import org.junit.jupiter.api.BeforeAll;
+import org.junit.jupiter.api.Test;
 
 import java.util.EnumSet;
 import java.util.concurrent.ExecutionException;
@@ -39,7 +39,7 @@ public class ThreadLocalRandomSourceTest {
      */
     private static EnumSet<RandomSource> toIgnore;
 
-    @BeforeClass
+    @BeforeAll
     public static void createToIgnoreSet() {
         toIgnore = EnumSet.of(RandomSource.TWO_CMRES_SELECT);
     }
diff --git a/commons-rng-simple/src/test/java/org/apache/commons/rng/simple/internal/ByteArray2IntArrayTest.java b/commons-rng-simple/src/test/java/org/apache/commons/rng/simple/internal/ByteArray2IntArrayTest.java
index b3980d8..d9f0ccc 100644
--- a/commons-rng-simple/src/test/java/org/apache/commons/rng/simple/internal/ByteArray2IntArrayTest.java
+++ b/commons-rng-simple/src/test/java/org/apache/commons/rng/simple/internal/ByteArray2IntArrayTest.java
@@ -17,7 +17,7 @@
 package org.apache.commons.rng.simple.internal;
 
 import org.junit.jupiter.api.Assertions;
-import org.junit.Test;
+import org.junit.jupiter.api.Test;
 
 /**
  * Tests for the {@link ByteArray2IntArray} converter.
diff --git a/commons-rng-simple/src/test/java/org/apache/commons/rng/simple/internal/ByteArray2LongArrayTest.java b/commons-rng-simple/src/test/java/org/apache/commons/rng/simple/internal/ByteArray2LongArrayTest.java
index a681738..135343e 100644
--- a/commons-rng-simple/src/test/java/org/apache/commons/rng/simple/internal/ByteArray2LongArrayTest.java
+++ b/commons-rng-simple/src/test/java/org/apache/commons/rng/simple/internal/ByteArray2LongArrayTest.java
@@ -17,7 +17,7 @@
 package org.apache.commons.rng.simple.internal;
 
 import org.junit.jupiter.api.Assertions;
-import org.junit.Test;
+import org.junit.jupiter.api.Test;
 
 /**
  * Tests for the {@link ByteArray2LongArray} converter.
diff --git a/commons-rng-simple/src/test/java/org/apache/commons/rng/simple/internal/IntArray2LongArrayTest.java b/commons-rng-simple/src/test/java/org/apache/commons/rng/simple/internal/IntArray2LongArrayTest.java
index 4a276dd..dacc593 100644
--- a/commons-rng-simple/src/test/java/org/apache/commons/rng/simple/internal/IntArray2LongArrayTest.java
+++ b/commons-rng-simple/src/test/java/org/apache/commons/rng/simple/internal/IntArray2LongArrayTest.java
@@ -17,7 +17,7 @@
 package org.apache.commons.rng.simple.internal;
 
 import org.junit.jupiter.api.Assertions;
-import org.junit.Test;
+import org.junit.jupiter.api.Test;
 
 /**
  * Tests for the {@link IntArray2LongArray} converter.
diff --git a/commons-rng-simple/src/test/java/org/apache/commons/rng/simple/internal/Long2IntArrayTest.java b/commons-rng-simple/src/test/java/org/apache/commons/rng/simple/internal/Long2IntArrayTest.java
index 7a2d04d..8d49ceb 100644
--- a/commons-rng-simple/src/test/java/org/apache/commons/rng/simple/internal/Long2IntArrayTest.java
+++ b/commons-rng-simple/src/test/java/org/apache/commons/rng/simple/internal/Long2IntArrayTest.java
@@ -17,7 +17,7 @@
 package org.apache.commons.rng.simple.internal;
 
 import org.junit.jupiter.api.Assertions;
-import org.junit.Test;
+import org.junit.jupiter.api.Test;
 
 /**
  * Tests for the {@link Long2IntArray} converter.
diff --git a/commons-rng-simple/src/test/java/org/apache/commons/rng/simple/internal/Long2LongArrayTest.java b/commons-rng-simple/src/test/java/org/apache/commons/rng/simple/internal/Long2LongArrayTest.java
index d0efaef..20920fa 100644
--- a/commons-rng-simple/src/test/java/org/apache/commons/rng/simple/internal/Long2LongArrayTest.java
+++ b/commons-rng-simple/src/test/java/org/apache/commons/rng/simple/internal/Long2LongArrayTest.java
@@ -17,7 +17,7 @@
 package org.apache.commons.rng.simple.internal;
 
 import org.junit.jupiter.api.Assertions;
-import org.junit.Test;
+import org.junit.jupiter.api.Test;
 
 /**
  * Tests for the {@link Long2LongArray} converter.
diff --git a/commons-rng-simple/src/test/java/org/apache/commons/rng/simple/internal/NativeSeedTypeParametricTest.java b/commons-rng-simple/src/test/java/org/apache/commons/rng/simple/internal/NativeSeedTypeParametricTest.java
index e9bb527..67522d1 100644
--- a/commons-rng-simple/src/test/java/org/apache/commons/rng/simple/internal/NativeSeedTypeParametricTest.java
+++ b/commons-rng-simple/src/test/java/org/apache/commons/rng/simple/internal/NativeSeedTypeParametricTest.java
@@ -19,7 +19,7 @@ package org.apache.commons.rng.simple.internal;
 import org.junit.jupiter.api.Assertions;
 import org.junit.jupiter.params.ParameterizedTest;
 import org.junit.jupiter.params.provider.EnumSource;
-import org.junit.Test;
+import org.junit.jupiter.api.Test;
 
 import java.lang.reflect.Array;
 import java.util.Arrays;
diff --git a/commons-rng-simple/src/test/java/org/apache/commons/rng/simple/internal/NativeSeedTypeTest.java b/commons-rng-simple/src/test/java/org/apache/commons/rng/simple/internal/NativeSeedTypeTest.java
index 96c540d..6b9b3d6 100644
--- a/commons-rng-simple/src/test/java/org/apache/commons/rng/simple/internal/NativeSeedTypeTest.java
+++ b/commons-rng-simple/src/test/java/org/apache/commons/rng/simple/internal/NativeSeedTypeTest.java
@@ -17,7 +17,7 @@
 package org.apache.commons.rng.simple.internal;
 
 import org.junit.jupiter.api.Assertions;
-import org.junit.Test;
+import org.junit.jupiter.api.Test;
 
 /**
  * Tests for the {@link NativeSeedType} factory seed conversions.
diff --git a/commons-rng-simple/src/test/java/org/apache/commons/rng/simple/internal/NoOpConverterTest.java b/commons-rng-simple/src/test/java/org/apache/commons/rng/simple/internal/NoOpConverterTest.java
index db4e270..d74bbc6 100644
--- a/commons-rng-simple/src/test/java/org/apache/commons/rng/simple/internal/NoOpConverterTest.java
+++ b/commons-rng-simple/src/test/java/org/apache/commons/rng/simple/internal/NoOpConverterTest.java
@@ -17,7 +17,7 @@
 package org.apache.commons.rng.simple.internal;
 
 import org.junit.jupiter.api.Assertions;
-import org.junit.Test;
+import org.junit.jupiter.api.Test;
 
 /**
  * Tests for the {@link NoOpConverter}.
diff --git a/commons-rng-simple/src/test/java/org/apache/commons/rng/simple/internal/SeedConverterComposerTest.java b/commons-rng-simple/src/test/java/org/apache/commons/rng/simple/internal/SeedConverterComposerTest.java
index ea3a838..610cab9 100644
--- a/commons-rng-simple/src/test/java/org/apache/commons/rng/simple/internal/SeedConverterComposerTest.java
+++ b/commons-rng-simple/src/test/java/org/apache/commons/rng/simple/internal/SeedConverterComposerTest.java
@@ -17,7 +17,7 @@
 package org.apache.commons.rng.simple.internal;
 
 import org.junit.jupiter.api.Assertions;
-import org.junit.Test;
+import org.junit.jupiter.api.Test;
 
 /**
  * Tests for the {@link SeedConverterComposer}.
diff --git a/commons-rng-simple/src/test/java/org/apache/commons/rng/simple/internal/SeedFactoryTest.java b/commons-rng-simple/src/test/java/org/apache/commons/rng/simple/internal/SeedFactoryTest.java
index ab6fe36..6e60026 100644
--- a/commons-rng-simple/src/test/java/org/apache/commons/rng/simple/internal/SeedFactoryTest.java
+++ b/commons-rng-simple/src/test/java/org/apache/commons/rng/simple/internal/SeedFactoryTest.java
@@ -19,7 +19,7 @@ package org.apache.commons.rng.simple.internal;
 import java.util.Map;
 import java.util.HashMap;
 import org.junit.jupiter.api.Assertions;
-import org.junit.Test;
+import org.junit.jupiter.api.Test;
 import org.apache.commons.rng.UniformRandomProvider;
 import org.apache.commons.rng.core.source32.IntProvider;
 import org.apache.commons.rng.core.source64.RandomLongSource;
diff --git a/commons-rng-simple/src/test/java/org/apache/commons/rng/simple/internal/SeedUtilsTest.java b/commons-rng-simple/src/test/java/org/apache/commons/rng/simple/internal/SeedUtilsTest.java
index d14373e..625329e 100644
--- a/commons-rng-simple/src/test/java/org/apache/commons/rng/simple/internal/SeedUtilsTest.java
+++ b/commons-rng-simple/src/test/java/org/apache/commons/rng/simple/internal/SeedUtilsTest.java
@@ -21,7 +21,7 @@ import org.apache.commons.math3.stat.inference.ChiSquareTest;
 import org.apache.commons.rng.UniformRandomProvider;
 import org.apache.commons.rng.core.source64.SplitMix64;
 import org.junit.jupiter.api.Assertions;
-import org.junit.Test;
+import org.junit.jupiter.api.Test;
 
 import java.util.Arrays;
 

[commons-rng] 10/13: Use diamond operator

Posted by ah...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

aherbert pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/commons-rng.git

commit 6767b5cc0c5cf3340a3cafbf9c1f267d4a01d066
Author: Alex Herbert <ah...@apache.org>
AuthorDate: Mon Aug 16 22:10:12 2021 +0100

    Use diamond operator
---
 .../commons/rng/sampling/ListSamplerTest.java      | 64 +++++++++++-----------
 1 file changed, 32 insertions(+), 32 deletions(-)

diff --git a/commons-rng-sampling/src/test/java/org/apache/commons/rng/sampling/ListSamplerTest.java b/commons-rng-sampling/src/test/java/org/apache/commons/rng/sampling/ListSamplerTest.java
index 1c15f74..76f2e10 100644
--- a/commons-rng-sampling/src/test/java/org/apache/commons/rng/sampling/ListSamplerTest.java
+++ b/commons-rng-sampling/src/test/java/org/apache/commons/rng/sampling/ListSamplerTest.java
@@ -49,21 +49,21 @@ public class ListSamplerTest {
         final long[] observed = {0, 0, 0, 0, 0, 0, 0, 0, 0, 0};
         final double[] expected = {100, 100, 100, 100, 100, 100, 100, 100, 100, 100};
 
-        final HashSet<String> cPop = new HashSet<String>(); // {0, 1, 2, 3, 4}.
+        final HashSet<String> cPop = new HashSet<>(); // {0, 1, 2, 3, 4}.
         for (int i = 0; i < 5; i++) {
             cPop.add(Integer.toString(i));
         }
 
-        final List<Set<String>> sets = new ArrayList<Set<String>>(); // 2-sets from 5.
+        final List<Set<String>> sets = new ArrayList<>(); // 2-sets from 5.
         for (int i = 0; i < 10; i++) {
-            final HashSet<String> hs = new HashSet<String>();
+            final HashSet<String> hs = new HashSet<>();
             hs.add(c[i][0]);
             hs.add(c[i][1]);
             sets.add(hs);
         }
 
         for (int i = 0; i < 1000; i++) {
-            observed[findSample(sets, ListSampler.sample(rng, new ArrayList<String>(cPop), 2))]++;
+            observed[findSample(sets, ListSampler.sample(rng, new ArrayList<>(cPop), 2))]++;
         }
 
         // Pass if we cannot reject null hypothesis that distributions are the same.
@@ -73,7 +73,7 @@ public class ListSamplerTest {
     @Test
     public void testSampleWhole() {
         // Sample of size = size of collection must return the same collection.
-        final List<String> list = new ArrayList<String>();
+        final List<String> list = new ArrayList<>();
         list.add("one");
 
         final List<String> one = ListSampler.sample(rng, list, 1);
@@ -84,7 +84,7 @@ public class ListSamplerTest {
     @Test
     public void testSamplePrecondition1() {
         // Must fail for sample size > collection size.
-        final List<String> list = new ArrayList<String>();
+        final List<String> list = new ArrayList<>();
         list.add("one");
         Assertions.assertThrows(IllegalArgumentException.class,
             () -> ListSampler.sample(rng, list, 2));
@@ -93,25 +93,25 @@ public class ListSamplerTest {
     @Test
     public void testSamplePrecondition2() {
         // Must fail for empty collection.
-        final List<String> list = new ArrayList<String>();
+        final List<String> list = new ArrayList<>();
         Assertions.assertThrows(IllegalArgumentException.class,
             () -> ListSampler.sample(rng, list, 1));
     }
 
     @Test
     public void testShuffle() {
-        final List<Integer> orig = new ArrayList<Integer>();
+        final List<Integer> orig = new ArrayList<>();
         for (int i = 0; i < 10; i++) {
             orig.add((i + 1) * rng.nextInt());
         }
 
-        final List<Integer> arrayList = new ArrayList<Integer>(orig);
+        final List<Integer> arrayList = new ArrayList<>(orig);
 
         ListSampler.shuffle(rng, arrayList);
         // Ensure that at least one entry has moved.
         Assertions.assertTrue(compare(orig, arrayList, 0, orig.size(), false), "ArrayList");
 
-        final List<Integer> linkedList = new LinkedList<Integer>(orig);
+        final List<Integer> linkedList = new LinkedList<>(orig);
 
         ListSampler.shuffle(rng, linkedList);
         // Ensure that at least one entry has moved.
@@ -120,11 +120,11 @@ public class ListSamplerTest {
 
     @Test
     public void testShuffleTail() {
-        final List<Integer> orig = new ArrayList<Integer>();
+        final List<Integer> orig = new ArrayList<>();
         for (int i = 0; i < 10; i++) {
             orig.add((i + 1) * rng.nextInt());
         }
-        final List<Integer> list = new ArrayList<Integer>(orig);
+        final List<Integer> list = new ArrayList<>(orig);
 
         final int start = 4;
         ListSampler.shuffle(rng, list, start, false);
@@ -138,11 +138,11 @@ public class ListSamplerTest {
 
     @Test
     public void testShuffleHead() {
-        final List<Integer> orig = new ArrayList<Integer>();
+        final List<Integer> orig = new ArrayList<>();
         for (int i = 0; i < 10; i++) {
             orig.add((i + 1) * rng.nextInt());
         }
-        final List<Integer> list = new ArrayList<Integer>(orig);
+        final List<Integer> list = new ArrayList<>(orig);
 
         final int start = 4;
         ListSampler.shuffle(rng, list, start, true);
@@ -161,13 +161,13 @@ public class ListSamplerTest {
      */
     @Test
     public void testShuffleMatchesPermutationSamplerShuffle() {
-        final List<Integer> orig = new ArrayList<Integer>();
+        final List<Integer> orig = new ArrayList<>();
         for (int i = 0; i < 10; i++) {
             orig.add((i + 1) * rng.nextInt());
         }
 
-        assertShuffleMatchesPermutationSamplerShuffle(new ArrayList<Integer>(orig));
-        assertShuffleMatchesPermutationSamplerShuffle(new LinkedList<Integer>(orig));
+        assertShuffleMatchesPermutationSamplerShuffle(new ArrayList<>(orig));
+        assertShuffleMatchesPermutationSamplerShuffle(new LinkedList<>(orig));
     }
 
     /**
@@ -177,15 +177,15 @@ public class ListSamplerTest {
      */
     @Test
     public void testShuffleMatchesPermutationSamplerShuffleDirectional() {
-        final List<Integer> orig = new ArrayList<Integer>();
+        final List<Integer> orig = new ArrayList<>();
         for (int i = 0; i < 10; i++) {
             orig.add((i + 1) * rng.nextInt());
         }
 
-        assertShuffleMatchesPermutationSamplerShuffle(new ArrayList<Integer>(orig), 4, true);
-        assertShuffleMatchesPermutationSamplerShuffle(new ArrayList<Integer>(orig), 4, false);
-        assertShuffleMatchesPermutationSamplerShuffle(new LinkedList<Integer>(orig), 4, true);
-        assertShuffleMatchesPermutationSamplerShuffle(new LinkedList<Integer>(orig), 4, false);
+        assertShuffleMatchesPermutationSamplerShuffle(new ArrayList<>(orig), 4, true);
+        assertShuffleMatchesPermutationSamplerShuffle(new ArrayList<>(orig), 4, false);
+        assertShuffleMatchesPermutationSamplerShuffle(new LinkedList<>(orig), 4, true);
+        assertShuffleMatchesPermutationSamplerShuffle(new LinkedList<>(orig), 4, false);
     }
 
     /**
@@ -195,7 +195,7 @@ public class ListSamplerTest {
     @Test
     public void testShuffleWithSmallLinkedList() {
         final int size = 3;
-        final List<Integer> orig = new ArrayList<Integer>();
+        final List<Integer> orig = new ArrayList<>();
         for (int i = 0; i < size; i++) {
             orig.add((i + 1) * rng.nextInt());
         }
@@ -205,7 +205,7 @@ public class ListSamplerTest {
         // So repeat test that the small shuffle matches the PermutationSampler.
         // 10 times is (1/6)^10 or 1 in 60,466,176 of no change.
         for (int i = 0; i < 10; i++) {
-            assertShuffleMatchesPermutationSamplerShuffle(new LinkedList<Integer>(orig), size - 1, true);
+            assertShuffleMatchesPermutationSamplerShuffle(new LinkedList<>(orig), size - 1, true);
         }
     }
 
@@ -216,11 +216,11 @@ public class ListSamplerTest {
      * the same; if {@code same == false}, return {@code true} if at
      * least one entry is different.
      */
-    private <T> boolean compare(List<T> orig,
-                                List<T> list,
-                                int start,
-                                int end,
-                                boolean same) {
+    private static <T> boolean compare(List<T> orig,
+                                       List<T> list,
+                                       int start,
+                                       int end,
+                                       boolean same) {
         for (int i = start; i < end; i++) {
             if (!orig.get(i).equals(list.get(i))) {
                 return same ? false : true;
@@ -229,12 +229,12 @@ public class ListSamplerTest {
         return same ? true : false;
     }
 
-    private <T extends Set<String>> int findSample(List<T> u,
-                                                   Collection<String> sampList) {
+    private static <T extends Set<String>> int findSample(List<T> u,
+                                                          Collection<String> sampList) {
         final String[] samp = sampList.toArray(new String[sampList.size()]);
         for (int i = 0; i < u.size(); i++) {
             final T set = u.get(i);
-            final HashSet<String> sampSet = new HashSet<String>();
+            final HashSet<String> sampSet = new HashSet<>();
             for (int j = 0; j < samp.length; j++) {
                 sampSet.add(samp[j]);
             }

[commons-rng] 01/13: RNG-163: Update pom dependency JUnit 4 to JUnit 5

Posted by ah...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

aherbert pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/commons-rng.git

commit 46dbfb2155799b9a810876f4e3e53b1de2caabe7
Author: Alex Herbert <ah...@apache.org>
AuthorDate: Sun Aug 15 09:19:20 2021 +0100

    RNG-163: Update pom dependency JUnit 4 to JUnit 5
    
    Inclusion of the junit-vintage-engine allows all existing tests to run.
---
 pom.xml | 13 ++++++++++---
 1 file changed, 10 insertions(+), 3 deletions(-)

diff --git a/pom.xml b/pom.xml
index 4f7b9bf..815c8c3 100644
--- a/pom.xml
+++ b/pom.xml
@@ -60,6 +60,7 @@
     <rng.mathjax.url>https://cdn.jsdelivr.net/npm/mathjax@3/es5/tex-mml-chtml.js</rng.mathjax.url>
     <rng.antrun.version>1.8</rng.antrun.version>
     <rng.surefire.version>3.0.0-M5</rng.surefire.version>
+    <rng.junit5.version>5.7.2</rng.junit5.version>
     <!-- Workaround to avoid duplicating config files. -->
     <rng.parent.dir>${basedir}</rng.parent.dir>
 
@@ -133,9 +134,15 @@
 
   <dependencies>
     <dependency>
-      <groupId>junit</groupId>
-      <artifactId>junit</artifactId>
-      <version>4.13.2</version>
+      <groupId>org.junit.jupiter</groupId>
+      <artifactId>junit-jupiter</artifactId>
+      <version>${rng.junit5.version}</version>
+      <scope>test</scope>
+    </dependency>
+    <dependency>
+      <groupId>org.junit.vintage</groupId>
+      <artifactId>junit-vintage-engine</artifactId>
+      <version>${rng.junit5.version}</version>
       <scope>test</scope>
     </dependency>
   </dependencies>

[commons-rng] 09/13: Drop redundant array to Arrays.asList

Posted by ah...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

aherbert pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/commons-rng.git

commit eef475ec748398d3d44ea9deb6705a3fa030b2de
Author: Alex Herbert <ah...@apache.org>
AuthorDate: Mon Aug 16 22:06:04 2021 +0100

    Drop redundant array to Arrays.asList
---
 .../DiscreteProbabilityCollectionSamplerTest.java        | 16 ++++++++--------
 1 file changed, 8 insertions(+), 8 deletions(-)

diff --git a/commons-rng-sampling/src/test/java/org/apache/commons/rng/sampling/DiscreteProbabilityCollectionSamplerTest.java b/commons-rng-sampling/src/test/java/org/apache/commons/rng/sampling/DiscreteProbabilityCollectionSamplerTest.java
index ca4025a..ea9d1b2 100644
--- a/commons-rng-sampling/src/test/java/org/apache/commons/rng/sampling/DiscreteProbabilityCollectionSamplerTest.java
+++ b/commons-rng-sampling/src/test/java/org/apache/commons/rng/sampling/DiscreteProbabilityCollectionSamplerTest.java
@@ -41,7 +41,7 @@ public class DiscreteProbabilityCollectionSamplerTest {
         // Size mismatch
         Assertions.assertThrows(IllegalArgumentException.class,
             () -> new DiscreteProbabilityCollectionSampler<>(rng,
-                 Arrays.asList(new Double[] {1d, 2d}),
+                 Arrays.asList(1d, 2d),
                  new double[] {0d}));
     }
 
@@ -50,7 +50,7 @@ public class DiscreteProbabilityCollectionSamplerTest {
         // Negative probability
         Assertions.assertThrows(IllegalArgumentException.class,
             () -> new DiscreteProbabilityCollectionSampler<>(rng,
-                 Arrays.asList(new Double[] {1d, 2d}),
+                 Arrays.asList(1d, 2d),
                  new double[] {0d, -1d}));
     }
 
@@ -59,7 +59,7 @@ public class DiscreteProbabilityCollectionSamplerTest {
         // Probabilities do not sum above 0
         Assertions.assertThrows(IllegalArgumentException.class,
             () -> new DiscreteProbabilityCollectionSampler<>(rng,
-                 Arrays.asList(new Double[] {1d, 2d}),
+                 Arrays.asList(1d, 2d),
                  new double[] {0d, 0d}));
     }
 
@@ -68,7 +68,7 @@ public class DiscreteProbabilityCollectionSamplerTest {
         // NaN probability
         Assertions.assertThrows(IllegalArgumentException.class,
             () -> new DiscreteProbabilityCollectionSampler<>(rng,
-                 Arrays.asList(new Double[] {1d, 2d}),
+                 Arrays.asList(1d, 2d),
                  new double[] {0d, Double.NaN}));
     }
 
@@ -77,7 +77,7 @@ public class DiscreteProbabilityCollectionSamplerTest {
         // Infinite probability
         Assertions.assertThrows(IllegalArgumentException.class,
             () -> new DiscreteProbabilityCollectionSampler<>(rng,
-                 Arrays.asList(new Double[] {1d, 2d}),
+                 Arrays.asList(1d, 2d),
                  new double[] {0d, Double.POSITIVE_INFINITY}));
     }
 
@@ -102,7 +102,7 @@ public class DiscreteProbabilityCollectionSamplerTest {
     public void testSample() {
         final DiscreteProbabilityCollectionSampler<Double> sampler =
             new DiscreteProbabilityCollectionSampler<>(rng,
-                                                       Arrays.asList(new Double[] {3d, -1d, 3d, 7d, -2d, 8d}),
+                                                       Arrays.asList(3d, -1d, 3d, 7d, -2d, 8d),
                                                        new double[] {0.2, 0.2, 0.3, 0.3, 0, 0});
         final double expectedMean = 3.4;
         final double expectedVariance = 7.84;
@@ -170,7 +170,7 @@ public class DiscreteProbabilityCollectionSamplerTest {
             // CHECKSTYLE: resume all
         };
 
-        final List<Double> items = Arrays.asList(new Double[] {1d, 2d});
+        final List<Double> items = Arrays.asList(1d, 2d);
         final DiscreteProbabilityCollectionSampler<Double> sampler =
             new DiscreteProbabilityCollectionSampler<>(dummyRng,
                                                        items,
@@ -191,7 +191,7 @@ public class DiscreteProbabilityCollectionSamplerTest {
     public void testSharedStateSampler() {
         final UniformRandomProvider rng1 = RandomSource.SPLIT_MIX_64.create(0L);
         final UniformRandomProvider rng2 = RandomSource.SPLIT_MIX_64.create(0L);
-        final List<Double> items = Arrays.asList(new Double[] {1d, 2d, 3d, 4d});
+        final List<Double> items = Arrays.asList(1d, 2d, 3d, 4d);
         final DiscreteProbabilityCollectionSampler<Double> sampler1 =
             new DiscreteProbabilityCollectionSampler<>(rng1,
                                                        items,

[commons-rng] 11/13: RNG-163: Make tests and test classes package-private

Posted by ah...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

aherbert pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/commons-rng.git

commit 2648f67c947ee3580e543f9f59f7806847213284
Author: Alex Herbert <ah...@apache.org>
AuthorDate: Mon Aug 16 23:57:38 2021 +0100

    RNG-163: Make tests and test classes package-private
    
    JUnit 5 does not require public fixtures.
---
 .../apache/commons/rng/core/BaseProviderTest.java  | 10 +--
 .../rng/core/JumpableProvidersParametricTest.java  | 14 ++--
 .../rng/core/Providers32ParametricTest.java        |  4 +-
 .../rng/core/Providers64ParametricTest.java        |  4 +-
 .../rng/core/ProvidersCommonParametricTest.java    | 32 ++++----
 .../rng/core/RandomProviderDefaultStateTest.java   |  4 +-
 .../DotyHumphreySmallFastCounting32Test.java       |  4 +-
 .../commons/rng/core/source32/ISAACRandomTest.java |  4 +-
 .../commons/rng/core/source32/IntProviderTest.java |  4 +-
 .../commons/rng/core/source32/JDKRandomTest.java   |  8 +-
 .../rng/core/source32/JenkinsSmallFast32Test.java  |  4 +-
 .../commons/rng/core/source32/KISSRandomTest.java  |  4 +-
 .../rng/core/source32/MersenneTwisterTest.java     |  6 +-
 .../source32/MiddleSquareWeylSequenceTest.java     |  8 +-
 .../core/source32/MultiplyWithCarry256Test.java    |  8 +-
 .../rng/core/source32/PcgMcgXshRr32Test.java       |  4 +-
 .../rng/core/source32/PcgMcgXshRs32Test.java       |  4 +-
 .../commons/rng/core/source32/PcgXshRr32Test.java  |  6 +-
 .../commons/rng/core/source32/PcgXshRs32Test.java  |  6 +-
 .../commons/rng/core/source32/Well1024aTest.java   |  8 +-
 .../commons/rng/core/source32/Well19937aTest.java  |  8 +-
 .../commons/rng/core/source32/Well19937cTest.java  |  8 +-
 .../commons/rng/core/source32/Well44497aTest.java  |  8 +-
 .../commons/rng/core/source32/Well44497bTest.java  |  8 +-
 .../commons/rng/core/source32/Well512aTest.java    |  8 +-
 .../rng/core/source32/XoRoShiRo64StarStarTest.java | 12 +--
 .../rng/core/source32/XoRoShiRo64StarTest.java     | 12 +--
 .../rng/core/source32/XoShiRo128PlusPlusTest.java  | 16 ++--
 .../rng/core/source32/XoShiRo128PlusTest.java      | 16 ++--
 .../rng/core/source32/XoShiRo128StarStarTest.java  | 16 ++--
 .../DotyHumphreySmallFastCounting64Test.java       |  4 +-
 .../rng/core/source64/JenkinsSmallFast64Test.java  |  4 +-
 .../rng/core/source64/LongProviderTest.java        |  6 +-
 .../rng/core/source64/MersenneTwister64Test.java   |  6 +-
 .../commons/rng/core/source64/PcgRxsMXs64Test.java |  6 +-
 .../commons/rng/core/source64/SplitMix64Test.java  |  4 +-
 .../commons/rng/core/source64/TwoCmresTest.java    | 12 +--
 .../core/source64/XoRoShiRo1024PlusPlusTest.java   | 14 ++--
 .../core/source64/XoRoShiRo1024StarStarTest.java   | 14 ++--
 .../rng/core/source64/XoRoShiRo1024StarTest.java   | 14 ++--
 .../core/source64/XoRoShiRo128PlusPlusTest.java    | 18 ++--
 .../rng/core/source64/XoRoShiRo128PlusTest.java    | 16 ++--
 .../core/source64/XoRoShiRo128StarStarTest.java    | 16 ++--
 .../rng/core/source64/XoShiRo256PlusPlusTest.java  | 16 ++--
 .../rng/core/source64/XoShiRo256PlusTest.java      | 16 ++--
 .../rng/core/source64/XoShiRo256StarStarTest.java  | 16 ++--
 .../rng/core/source64/XoShiRo512PlusPlusTest.java  | 16 ++--
 .../rng/core/source64/XoShiRo512PlusTest.java      | 16 ++--
 .../rng/core/source64/XoShiRo512StarStarTest.java  | 16 ++--
 .../rng/core/source64/XorShift1024StarPhiTest.java | 10 +--
 .../rng/core/source64/XorShift1024StarTest.java    | 10 +--
 .../commons/rng/core/util/NumberFactoryTest.java   | 46 +++++------
 .../commons/rng/examples/stress/HexTest.java       | 10 +--
 .../rng/examples/stress/RngDataOutputTest.java     | 14 ++--
 .../rng/sampling/CollectionSamplerTest.java        |  8 +-
 .../rng/sampling/CombinationSamplerTest.java       | 22 ++---
 .../rng/sampling/CompositeSamplersTest.java        | 54 ++++++------
 .../DiscreteProbabilityCollectionSamplerTest.java  | 24 +++---
 .../commons/rng/sampling/ListSamplerTest.java      | 22 ++---
 .../rng/sampling/PermutationSamplerTest.java       | 30 +++----
 .../rng/sampling/UnitSphereSamplerTest.java        | 52 ++++++------
 .../AhrensDieterExponentialSamplerTest.java        | 10 +--
 ...AhrensDieterMarsagliaTsangGammaSamplerTest.java | 12 +--
 .../AliasMethodDiscreteSamplerTest.java            | 44 +++++-----
 .../distribution/BoxMullerGaussianSamplerTest.java |  4 +-
 .../BoxMullerLogNormalSamplerTest.java             |  6 +-
 .../BoxMullerNormalisedGaussianSamplerTest.java    |  4 +-
 .../distribution/ChengBetaSamplerTest.java         | 16 ++--
 .../ContinuousSamplerParametricTest.java           |  4 +-
 .../distribution/ContinuousUniformSamplerTest.java | 14 ++--
 .../distribution/DirichletSamplerTest.java         | 38 ++++-----
 .../DiscreteSamplerParametricTest.java             |  4 +-
 .../distribution/DiscreteUniformSamplerTest.java   | 44 +++++-----
 .../sampling/distribution/GaussianSamplerTest.java | 18 ++--
 .../distribution/GeometricSamplerTest.java         | 18 ++--
 .../GuideTableDiscreteSamplerTest.java             | 42 +++++-----
 .../sampling/distribution/InternalUtilsTest.java   | 18 ++--
 .../InverseTransformContinuousSamplerTest.java     |  4 +-
 .../InverseTransformDiscreteSamplerTest.java       |  4 +-
 .../InverseTransformParetoSamplerTest.java         |  8 +-
 .../KempSmallMeanPoissonSamplerTest.java           | 18 ++--
 .../distribution/LargeMeanPoissonSamplerTest.java  | 18 ++--
 .../rng/sampling/distribution/LevySamplerTest.java | 10 +--
 .../distribution/LogNormalSamplerTest.java         | 12 +--
 .../MarsagliaNormalisedGaussianSamplerTest.java    |  6 +-
 .../MarsagliaTsangWangDiscreteSamplerTest.java     | 70 ++++++++--------
 .../distribution/PoissonSamplerCacheTest.java      | 54 ++++++------
 .../sampling/distribution/PoissonSamplerTest.java  |  8 +-
 .../RejectionInversionZipfSamplerTest.java         |  8 +-
 .../rng/sampling/distribution/SamplerBaseTest.java |  6 +-
 .../distribution/SmallMeanPoissonSamplerTest.java  | 10 +--
 .../sampling/distribution/StableSamplerTest.java   | 96 +++++++++++-----------
 .../distribution/UniformLongSamplerTest.java       | 40 ++++-----
 .../ZigguratNormalizedGaussianSamplerTest.java     |  6 +-
 .../sampling/distribution/ZigguratSamplerTest.java | 20 ++---
 .../commons/rng/sampling/shape/BoxSamplerTest.java | 32 ++++----
 .../rng/sampling/shape/CoordinatesTest.java        |  6 +-
 .../rng/sampling/shape/LineSamplerTest.java        | 40 ++++-----
 .../rng/sampling/shape/TetrahedronSamplerTest.java | 16 ++--
 .../rng/sampling/shape/TriangleSamplerTest.java    | 44 +++++-----
 .../rng/sampling/shape/UnitBallSamplerTest.java    | 30 +++----
 .../commons/rng/simple/JDKRandomBridgeTest.java    |  6 +-
 .../commons/rng/simple/JDKRandomWrapperTest.java   | 10 +--
 .../rng/simple/ProvidersCommonParametricTest.java  | 34 ++++----
 .../commons/rng/simple/RandomSourceTest.java       | 14 ++--
 .../rng/simple/ThreadLocalRandomSourceTest.java    |  8 +-
 .../simple/internal/ByteArray2IntArrayTest.java    |  6 +-
 .../simple/internal/ByteArray2LongArrayTest.java   |  6 +-
 .../simple/internal/IntArray2LongArrayTest.java    |  6 +-
 .../rng/simple/internal/Long2IntArrayTest.java     |  4 +-
 .../rng/simple/internal/Long2LongArrayTest.java    |  4 +-
 .../internal/NativeSeedTypeParametricTest.java     | 12 +--
 .../rng/simple/internal/NativeSeedTypeTest.java    |  6 +-
 .../rng/simple/internal/NoOpConverterTest.java     |  6 +-
 .../RandomSourceInternalParametricTest.java        | 12 +--
 .../simple/internal/SeedConverterComposerTest.java |  4 +-
 .../rng/simple/internal/SeedFactoryTest.java       | 36 ++++----
 .../commons/rng/simple/internal/SeedUtilsTest.java |  6 +-
 118 files changed, 916 insertions(+), 916 deletions(-)

diff --git a/commons-rng-core/src/test/java/org/apache/commons/rng/core/BaseProviderTest.java b/commons-rng-core/src/test/java/org/apache/commons/rng/core/BaseProviderTest.java
index 7c8795c..207ed7f 100644
--- a/commons-rng-core/src/test/java/org/apache/commons/rng/core/BaseProviderTest.java
+++ b/commons-rng-core/src/test/java/org/apache/commons/rng/core/BaseProviderTest.java
@@ -28,9 +28,9 @@ import org.junit.jupiter.api.Assumptions;
  * in case of a wrong implementation (and would therefore fail other
  * tests too).
  */
-public class BaseProviderTest {
+class BaseProviderTest {
     @Test
-    public void testStateSizeTooSmall() {
+    void testStateSizeTooSmall() {
         final DummyGenerator dummy = new DummyGenerator();
         final int size = dummy.getStateSize();
         Assumptions.assumeTrue(size > 0);
@@ -39,7 +39,7 @@ public class BaseProviderTest {
     }
 
     @Test
-    public void testStateSizeTooLarge() {
+    void testStateSizeTooLarge() {
         final DummyGenerator dummy = new DummyGenerator();
         final int size = dummy.getStateSize();
         final RandomProviderDefaultState state = new RandomProviderDefaultState(new byte[size + 1]);
@@ -47,7 +47,7 @@ public class BaseProviderTest {
     }
 
     @Test
-    public void testFillStateInt() {
+    void testFillStateInt() {
         final int[] state = new int[10];
         final int[] seed = {1, 2, 3};
 
@@ -65,7 +65,7 @@ public class BaseProviderTest {
     }
 
     @Test
-    public void testFillStateLong() {
+    void testFillStateLong() {
         final long[] state = new long[10];
         final long[] seed = {1, 2, 3};
 
diff --git a/commons-rng-core/src/test/java/org/apache/commons/rng/core/JumpableProvidersParametricTest.java b/commons-rng-core/src/test/java/org/apache/commons/rng/core/JumpableProvidersParametricTest.java
index 9490712..8071fd4 100644
--- a/commons-rng-core/src/test/java/org/apache/commons/rng/core/JumpableProvidersParametricTest.java
+++ b/commons-rng-core/src/test/java/org/apache/commons/rng/core/JumpableProvidersParametricTest.java
@@ -34,7 +34,7 @@ import org.apache.commons.rng.core.source64.LongProvider;
 /**
  * Tests which all {@link JumpableUniformRandomProvider} generators must pass.
  */
-public class JumpableProvidersParametricTest {
+class JumpableProvidersParametricTest {
     /** The size of the state for the IntProvider. */
     private static final int INT_PROVIDER_STATE_SIZE;
     /** The size of the state for the LongProvider. */
@@ -72,7 +72,7 @@ public class JumpableProvidersParametricTest {
      */
     @ParameterizedTest
     @MethodSource("getJumpableProviders")
-    public void testJumpReturnsACopy(JumpableUniformRandomProvider generator) {
+    void testJumpReturnsACopy(JumpableUniformRandomProvider generator) {
         assertJumpReturnsACopy(generator::jump, generator);
     }
 
@@ -81,7 +81,7 @@ public class JumpableProvidersParametricTest {
      */
     @ParameterizedTest
     @MethodSource("getJumpableProviders")
-    public void testLongJumpReturnsACopy(JumpableUniformRandomProvider generator) {
+    void testLongJumpReturnsACopy(JumpableUniformRandomProvider generator) {
         assertJumpReturnsACopy(getLongJumpFunction(generator), generator);
     }
 
@@ -104,7 +104,7 @@ public class JumpableProvidersParametricTest {
      */
     @ParameterizedTest
     @MethodSource("getJumpableProviders")
-    public void testJumpCopyMatchesPreJumpState(JumpableUniformRandomProvider generator) {
+    void testJumpCopyMatchesPreJumpState(JumpableUniformRandomProvider generator) {
         assertCopyMatchesPreJumpState(generator::jump, generator);
     }
 
@@ -114,7 +114,7 @@ public class JumpableProvidersParametricTest {
      */
     @ParameterizedTest
     @MethodSource("getJumpableProviders")
-    public void testLongJumpCopyMatchesPreJumpState(JumpableUniformRandomProvider generator) {
+    void testLongJumpCopyMatchesPreJumpState(JumpableUniformRandomProvider generator) {
         assertCopyMatchesPreJumpState(getLongJumpFunction(generator), generator);
     }
 
@@ -168,7 +168,7 @@ public class JumpableProvidersParametricTest {
      */
     @ParameterizedTest
     @MethodSource("getJumpableProviders")
-    public void testJumpResetsDefaultState(JumpableUniformRandomProvider generator) {
+    void testJumpResetsDefaultState(JumpableUniformRandomProvider generator) {
         assertJumpResetsDefaultState(generator::jump, generator);
     }
 
@@ -178,7 +178,7 @@ public class JumpableProvidersParametricTest {
      */
     @ParameterizedTest
     @MethodSource("getJumpableProviders")
-    public void testLongJumpResetsDefaultState(JumpableUniformRandomProvider generator) {
+    void testLongJumpResetsDefaultState(JumpableUniformRandomProvider generator) {
         assertJumpResetsDefaultState(getLongJumpFunction(generator), generator);
     }
 
diff --git a/commons-rng-core/src/test/java/org/apache/commons/rng/core/Providers32ParametricTest.java b/commons-rng-core/src/test/java/org/apache/commons/rng/core/Providers32ParametricTest.java
index 81d8897..1174e3a 100644
--- a/commons-rng-core/src/test/java/org/apache/commons/rng/core/Providers32ParametricTest.java
+++ b/commons-rng-core/src/test/java/org/apache/commons/rng/core/Providers32ParametricTest.java
@@ -24,14 +24,14 @@ import org.apache.commons.rng.RestorableUniformRandomProvider;
 /**
  * Tests which all 32-bits based generators must pass.
  */
-public class Providers32ParametricTest {
+class Providers32ParametricTest {
     private static Iterable<RestorableUniformRandomProvider> getList() {
         return ProvidersList.list32();
     }
 
     @ParameterizedTest
     @MethodSource("getList")
-    public void testNextBytesChunks(RestorableUniformRandomProvider generator) {
+    void testNextBytesChunks(RestorableUniformRandomProvider generator) {
         final int[] chunkSizes = {4, 8, 12, 16};
         final int[] chunks = {1, 2, 3, 4, 5};
         for (int chunkSize : chunkSizes) {
diff --git a/commons-rng-core/src/test/java/org/apache/commons/rng/core/Providers64ParametricTest.java b/commons-rng-core/src/test/java/org/apache/commons/rng/core/Providers64ParametricTest.java
index 945c0fb..3f595b8 100644
--- a/commons-rng-core/src/test/java/org/apache/commons/rng/core/Providers64ParametricTest.java
+++ b/commons-rng-core/src/test/java/org/apache/commons/rng/core/Providers64ParametricTest.java
@@ -23,14 +23,14 @@ import org.apache.commons.rng.RestorableUniformRandomProvider;
 /**
  * Tests which all 64-bits based generators must pass.
  */
-public class Providers64ParametricTest {
+class Providers64ParametricTest {
     private static Iterable<RestorableUniformRandomProvider> getList() {
         return ProvidersList.list64();
     }
 
     @ParameterizedTest
     @MethodSource("getList")
-    public void testNextBytesChunks(RestorableUniformRandomProvider generator) {
+    void testNextBytesChunks(RestorableUniformRandomProvider generator) {
         final int[] chunkSizes = {8, 16, 24};
         final int[] chunks = {1, 2, 3, 4, 5};
         for (int chunkSize : chunkSizes) {
diff --git a/commons-rng-core/src/test/java/org/apache/commons/rng/core/ProvidersCommonParametricTest.java b/commons-rng-core/src/test/java/org/apache/commons/rng/core/ProvidersCommonParametricTest.java
index 032f34d..f390d10 100644
--- a/commons-rng-core/src/test/java/org/apache/commons/rng/core/ProvidersCommonParametricTest.java
+++ b/commons-rng-core/src/test/java/org/apache/commons/rng/core/ProvidersCommonParametricTest.java
@@ -32,7 +32,7 @@ import org.apache.commons.rng.RandomProviderState;
 /**
  * Tests which all generators must pass.
  */
-public class ProvidersCommonParametricTest {
+class ProvidersCommonParametricTest {
     private static Iterable<RestorableUniformRandomProvider> getList() {
         return ProvidersList.list();
     }
@@ -41,21 +41,21 @@ public class ProvidersCommonParametricTest {
 
     @ParameterizedTest
     @MethodSource("getList")
-    public void testPreconditionNextInt(UniformRandomProvider generator) {
+    void testPreconditionNextInt(UniformRandomProvider generator) {
         Assertions.assertThrows(IllegalArgumentException.class, () -> generator.nextInt(-1));
         Assertions.assertThrows(IllegalArgumentException.class, () -> generator.nextInt(0));
     }
 
     @ParameterizedTest
     @MethodSource("getList")
-    public void testPreconditionNextLong(UniformRandomProvider generator) {
+    void testPreconditionNextLong(UniformRandomProvider generator) {
         Assertions.assertThrows(IllegalArgumentException.class, () -> generator.nextLong(-1));
         Assertions.assertThrows(IllegalArgumentException.class, () -> generator.nextLong(0));
     }
 
     @ParameterizedTest
     @MethodSource("getList")
-    public void testPreconditionNextBytes(UniformRandomProvider generator) {
+    void testPreconditionNextBytes(UniformRandomProvider generator) {
         final int size = 10;
         final int num = 1;
         final byte[] buf = new byte[size];
@@ -70,7 +70,7 @@ public class ProvidersCommonParametricTest {
 
     @ParameterizedTest
     @MethodSource("getList")
-    public void testUniformNextBytesFullBuffer(UniformRandomProvider generator) {
+    void testUniformNextBytesFullBuffer(UniformRandomProvider generator) {
         // Value chosen to exercise all the code lines in the
         // "nextBytes" methods.
         final int size = 23;
@@ -88,7 +88,7 @@ public class ProvidersCommonParametricTest {
 
     @ParameterizedTest
     @MethodSource("getList")
-    public void testUniformNextBytesPartialBuffer(UniformRandomProvider generator) {
+    void testUniformNextBytesPartialBuffer(UniformRandomProvider generator) {
         final int totalSize = 1234;
         final int offset = 567;
         final int size = 89;
@@ -112,7 +112,7 @@ public class ProvidersCommonParametricTest {
 
     @ParameterizedTest
     @MethodSource("getList")
-    public void testUniformNextIntegerInRange(UniformRandomProvider generator) {
+    void testUniformNextIntegerInRange(UniformRandomProvider generator) {
         // Statistical test uses 10 bins so tests are invalid below this level
         checkNextIntegerInRange(generator, 10, 1000);
         checkNextIntegerInRange(generator, 12, 1000);
@@ -126,7 +126,7 @@ public class ProvidersCommonParametricTest {
 
     @ParameterizedTest
     @MethodSource("getList")
-    public void testUniformNextLongInRange(UniformRandomProvider generator) {
+    void testUniformNextLongInRange(UniformRandomProvider generator) {
         // Statistical test uses 10 bins so tests are invalid below this level
         checkNextLongInRange(generator, 11, 1000);
         checkNextLongInRange(generator, 19, 1000);
@@ -141,19 +141,19 @@ public class ProvidersCommonParametricTest {
 
     @ParameterizedTest
     @MethodSource("getList")
-    public void testUniformNextFloat(UniformRandomProvider generator) {
+    void testUniformNextFloat(UniformRandomProvider generator) {
         checkNextFloat(generator, 1000);
     }
 
     @ParameterizedTest
     @MethodSource("getList")
-    public void testUniformNextDouble(UniformRandomProvider generator) {
+    void testUniformNextDouble(UniformRandomProvider generator) {
         checkNextDouble(generator, 1000);
     }
 
     @ParameterizedTest
     @MethodSource("getList")
-    public void testUniformNextIntRandomWalk(UniformRandomProvider generator) {
+    void testUniformNextIntRandomWalk(UniformRandomProvider generator) {
         final Callable<Boolean> nextMethod = new Callable<Boolean>() {
             @Override
             public Boolean call() throws Exception {
@@ -166,7 +166,7 @@ public class ProvidersCommonParametricTest {
 
     @ParameterizedTest
     @MethodSource("getList")
-    public void testUniformNextLongRandomWalk(UniformRandomProvider generator) {
+    void testUniformNextLongRandomWalk(UniformRandomProvider generator) {
         final Callable<Boolean> nextMethod = new Callable<Boolean>() {
             @Override
             public Boolean call() throws Exception {
@@ -179,7 +179,7 @@ public class ProvidersCommonParametricTest {
 
     @ParameterizedTest
     @MethodSource("getList")
-    public void testUniformNextBooleanRandomWalk(UniformRandomProvider generator) {
+    void testUniformNextBooleanRandomWalk(UniformRandomProvider generator) {
         final Callable<Boolean> nextMethod = new Callable<Boolean>() {
             @Override
             public Boolean call() throws Exception {
@@ -194,7 +194,7 @@ public class ProvidersCommonParametricTest {
 
     @ParameterizedTest
     @MethodSource("getList")
-    public void testStateSettable(RestorableUniformRandomProvider generator) {
+    void testStateSettable(RestorableUniformRandomProvider generator) {
         // Should be fairly large in order to ensure that all the internal
         // state is away from its initial settings.
         final int n = 10000;
@@ -218,7 +218,7 @@ public class ProvidersCommonParametricTest {
 
     @ParameterizedTest
     @MethodSource("getList")
-    public void testStateWrongSize(RestorableUniformRandomProvider generator) {
+    void testStateWrongSize(RestorableUniformRandomProvider generator) {
         final RandomProviderState state = new DummyGenerator().saveState();
         // Try to restore with an invalid state (wrong size).
         Assertions.assertThrows(IllegalStateException.class, () -> generator.restoreState(state));
@@ -226,7 +226,7 @@ public class ProvidersCommonParametricTest {
 
     @ParameterizedTest
     @MethodSource("getList")
-    public void testRestoreForeignState(RestorableUniformRandomProvider generator) {
+    void testRestoreForeignState(RestorableUniformRandomProvider generator) {
         Assertions.assertThrows(IllegalArgumentException.class, () -> generator.restoreState(new RandomProviderState() {}));
     }
 
diff --git a/commons-rng-core/src/test/java/org/apache/commons/rng/core/RandomProviderDefaultStateTest.java b/commons-rng-core/src/test/java/org/apache/commons/rng/core/RandomProviderDefaultStateTest.java
index d366576..b88d2b4 100644
--- a/commons-rng-core/src/test/java/org/apache/commons/rng/core/RandomProviderDefaultStateTest.java
+++ b/commons-rng-core/src/test/java/org/apache/commons/rng/core/RandomProviderDefaultStateTest.java
@@ -23,9 +23,9 @@ import org.junit.jupiter.api.Assertions;
 /**
  * Tests for {@link RandomProviderDefaultState}.
  */
-public class RandomProviderDefaultStateTest {
+class RandomProviderDefaultStateTest {
     @Test
-    public void testConsistency() {
+    void testConsistency() {
         final byte[] internalState = {1, 0, -23, 67, -128, 54, 100, 127};
         final RandomProviderDefaultState state = new RandomProviderDefaultState(internalState);
 
diff --git a/commons-rng-core/src/test/java/org/apache/commons/rng/core/source32/DotyHumphreySmallFastCounting32Test.java b/commons-rng-core/src/test/java/org/apache/commons/rng/core/source32/DotyHumphreySmallFastCounting32Test.java
index 3ce92b3..7b49ac3 100644
--- a/commons-rng-core/src/test/java/org/apache/commons/rng/core/source32/DotyHumphreySmallFastCounting32Test.java
+++ b/commons-rng-core/src/test/java/org/apache/commons/rng/core/source32/DotyHumphreySmallFastCounting32Test.java
@@ -20,9 +20,9 @@ package org.apache.commons.rng.core.source32;
 import org.apache.commons.rng.core.RandomAssert;
 import org.junit.jupiter.api.Test;
 
-public class DotyHumphreySmallFastCounting32Test {
+class DotyHumphreySmallFastCounting32Test {
     @Test
-    public void testReferenceCode() {
+    void testReferenceCode() {
         /*
          * Tested with respect to PractRand::RNGs::Raw::sfc32 of the C++ implementation (v0.94).
          * See : http://pracrand.sourceforge.net/
diff --git a/commons-rng-core/src/test/java/org/apache/commons/rng/core/source32/ISAACRandomTest.java b/commons-rng-core/src/test/java/org/apache/commons/rng/core/source32/ISAACRandomTest.java
index d8aa6ab..4a00638 100644
--- a/commons-rng-core/src/test/java/org/apache/commons/rng/core/source32/ISAACRandomTest.java
+++ b/commons-rng-core/src/test/java/org/apache/commons/rng/core/source32/ISAACRandomTest.java
@@ -364,12 +364,12 @@ public final class ISAACRandomTest {
     };
 
     @Test
-    public void testReference1() {
+    void testReference1() {
         RandomAssert.assertEquals(EXPECTED_SEQUENCE_1, new ISAACRandom(SEED_1));
     }
 
     @Test
-    public void testReference2() {
+    void testReference2() {
         RandomAssert.assertEquals(EXPECTED_SEQUENCE_2, new ISAACRandom(SEED_2));
     }
 }
diff --git a/commons-rng-core/src/test/java/org/apache/commons/rng/core/source32/IntProviderTest.java b/commons-rng-core/src/test/java/org/apache/commons/rng/core/source32/IntProviderTest.java
index 208c56c..4947a63 100644
--- a/commons-rng-core/src/test/java/org/apache/commons/rng/core/source32/IntProviderTest.java
+++ b/commons-rng-core/src/test/java/org/apache/commons/rng/core/source32/IntProviderTest.java
@@ -24,7 +24,7 @@ import org.junit.jupiter.api.Test;
  * the source for {@link IntProvider#nextInt()} and
  * {@link IntProvider#nextBoolean()}.
  */
-public class IntProviderTest {
+class IntProviderTest {
     /**
      * A simple class to flip the bits in a number as the source for
      * {@link IntProvider#next()}.
@@ -56,7 +56,7 @@ public class IntProviderTest {
      * <p>The order should be from the least-significant bit.
      */
     @Test
-    public void testNextBoolean() {
+    void testNextBoolean() {
         for (int i = 0; i < Integer.SIZE; i++) {
             // Set only a single bit in the source
             final int value = 1 << i;
diff --git a/commons-rng-core/src/test/java/org/apache/commons/rng/core/source32/JDKRandomTest.java b/commons-rng-core/src/test/java/org/apache/commons/rng/core/source32/JDKRandomTest.java
index 7730776..fde0913 100644
--- a/commons-rng-core/src/test/java/org/apache/commons/rng/core/source32/JDKRandomTest.java
+++ b/commons-rng-core/src/test/java/org/apache/commons/rng/core/source32/JDKRandomTest.java
@@ -30,7 +30,7 @@ import org.apache.commons.rng.core.util.NumberFactory;
 import org.junit.jupiter.api.Assertions;
 import org.junit.jupiter.api.Test;
 
-public class JDKRandomTest {
+class JDKRandomTest {
     /**
      * A class that is Serializable.
      * It contains member fields so there is something to serialize and malicious
@@ -59,7 +59,7 @@ public class JDKRandomTest {
     }
 
     @Test
-    public void testReferenceCode() {
+    void testReferenceCode() {
         final long refSeed = -1357111213L;
         final JDKRandom rng = new JDKRandom(refSeed);
         final Random jdk = new Random(refSeed);
@@ -77,7 +77,7 @@ public class JDKRandomTest {
      * to save the state.
      */
     @Test
-    public void testRestoreToNewInstance()  {
+    void testRestoreToNewInstance()  {
         final long seed = 8796746234L;
         final JDKRandom rng1 = new JDKRandom(seed);
         final JDKRandom rng2 = new JDKRandom(seed + 1);
@@ -105,7 +105,7 @@ public class JDKRandomTest {
      * @throws IOException Signals that an I/O exception has occurred.
      */
     @Test
-    public void testRestoreWithInvalidClass() throws IOException  {
+    void testRestoreWithInvalidClass() throws IOException  {
         // Serialize something
         final ByteArrayOutputStream bos = new ByteArrayOutputStream();
         try (ObjectOutputStream oos = new ObjectOutputStream(bos)) {
diff --git a/commons-rng-core/src/test/java/org/apache/commons/rng/core/source32/JenkinsSmallFast32Test.java b/commons-rng-core/src/test/java/org/apache/commons/rng/core/source32/JenkinsSmallFast32Test.java
index 94de1ca..1da0bfe 100644
--- a/commons-rng-core/src/test/java/org/apache/commons/rng/core/source32/JenkinsSmallFast32Test.java
+++ b/commons-rng-core/src/test/java/org/apache/commons/rng/core/source32/JenkinsSmallFast32Test.java
@@ -20,9 +20,9 @@ package org.apache.commons.rng.core.source32;
 import org.apache.commons.rng.core.RandomAssert;
 import org.junit.jupiter.api.Test;
 
-public class JenkinsSmallFast32Test {
+class JenkinsSmallFast32Test {
     @Test
-    public void testReferenceCode() {
+    void testReferenceCode() {
         /*
          * Tested with respect to the original reference:
          * See : https://burtleburtle.net/bob/rand/smallprng.html
diff --git a/commons-rng-core/src/test/java/org/apache/commons/rng/core/source32/KISSRandomTest.java b/commons-rng-core/src/test/java/org/apache/commons/rng/core/source32/KISSRandomTest.java
index 0bfbd8c..b26fcaf 100644
--- a/commons-rng-core/src/test/java/org/apache/commons/rng/core/source32/KISSRandomTest.java
+++ b/commons-rng-core/src/test/java/org/apache/commons/rng/core/source32/KISSRandomTest.java
@@ -19,9 +19,9 @@ package org.apache.commons.rng.core.source32;
 import org.apache.commons.rng.core.RandomAssert;
 import org.junit.jupiter.api.Test;
 
-public class KISSRandomTest {
+class KISSRandomTest {
     @Test
-    public void testMarsaglia() {
+    void testMarsaglia() {
         final int[] seed = {
             0x159a55e5, 0x1f123bb5, 0x75bcd15, 0x16a81cc0
         };
diff --git a/commons-rng-core/src/test/java/org/apache/commons/rng/core/source32/MersenneTwisterTest.java b/commons-rng-core/src/test/java/org/apache/commons/rng/core/source32/MersenneTwisterTest.java
index c5936b9..6e71a28 100644
--- a/commons-rng-core/src/test/java/org/apache/commons/rng/core/source32/MersenneTwisterTest.java
+++ b/commons-rng-core/src/test/java/org/apache/commons/rng/core/source32/MersenneTwisterTest.java
@@ -20,9 +20,9 @@ import org.apache.commons.rng.core.RandomAssert;
 import org.junit.jupiter.api.Assertions;
 import org.junit.jupiter.api.Test;
 
-public class MersenneTwisterTest {
+class MersenneTwisterTest {
     @Test
-    public void testMakotoNishimura() {
+    void testMakotoNishimura() {
         final MersenneTwister rng = new MersenneTwister(new int[] {0x123, 0x234, 0x345, 0x456});
 
         /*
@@ -162,7 +162,7 @@ public class MersenneTwisterTest {
     }
 
     @Test
-    public void testConstructorWithEmptySeed() {
+    void testConstructorWithEmptySeed() {
         // An empty seed is allowed
         final MersenneTwister rng = new MersenneTwister(new int[0]);
         // It should be functional so check it returns different values.
diff --git a/commons-rng-core/src/test/java/org/apache/commons/rng/core/source32/MiddleSquareWeylSequenceTest.java b/commons-rng-core/src/test/java/org/apache/commons/rng/core/source32/MiddleSquareWeylSequenceTest.java
index f1733f8..2323569 100644
--- a/commons-rng-core/src/test/java/org/apache/commons/rng/core/source32/MiddleSquareWeylSequenceTest.java
+++ b/commons-rng-core/src/test/java/org/apache/commons/rng/core/source32/MiddleSquareWeylSequenceTest.java
@@ -21,9 +21,9 @@ import org.apache.commons.rng.core.util.NumberFactory;
 import org.junit.jupiter.api.Assertions;
 import org.junit.jupiter.api.Test;
 
-public class MiddleSquareWeylSequenceTest {
+class MiddleSquareWeylSequenceTest {
     @Test
-    public void testReferenceCode() {
+    void testReferenceCode() {
         /*
          * The data was generated using the following program based on the author's C code:
          *     https://mswsrng.wixsite.com/rand
@@ -75,7 +75,7 @@ public class MiddleSquareWeylSequenceTest {
      * statistical quality of the output is not tested.</p>
      */
     @Test
-    public void testSelfSeeding() {
+    void testSelfSeeding() {
         final int warmupCycles = 0;
         final int testCycles = 3;
         // Do not pass the Weyl increment (the 3rd value in the seed array)
@@ -88,7 +88,7 @@ public class MiddleSquareWeylSequenceTest {
      * nextLong() routine in the implementation that overrides the default.
      */
     @Test
-    public void testNextLong() {
+    void testNextLong() {
         final long[] seed = {0x012de1babb3c4104L, 0xc8161b4202294965L, 0xb5ad4eceda1ce2a9L};
         final MiddleSquareWeylSequence rng1 = new MiddleSquareWeylSequence(seed);
         final MiddleSquareWeylSequence rng2 = new MiddleSquareWeylSequence(seed);
diff --git a/commons-rng-core/src/test/java/org/apache/commons/rng/core/source32/MultiplyWithCarry256Test.java b/commons-rng-core/src/test/java/org/apache/commons/rng/core/source32/MultiplyWithCarry256Test.java
index 798fa9c..90a67d9 100644
--- a/commons-rng-core/src/test/java/org/apache/commons/rng/core/source32/MultiplyWithCarry256Test.java
+++ b/commons-rng-core/src/test/java/org/apache/commons/rng/core/source32/MultiplyWithCarry256Test.java
@@ -19,12 +19,12 @@ package org.apache.commons.rng.core.source32;
 import org.apache.commons.rng.core.RandomAssert;
 import org.junit.jupiter.api.Test;
 
-public class MultiplyWithCarry256Test {
+class MultiplyWithCarry256Test {
     /** The size of the array seed. */
     private static final int SEED_SIZE = 257;
 
     @Test
-    public void testMarsaglia() {
+    void testMarsaglia() {
         final int[] seed = {
             0x000587c4, // initial carry
             0xff710353, 0x1b427020, 0xc9c59991, 0x96e511e0, 0xf1d06013, 0xe0216c68, 0x98999e3d, 0xce158f68,
@@ -197,12 +197,12 @@ public class MultiplyWithCarry256Test {
     }
 
     @Test
-    public void testConstructorWithZeroSeedIsNonFunctional() {
+    void testConstructorWithZeroSeedIsNonFunctional() {
         RandomAssert.assertNextIntZeroOutput(new MultiplyWithCarry256(new int[SEED_SIZE]), 2 * SEED_SIZE);
     }
 
     @Test
-    public void testConstructorWithSingleBitSeedIsFunctional() {
+    void testConstructorWithSingleBitSeedIsFunctional() {
         RandomAssert.assertIntArrayConstructorWithSingleBitSeedIsFunctional(MultiplyWithCarry256.class, SEED_SIZE);
     }
 }
diff --git a/commons-rng-core/src/test/java/org/apache/commons/rng/core/source32/PcgMcgXshRr32Test.java b/commons-rng-core/src/test/java/org/apache/commons/rng/core/source32/PcgMcgXshRr32Test.java
index 9364c83..dda5c1d 100644
--- a/commons-rng-core/src/test/java/org/apache/commons/rng/core/source32/PcgMcgXshRr32Test.java
+++ b/commons-rng-core/src/test/java/org/apache/commons/rng/core/source32/PcgMcgXshRr32Test.java
@@ -20,9 +20,9 @@ package org.apache.commons.rng.core.source32;
 import org.apache.commons.rng.core.RandomAssert;
 import org.junit.jupiter.api.Test;
 
-public class PcgMcgXshRr32Test {
+class PcgMcgXshRr32Test {
     @Test
-    public void testReferenceCode() {
+    void testReferenceCode() {
         /*
          * Tested with respect to pcg_engines::mcg_xsh_rr_64_32 of the C++ implementation.
          * See : http://www.pcg-random.org/download.html#cpp-implementation
diff --git a/commons-rng-core/src/test/java/org/apache/commons/rng/core/source32/PcgMcgXshRs32Test.java b/commons-rng-core/src/test/java/org/apache/commons/rng/core/source32/PcgMcgXshRs32Test.java
index a1d69db..28f690a 100644
--- a/commons-rng-core/src/test/java/org/apache/commons/rng/core/source32/PcgMcgXshRs32Test.java
+++ b/commons-rng-core/src/test/java/org/apache/commons/rng/core/source32/PcgMcgXshRs32Test.java
@@ -20,9 +20,9 @@ package org.apache.commons.rng.core.source32;
 import org.apache.commons.rng.core.RandomAssert;
 import org.junit.jupiter.api.Test;
 
-public class PcgMcgXshRs32Test {
+class PcgMcgXshRs32Test {
     @Test
-    public void testReferenceCode() {
+    void testReferenceCode() {
         /*
          * Tested with respect to pcg_engines::mcg_xsh_rs_64_32 of the C++ implementation.
          * See : http://www.pcg-random.org/download.html#cpp-implementation
diff --git a/commons-rng-core/src/test/java/org/apache/commons/rng/core/source32/PcgXshRr32Test.java b/commons-rng-core/src/test/java/org/apache/commons/rng/core/source32/PcgXshRr32Test.java
index 7e06fcb..b2d127d 100644
--- a/commons-rng-core/src/test/java/org/apache/commons/rng/core/source32/PcgXshRr32Test.java
+++ b/commons-rng-core/src/test/java/org/apache/commons/rng/core/source32/PcgXshRr32Test.java
@@ -20,9 +20,9 @@ package org.apache.commons.rng.core.source32;
 import org.apache.commons.rng.core.RandomAssert;
 import org.junit.jupiter.api.Test;
 
-public class PcgXshRr32Test {
+class PcgXshRr32Test {
     @Test
-    public void testReferenceCode() {
+    void testReferenceCode() {
         /*
          * Tested with respect to pcg_engines::setseq_xsh_rr_64_32(x, y) of the C++ implementation.
          * See : http://www.pcg-random.org/download.html#cpp-implementation
@@ -45,7 +45,7 @@ public class PcgXshRr32Test {
     }
 
     @Test
-    public void testReferenceCodeFixedIncrement() {
+    void testReferenceCodeFixedIncrement() {
         /*
          * Tested with respect to pcg_engines::setseq_xsh_rr_64_32(x) of the C++ implementation.
          * See : http://www.pcg-random.org/download.html#cpp-implementation
diff --git a/commons-rng-core/src/test/java/org/apache/commons/rng/core/source32/PcgXshRs32Test.java b/commons-rng-core/src/test/java/org/apache/commons/rng/core/source32/PcgXshRs32Test.java
index 40918f2..419fc7e 100644
--- a/commons-rng-core/src/test/java/org/apache/commons/rng/core/source32/PcgXshRs32Test.java
+++ b/commons-rng-core/src/test/java/org/apache/commons/rng/core/source32/PcgXshRs32Test.java
@@ -20,9 +20,9 @@ package org.apache.commons.rng.core.source32;
 import org.apache.commons.rng.core.RandomAssert;
 import org.junit.jupiter.api.Test;
 
-public class PcgXshRs32Test {
+class PcgXshRs32Test {
     @Test
-    public void testReferenceCode() {
+    void testReferenceCode() {
         /*
          * Tested with respect to pcg_engines::setseq_xsh_rs_64_32(x, y) from the C++ implementation.
          * See : http://www.pcg-random.org/download.html#cpp-implementation
@@ -45,7 +45,7 @@ public class PcgXshRs32Test {
     }
 
     @Test
-    public void testReferenceCodeFixedIncrement() {
+    void testReferenceCodeFixedIncrement() {
         /*
          * Tested with respect to pcg_engines::setseq_xsh_rs_64_32(x) from the C++ implementation.
          * See : http://www.pcg-random.org/download.html#cpp-implementation
diff --git a/commons-rng-core/src/test/java/org/apache/commons/rng/core/source32/Well1024aTest.java b/commons-rng-core/src/test/java/org/apache/commons/rng/core/source32/Well1024aTest.java
index 7597caf..6ae576c 100644
--- a/commons-rng-core/src/test/java/org/apache/commons/rng/core/source32/Well1024aTest.java
+++ b/commons-rng-core/src/test/java/org/apache/commons/rng/core/source32/Well1024aTest.java
@@ -19,12 +19,12 @@ package org.apache.commons.rng.core.source32;
 import org.apache.commons.rng.core.RandomAssert;
 import org.junit.jupiter.api.Test;
 
-public class Well1024aTest {
+class Well1024aTest {
     /** The size of the array seed. */
     private static final int SEED_SIZE = 32;
 
     @Test
-    public void testReferenceCode() {
+    void testReferenceCode() {
         final Well1024a rng = new Well1024a(new int[] {
             0x2c2878c6, 0x47af36c4, 0xf422e677, 0xf08fd8d3, 0xee9a47c7, 0xba983942, 0xa2a9f9a5, 0x1d443748,
             0x8fc260b2, 0x5275c681, 0x4a2f5a28, 0x2911683d, 0xa204c27e, 0xb20a6a26, 0x54ba33be, 0x67d63eb0,
@@ -71,12 +71,12 @@ public class Well1024aTest {
     }
 
     @Test
-    public void testConstructorWithZeroSeedIsNonFunctional() {
+    void testConstructorWithZeroSeedIsNonFunctional() {
         RandomAssert.assertNextIntZeroOutput(new Well1024a(new int[SEED_SIZE]), 2 * SEED_SIZE);
     }
 
     @Test
-    public void testConstructorWithSingleBitSeedIsFunctional() {
+    void testConstructorWithSingleBitSeedIsFunctional() {
         RandomAssert.assertIntArrayConstructorWithSingleBitSeedIsFunctional(Well1024a.class, SEED_SIZE);
     }
 }
diff --git a/commons-rng-core/src/test/java/org/apache/commons/rng/core/source32/Well19937aTest.java b/commons-rng-core/src/test/java/org/apache/commons/rng/core/source32/Well19937aTest.java
index e33dea0..d103e0b 100644
--- a/commons-rng-core/src/test/java/org/apache/commons/rng/core/source32/Well19937aTest.java
+++ b/commons-rng-core/src/test/java/org/apache/commons/rng/core/source32/Well19937aTest.java
@@ -19,12 +19,12 @@ package org.apache.commons.rng.core.source32;
 import org.apache.commons.rng.core.RandomAssert;
 import org.junit.jupiter.api.Test;
 
-public class Well19937aTest {
+class Well19937aTest {
     /** The size of the array seed. */
     private static final int SEED_SIZE = 624;
 
     @Test
-    public void testReferenceCode() {
+    void testReferenceCode() {
         final int[] base = {
             0x2c2878c6, 0x47af36c4, 0xf422e677, 0xf08fd8d3, 0xee9a47c7, 0xba983942, 0xa2a9f9a5, 0x1d443748,
             0x8fc260b2, 0x5275c681, 0x4a2f5a28, 0x2911683d, 0xa204c27e, 0xb20a6a26, 0x54ba33be, 0x67d63eb0,
@@ -173,12 +173,12 @@ public class Well19937aTest {
     }
 
     @Test
-    public void testConstructorWithZeroSeedIsNonFunctional() {
+    void testConstructorWithZeroSeedIsNonFunctional() {
         RandomAssert.assertNextIntZeroOutput(new Well19937a(new int[SEED_SIZE]), 2 * SEED_SIZE);
     }
 
     @Test
-    public void testConstructorWithSingleBitSeedIsFunctional() {
+    void testConstructorWithSingleBitSeedIsFunctional() {
         RandomAssert.assertIntArrayConstructorWithSingleBitInPoolIsFunctional(Well19937a.class, 19937);
     }
 }
diff --git a/commons-rng-core/src/test/java/org/apache/commons/rng/core/source32/Well19937cTest.java b/commons-rng-core/src/test/java/org/apache/commons/rng/core/source32/Well19937cTest.java
index dbf6f3a..ee8098b 100644
--- a/commons-rng-core/src/test/java/org/apache/commons/rng/core/source32/Well19937cTest.java
+++ b/commons-rng-core/src/test/java/org/apache/commons/rng/core/source32/Well19937cTest.java
@@ -19,12 +19,12 @@ package org.apache.commons.rng.core.source32;
 import org.apache.commons.rng.core.RandomAssert;
 import org.junit.jupiter.api.Test;
 
-public class Well19937cTest {
+class Well19937cTest {
     /** The size of the array seed. */
     private static final int SEED_SIZE = 624;
 
     @Test
-    public void testReferenceCode() {
+    void testReferenceCode() {
         final int[] base = {
             0x2c2878c6, 0x47af36c4, 0xf422e677, 0xf08fd8d3, 0xee9a47c7, 0xba983942, 0xa2a9f9a5, 0x1d443748,
             0x8fc260b2, 0x5275c681, 0x4a2f5a28, 0x2911683d, 0xa204c27e, 0xb20a6a26, 0x54ba33be, 0x67d63eb0,
@@ -173,12 +173,12 @@ public class Well19937cTest {
     }
 
     @Test
-    public void testConstructorWithZeroSeedIsNonFunctional() {
+    void testConstructorWithZeroSeedIsNonFunctional() {
         RandomAssert.assertNextIntZeroOutput(new Well19937c(new int[SEED_SIZE]), 2 * SEED_SIZE);
     }
 
     @Test
-    public void testConstructorWithSingleBitSeedIsFunctional() {
+    void testConstructorWithSingleBitSeedIsFunctional() {
         RandomAssert.assertIntArrayConstructorWithSingleBitInPoolIsFunctional(Well19937c.class, 19937);
     }
 }
diff --git a/commons-rng-core/src/test/java/org/apache/commons/rng/core/source32/Well44497aTest.java b/commons-rng-core/src/test/java/org/apache/commons/rng/core/source32/Well44497aTest.java
index d628fd8..51c56d6 100644
--- a/commons-rng-core/src/test/java/org/apache/commons/rng/core/source32/Well44497aTest.java
+++ b/commons-rng-core/src/test/java/org/apache/commons/rng/core/source32/Well44497aTest.java
@@ -19,12 +19,12 @@ package org.apache.commons.rng.core.source32;
 import org.apache.commons.rng.core.RandomAssert;
 import org.junit.jupiter.api.Test;
 
-public class Well44497aTest {
+class Well44497aTest {
     /** The size of the array seed. */
     private static final int SEED_SIZE = 1391;
 
     @Test
-    public void testReferenceCode() {
+    void testReferenceCode() {
         final int[] base = {
             0x2c2878c6, 0x47af36c4, 0xf422e677, 0xf08fd8d3, 0xee9a47c7, 0xba983942, 0xa2a9f9a5, 0x1d443748,
             0x8fc260b2, 0x5275c681, 0x4a2f5a28, 0x2911683d, 0xa204c27e, 0xb20a6a26, 0x54ba33be, 0x67d63eb0,
@@ -301,12 +301,12 @@ public class Well44497aTest {
     }
 
     @Test
-    public void testConstructorWithZeroSeedIsNonFunctional() {
+    void testConstructorWithZeroSeedIsNonFunctional() {
         RandomAssert.assertNextIntZeroOutput(new Well44497a(new int[SEED_SIZE]), 2 * SEED_SIZE);
     }
 
     @Test
-    public void testConstructorWithSingleBitSeedIsFunctional() {
+    void testConstructorWithSingleBitSeedIsFunctional() {
         RandomAssert.assertIntArrayConstructorWithSingleBitInPoolIsFunctional(Well44497a.class, 44497);
     }
 }
diff --git a/commons-rng-core/src/test/java/org/apache/commons/rng/core/source32/Well44497bTest.java b/commons-rng-core/src/test/java/org/apache/commons/rng/core/source32/Well44497bTest.java
index b1f7ed4..09e1905 100644
--- a/commons-rng-core/src/test/java/org/apache/commons/rng/core/source32/Well44497bTest.java
+++ b/commons-rng-core/src/test/java/org/apache/commons/rng/core/source32/Well44497bTest.java
@@ -19,12 +19,12 @@ package org.apache.commons.rng.core.source32;
 import org.apache.commons.rng.core.RandomAssert;
 import org.junit.jupiter.api.Test;
 
-public class Well44497bTest {
+class Well44497bTest {
     /** The size of the array seed. */
     private static final int SEED_SIZE = 1391;
 
     @Test
-    public void testReferenceCode() {
+    void testReferenceCode() {
         final int[] base = {
             0x2c2878c6, 0x47af36c4, 0xf422e677, 0xf08fd8d3, 0xee9a47c7, 0xba983942, 0xa2a9f9a5, 0x1d443748,
             0x8fc260b2, 0x5275c681, 0x4a2f5a28, 0x2911683d, 0xa204c27e, 0xb20a6a26, 0x54ba33be, 0x67d63eb0,
@@ -301,12 +301,12 @@ public class Well44497bTest {
     }
 
     @Test
-    public void testConstructorWithZeroSeedIsNonFunctional() {
+    void testConstructorWithZeroSeedIsNonFunctional() {
         RandomAssert.assertNextIntZeroOutput(new Well44497b(new int[SEED_SIZE]), 2 * SEED_SIZE);
     }
 
     @Test
-    public void testConstructorWithSingleBitSeedIsFunctional() {
+    void testConstructorWithSingleBitSeedIsFunctional() {
         RandomAssert.assertIntArrayConstructorWithSingleBitInPoolIsFunctional(Well44497b.class, 44497);
     }
 }
diff --git a/commons-rng-core/src/test/java/org/apache/commons/rng/core/source32/Well512aTest.java b/commons-rng-core/src/test/java/org/apache/commons/rng/core/source32/Well512aTest.java
index efd0db1..d7f8e87 100644
--- a/commons-rng-core/src/test/java/org/apache/commons/rng/core/source32/Well512aTest.java
+++ b/commons-rng-core/src/test/java/org/apache/commons/rng/core/source32/Well512aTest.java
@@ -19,12 +19,12 @@ package org.apache.commons.rng.core.source32;
 import org.apache.commons.rng.core.RandomAssert;
 import org.junit.jupiter.api.Test;
 
-public class Well512aTest {
+class Well512aTest {
     /** The size of the array seed. */
     private static final int SEED_SIZE = 16;
 
     @Test
-    public void testReferenceCode() {
+    void testReferenceCode() {
         final Well512a rng = new Well512a(new int[] {
             0x2c2878c6, 0x47af36c4, 0xf422e677, 0xf08fd8d3, 0xee9a47c7, 0xba983942, 0xa2a9f9a5, 0x1d443748,
             0x8fc260b2, 0x5275c681, 0x4a2f5a28, 0x2911683d, 0xa204c27e, 0xb20a6a26, 0x54ba33be, 0x67d63eb0
@@ -69,12 +69,12 @@ public class Well512aTest {
     }
 
     @Test
-    public void testConstructorWithZeroSeedIsNonFunctional() {
+    void testConstructorWithZeroSeedIsNonFunctional() {
         RandomAssert.assertNextIntZeroOutput(new Well512a(new int[SEED_SIZE]), 2 * SEED_SIZE);
     }
 
     @Test
-    public void testConstructorWithSingleBitSeedIsFunctional() {
+    void testConstructorWithSingleBitSeedIsFunctional() {
         RandomAssert.assertIntArrayConstructorWithSingleBitSeedIsFunctional(Well512a.class, SEED_SIZE);
     }
 }
diff --git a/commons-rng-core/src/test/java/org/apache/commons/rng/core/source32/XoRoShiRo64StarStarTest.java b/commons-rng-core/src/test/java/org/apache/commons/rng/core/source32/XoRoShiRo64StarStarTest.java
index e52d497..02758c4 100644
--- a/commons-rng-core/src/test/java/org/apache/commons/rng/core/source32/XoRoShiRo64StarStarTest.java
+++ b/commons-rng-core/src/test/java/org/apache/commons/rng/core/source32/XoRoShiRo64StarStarTest.java
@@ -19,12 +19,12 @@ package org.apache.commons.rng.core.source32;
 import org.apache.commons.rng.core.RandomAssert;
 import org.junit.jupiter.api.Test;
 
-public class XoRoShiRo64StarStarTest {
+class XoRoShiRo64StarStarTest {
     /** The size of the array seed. */
     private static final int SEED_SIZE = 2;
 
     @Test
-    public void testReferenceCode() {
+    void testReferenceCode() {
         /*
          * Data from running the executable compiled from the author's C code:
          *   http://xoshiro.di.unimi.it/xoroshiro64starstar.c
@@ -50,24 +50,24 @@ public class XoRoShiRo64StarStarTest {
     }
 
     @Test
-    public void testConstructorWithZeroSeedIsNonFunctional() {
+    void testConstructorWithZeroSeedIsNonFunctional() {
         RandomAssert.assertNextIntZeroOutput(new XoRoShiRo64StarStar(new int[SEED_SIZE]), 2 * SEED_SIZE);
     }
 
     @Test
-    public void testConstructorWithSingleBitSeedIsFunctional() {
+    void testConstructorWithSingleBitSeedIsFunctional() {
         RandomAssert.assertIntArrayConstructorWithSingleBitSeedIsFunctional(XoRoShiRo64StarStar.class, SEED_SIZE);
     }
 
     @Test
-    public void testConstructorWithoutFullLengthSeed() {
+    void testConstructorWithoutFullLengthSeed() {
         // Hit the case when the input seed is self-seeded when not full length
         RandomAssert.assertNextLongNonZeroOutput(new XoRoShiRo64StarStar(new int[] {0x012de1ba}),
                 SEED_SIZE, SEED_SIZE);
     }
 
     @Test
-    public void testElementConstructor() {
+    void testElementConstructor() {
         final int[] seed = {
             0x012de1ba, 0xa5a818b8,
         };
diff --git a/commons-rng-core/src/test/java/org/apache/commons/rng/core/source32/XoRoShiRo64StarTest.java b/commons-rng-core/src/test/java/org/apache/commons/rng/core/source32/XoRoShiRo64StarTest.java
index ce80fd7..b146edb 100644
--- a/commons-rng-core/src/test/java/org/apache/commons/rng/core/source32/XoRoShiRo64StarTest.java
+++ b/commons-rng-core/src/test/java/org/apache/commons/rng/core/source32/XoRoShiRo64StarTest.java
@@ -19,12 +19,12 @@ package org.apache.commons.rng.core.source32;
 import org.apache.commons.rng.core.RandomAssert;
 import org.junit.jupiter.api.Test;
 
-public class XoRoShiRo64StarTest {
+class XoRoShiRo64StarTest {
     /** The size of the array seed. */
     private static final int SEED_SIZE = 2;
 
     @Test
-    public void testReferenceCode() {
+    void testReferenceCode() {
         /*
          * Data from running the executable compiled from the author's C code:
          *   http://xoshiro.di.unimi.it/xoroshiro64star.c
@@ -50,24 +50,24 @@ public class XoRoShiRo64StarTest {
     }
 
     @Test
-    public void testConstructorWithZeroSeedIsNonFunctional() {
+    void testConstructorWithZeroSeedIsNonFunctional() {
         RandomAssert.assertNextIntZeroOutput(new XoRoShiRo64Star(new int[SEED_SIZE]), 2 * SEED_SIZE);
     }
 
     @Test
-    public void testConstructorWithSingleBitSeedIsFunctional() {
+    void testConstructorWithSingleBitSeedIsFunctional() {
         RandomAssert.assertIntArrayConstructorWithSingleBitSeedIsFunctional(XoRoShiRo64Star.class, SEED_SIZE);
     }
 
     @Test
-    public void testConstructorWithoutFullLengthSeed() {
+    void testConstructorWithoutFullLengthSeed() {
         // Hit the case when the input seed is self-seeded when not full length
         RandomAssert.assertNextLongNonZeroOutput(new XoRoShiRo64Star(new int[] {0x012de1ba}),
                 SEED_SIZE, SEED_SIZE);
     }
 
     @Test
-    public void testElementConstructor() {
+    void testElementConstructor() {
         final int[] seed = {
             0x012de1ba, 0xa5a818b8,
         };
diff --git a/commons-rng-core/src/test/java/org/apache/commons/rng/core/source32/XoShiRo128PlusPlusTest.java b/commons-rng-core/src/test/java/org/apache/commons/rng/core/source32/XoShiRo128PlusPlusTest.java
index 84bb05f..207f318 100644
--- a/commons-rng-core/src/test/java/org/apache/commons/rng/core/source32/XoShiRo128PlusPlusTest.java
+++ b/commons-rng-core/src/test/java/org/apache/commons/rng/core/source32/XoShiRo128PlusPlusTest.java
@@ -19,7 +19,7 @@ package org.apache.commons.rng.core.source32;
 import org.apache.commons.rng.core.RandomAssert;
 import org.junit.jupiter.api.Test;
 
-public class XoShiRo128PlusPlusTest {
+class XoShiRo128PlusPlusTest {
     /** The size of the array seed. */
     private static final int SEED_SIZE = 4;
 
@@ -72,41 +72,41 @@ public class XoShiRo128PlusPlusTest {
     };
 
     @Test
-    public void testReferenceCode() {
+    void testReferenceCode() {
         RandomAssert.assertEquals(EXPECTED_SEQUENCE, new XoShiRo128PlusPlus(SEED));
     }
 
     @Test
-    public void testConstructorWithZeroSeedIsNonFunctional() {
+    void testConstructorWithZeroSeedIsNonFunctional() {
         RandomAssert.assertNextIntZeroOutput(new XoShiRo128PlusPlus(new int[SEED_SIZE]), 2 * SEED_SIZE);
     }
 
     @Test
-    public void testConstructorWithSingleBitSeedIsFunctional() {
+    void testConstructorWithSingleBitSeedIsFunctional() {
         RandomAssert.assertIntArrayConstructorWithSingleBitSeedIsFunctional(XoShiRo128PlusPlus.class, SEED_SIZE);
     }
 
     @Test
-    public void testConstructorWithoutFullLengthSeed() {
+    void testConstructorWithoutFullLengthSeed() {
         // Hit the case when the input seed is self-seeded when not full length
         RandomAssert.assertNextLongNonZeroOutput(new XoShiRo128PlusPlus(new int[] {SEED[0]}),
                 SEED_SIZE, SEED_SIZE);
     }
 
     @Test
-    public void testElementConstructor() {
+    void testElementConstructor() {
         final XoShiRo128PlusPlus rng1 = new XoShiRo128PlusPlus(SEED);
         final XoShiRo128PlusPlus rng2 = new XoShiRo128PlusPlus(SEED[0], SEED[1], SEED[2], SEED[3]);
         RandomAssert.assertNextIntEquals(SEED.length * 2, rng1, rng2);
     }
 
     @Test
-    public void testJump() {
+    void testJump() {
         RandomAssert.assertJumpEquals(EXPECTED_SEQUENCE, EXPECTED_SEQUENCE_AFTER_JUMP, new XoShiRo128PlusPlus(SEED));
     }
 
     @Test
-    public void testLongJump() {
+    void testLongJump() {
         RandomAssert.assertLongJumpEquals(EXPECTED_SEQUENCE, EXPECTED_SEQUENCE_AFTER_LONG_JUMP, new XoShiRo128PlusPlus(SEED));
     }
 }
diff --git a/commons-rng-core/src/test/java/org/apache/commons/rng/core/source32/XoShiRo128PlusTest.java b/commons-rng-core/src/test/java/org/apache/commons/rng/core/source32/XoShiRo128PlusTest.java
index 092f75e..c9441e2 100644
--- a/commons-rng-core/src/test/java/org/apache/commons/rng/core/source32/XoShiRo128PlusTest.java
+++ b/commons-rng-core/src/test/java/org/apache/commons/rng/core/source32/XoShiRo128PlusTest.java
@@ -19,7 +19,7 @@ package org.apache.commons.rng.core.source32;
 import org.apache.commons.rng.core.RandomAssert;
 import org.junit.jupiter.api.Test;
 
-public class XoShiRo128PlusTest {
+class XoShiRo128PlusTest {
     /** The size of the array seed. */
     private static final int SEED_SIZE = 4;
 
@@ -72,41 +72,41 @@ public class XoShiRo128PlusTest {
     };
 
     @Test
-    public void testReferenceCode() {
+    void testReferenceCode() {
         RandomAssert.assertEquals(EXPECTED_SEQUENCE, new XoShiRo128Plus(SEED));
     }
 
     @Test
-    public void testConstructorWithZeroSeedIsNonFunctional() {
+    void testConstructorWithZeroSeedIsNonFunctional() {
         RandomAssert.assertNextIntZeroOutput(new XoShiRo128Plus(new int[SEED_SIZE]), 2 * SEED_SIZE);
     }
 
     @Test
-    public void testConstructorWithSingleBitSeedIsFunctional() {
+    void testConstructorWithSingleBitSeedIsFunctional() {
         RandomAssert.assertIntArrayConstructorWithSingleBitSeedIsFunctional(XoShiRo128Plus.class, SEED_SIZE);
     }
 
     @Test
-    public void testConstructorWithoutFullLengthSeed() {
+    void testConstructorWithoutFullLengthSeed() {
         // Hit the case when the input seed is self-seeded when not full length
         RandomAssert.assertNextLongNonZeroOutput(new XoShiRo128Plus(new int[] {SEED[0]}),
                 SEED_SIZE, SEED_SIZE);
     }
 
     @Test
-    public void testElementConstructor() {
+    void testElementConstructor() {
         final XoShiRo128Plus rng1 = new XoShiRo128Plus(SEED);
         final XoShiRo128Plus rng2 = new XoShiRo128Plus(SEED[0], SEED[1], SEED[2], SEED[3]);
         RandomAssert.assertNextIntEquals(SEED.length * 2, rng1, rng2);
     }
 
     @Test
-    public void testJump() {
+    void testJump() {
         RandomAssert.assertJumpEquals(EXPECTED_SEQUENCE, EXPECTED_SEQUENCE_AFTER_JUMP, new XoShiRo128Plus(SEED));
     }
 
     @Test
-    public void testLongJump() {
+    void testLongJump() {
         RandomAssert.assertLongJumpEquals(EXPECTED_SEQUENCE, EXPECTED_SEQUENCE_AFTER_LONG_JUMP, new XoShiRo128Plus(SEED));
     }
 }
diff --git a/commons-rng-core/src/test/java/org/apache/commons/rng/core/source32/XoShiRo128StarStarTest.java b/commons-rng-core/src/test/java/org/apache/commons/rng/core/source32/XoShiRo128StarStarTest.java
index a3319de..51ca1b5 100644
--- a/commons-rng-core/src/test/java/org/apache/commons/rng/core/source32/XoShiRo128StarStarTest.java
+++ b/commons-rng-core/src/test/java/org/apache/commons/rng/core/source32/XoShiRo128StarStarTest.java
@@ -19,7 +19,7 @@ package org.apache.commons.rng.core.source32;
 import org.apache.commons.rng.core.RandomAssert;
 import org.junit.jupiter.api.Test;
 
-public class XoShiRo128StarStarTest {
+class XoShiRo128StarStarTest {
     /** The size of the array seed. */
     private static final int SEED_SIZE = 4;
 
@@ -72,41 +72,41 @@ public class XoShiRo128StarStarTest {
     };
 
     @Test
-    public void testReferenceCode() {
+    void testReferenceCode() {
         RandomAssert.assertEquals(EXPECTED_SEQUENCE, new XoShiRo128StarStar(SEED));
     }
 
     @Test
-    public void testConstructorWithZeroSeedIsNonFunctional() {
+    void testConstructorWithZeroSeedIsNonFunctional() {
         RandomAssert.assertNextIntZeroOutput(new XoShiRo128StarStar(new int[SEED_SIZE]), 2 * SEED_SIZE);
     }
 
     @Test
-    public void testConstructorWithSingleBitSeedIsFunctional() {
+    void testConstructorWithSingleBitSeedIsFunctional() {
         RandomAssert.assertIntArrayConstructorWithSingleBitSeedIsFunctional(XoShiRo128StarStar.class, SEED_SIZE);
     }
 
     @Test
-    public void testConstructorWithoutFullLengthSeed() {
+    void testConstructorWithoutFullLengthSeed() {
         // Hit the case when the input seed is self-seeded when not full length
         RandomAssert.assertNextLongNonZeroOutput(new XoShiRo128StarStar(new int[] {SEED[0]}),
                 SEED_SIZE, SEED_SIZE);
     }
 
     @Test
-    public void testElementConstructor() {
+    void testElementConstructor() {
         final XoShiRo128StarStar rng1 = new XoShiRo128StarStar(SEED);
         final XoShiRo128StarStar rng2 = new XoShiRo128StarStar(SEED[0], SEED[1], SEED[2], SEED[3]);
         RandomAssert.assertNextIntEquals(SEED.length * 2, rng1, rng2);
     }
 
     @Test
-    public void testJump() {
+    void testJump() {
         RandomAssert.assertJumpEquals(EXPECTED_SEQUENCE, EXPECTED_SEQUENCE_AFTER_JUMP, new XoShiRo128StarStar(SEED));
     }
 
     @Test
-    public void testLongJump() {
+    void testLongJump() {
         RandomAssert.assertLongJumpEquals(EXPECTED_SEQUENCE, EXPECTED_SEQUENCE_AFTER_LONG_JUMP, new XoShiRo128StarStar(SEED));
     }
 }
diff --git a/commons-rng-core/src/test/java/org/apache/commons/rng/core/source64/DotyHumphreySmallFastCounting64Test.java b/commons-rng-core/src/test/java/org/apache/commons/rng/core/source64/DotyHumphreySmallFastCounting64Test.java
index 95e031b..4964436 100644
--- a/commons-rng-core/src/test/java/org/apache/commons/rng/core/source64/DotyHumphreySmallFastCounting64Test.java
+++ b/commons-rng-core/src/test/java/org/apache/commons/rng/core/source64/DotyHumphreySmallFastCounting64Test.java
@@ -20,9 +20,9 @@ package org.apache.commons.rng.core.source64;
 import org.apache.commons.rng.core.RandomAssert;
 import org.junit.jupiter.api.Test;
 
-public class DotyHumphreySmallFastCounting64Test {
+class DotyHumphreySmallFastCounting64Test {
     @Test
-    public void testReferenceCode() {
+    void testReferenceCode() {
         /*
          * Tested with respect to PractRand::RNGs::Raw::sfc64 of the C++ implementation (v0.94).
          * See : http://pracrand.sourceforge.net/
diff --git a/commons-rng-core/src/test/java/org/apache/commons/rng/core/source64/JenkinsSmallFast64Test.java b/commons-rng-core/src/test/java/org/apache/commons/rng/core/source64/JenkinsSmallFast64Test.java
index 938ea28..898eed0 100644
--- a/commons-rng-core/src/test/java/org/apache/commons/rng/core/source64/JenkinsSmallFast64Test.java
+++ b/commons-rng-core/src/test/java/org/apache/commons/rng/core/source64/JenkinsSmallFast64Test.java
@@ -20,9 +20,9 @@ package org.apache.commons.rng.core.source64;
 import org.apache.commons.rng.core.RandomAssert;
 import org.junit.jupiter.api.Test;
 
-public class JenkinsSmallFast64Test {
+class JenkinsSmallFast64Test {
     @Test
-    public void testReferenceCode() {
+    void testReferenceCode() {
         /*
          * Tested with respect to the original reference:
          * See : https://burtleburtle.net/bob/rand/smallprng.html
diff --git a/commons-rng-core/src/test/java/org/apache/commons/rng/core/source64/LongProviderTest.java b/commons-rng-core/src/test/java/org/apache/commons/rng/core/source64/LongProviderTest.java
index 1e4529f..b66ce87 100644
--- a/commons-rng-core/src/test/java/org/apache/commons/rng/core/source64/LongProviderTest.java
+++ b/commons-rng-core/src/test/java/org/apache/commons/rng/core/source64/LongProviderTest.java
@@ -24,7 +24,7 @@ import org.junit.jupiter.api.Test;
  * the source for {@link LongProvider#nextInt()} and
  * {@link LongProvider#nextBoolean()}.
  */
-public class LongProviderTest {
+class LongProviderTest {
     /**
      * A simple class to return a fixed value as the source for
      * {@link LongProvider#next()}.
@@ -75,7 +75,7 @@ public class LongProviderTest {
      * upper and then lower 32-bits from {@link LongProvider#nextLong()}.
      */
     @Test
-    public void testNextInt() {
+    void testNextInt() {
         final int max = 5;
         for (int i = 0; i < max; i++) {
             for (int j = 0; j < max; j++) {
@@ -97,7 +97,7 @@ public class LongProviderTest {
      * <p>The order should be from the least-significant bit.
      */
     @Test
-    public void testNextBoolean() {
+    void testNextBoolean() {
         for (int i = 0; i < Long.SIZE; i++) {
             // Set only a single bit in the source
             final long value = 1L << i;
diff --git a/commons-rng-core/src/test/java/org/apache/commons/rng/core/source64/MersenneTwister64Test.java b/commons-rng-core/src/test/java/org/apache/commons/rng/core/source64/MersenneTwister64Test.java
index 2b10447..a7f4aa7 100644
--- a/commons-rng-core/src/test/java/org/apache/commons/rng/core/source64/MersenneTwister64Test.java
+++ b/commons-rng-core/src/test/java/org/apache/commons/rng/core/source64/MersenneTwister64Test.java
@@ -20,9 +20,9 @@ import org.apache.commons.rng.core.RandomAssert;
 import org.junit.jupiter.api.Assertions;
 import org.junit.jupiter.api.Test;
 
-public class MersenneTwister64Test {
+class MersenneTwister64Test {
     @Test
-    public void testMakotoNishimura() {
+    void testMakotoNishimura() {
         final MersenneTwister64 rng = new MersenneTwister64(new long[] {0x12345L, 0x23456L, 0x34567L, 0x45678L});
 
         /*
@@ -287,7 +287,7 @@ public class MersenneTwister64Test {
     }
 
     @Test
-    public void testConstructorWithEmptySeed() {
+    void testConstructorWithEmptySeed() {
         // An empty seed is allowed
         final MersenneTwister64 rng = new MersenneTwister64(new long[0]);
         // It should be functional so check it returns different values.
diff --git a/commons-rng-core/src/test/java/org/apache/commons/rng/core/source64/PcgRxsMXs64Test.java b/commons-rng-core/src/test/java/org/apache/commons/rng/core/source64/PcgRxsMXs64Test.java
index 2615462..d6162ad 100644
--- a/commons-rng-core/src/test/java/org/apache/commons/rng/core/source64/PcgRxsMXs64Test.java
+++ b/commons-rng-core/src/test/java/org/apache/commons/rng/core/source64/PcgRxsMXs64Test.java
@@ -20,9 +20,9 @@ package org.apache.commons.rng.core.source64;
 import org.apache.commons.rng.core.RandomAssert;
 import org.junit.jupiter.api.Test;
 
-public class PcgRxsMXs64Test {
+class PcgRxsMXs64Test {
     @Test
-    public void testReferenceCode() {
+    void testReferenceCode() {
         /*
          * Tested with respect to pcg_engines::setseq_rxs_m_xs_64_64(x, y) of the C++ implementation.
          * See : http://www.pcg-random.org/download.html#cpp-implementation
@@ -45,7 +45,7 @@ public class PcgRxsMXs64Test {
     }
 
     @Test
-    public void testReferenceCodeFixedIncrement() {
+    void testReferenceCodeFixedIncrement() {
         /*
          * Tested with respect to pcg_engines::setseq_rxs_m_xs_64_64(x) of the C++ implementation.
          * See : http://www.pcg-random.org/download.html#cpp-implementation
diff --git a/commons-rng-core/src/test/java/org/apache/commons/rng/core/source64/SplitMix64Test.java b/commons-rng-core/src/test/java/org/apache/commons/rng/core/source64/SplitMix64Test.java
index 234b1c0..fe96931 100644
--- a/commons-rng-core/src/test/java/org/apache/commons/rng/core/source64/SplitMix64Test.java
+++ b/commons-rng-core/src/test/java/org/apache/commons/rng/core/source64/SplitMix64Test.java
@@ -19,9 +19,9 @@ package org.apache.commons.rng.core.source64;
 import org.apache.commons.rng.core.RandomAssert;
 import org.junit.jupiter.api.Test;
 
-public class SplitMix64Test {
+class SplitMix64Test {
     @Test
-    public void testReferenceCode() {
+    void testReferenceCode() {
         final long[] expectedSequence = {
             0x4141302768c9e9d0L, 0x64df48c4eab51b1aL, 0x4e723b53dbd901b3L, 0xead8394409dd6454L,
             0x3ef60e485b412a0aL, 0xb2a23aee63aecf38L, 0x6cc3b8933c4fa332L, 0x9c9e75e031e6fccbL,
diff --git a/commons-rng-core/src/test/java/org/apache/commons/rng/core/source64/TwoCmresTest.java b/commons-rng-core/src/test/java/org/apache/commons/rng/core/source64/TwoCmresTest.java
index 0d7f72c..d4680da 100644
--- a/commons-rng-core/src/test/java/org/apache/commons/rng/core/source64/TwoCmresTest.java
+++ b/commons-rng-core/src/test/java/org/apache/commons/rng/core/source64/TwoCmresTest.java
@@ -24,9 +24,9 @@ import org.junit.jupiter.api.Test;
 import java.util.ArrayList;
 
 
-public class TwoCmresTest {
+class TwoCmresTest {
     @Test
-    public void testAsymmetric() {
+    void testAsymmetric() {
         final int index1 = 2;
         final int index2 = 5;
         final int seed = -123456789;
@@ -47,7 +47,7 @@ public class TwoCmresTest {
      * thus a change of any single bit should make a different output.
      */
     @Test
-    public void testSeedingWithASingleBitProducesDifferentOutputFromZeroSeed() {
+    void testSeedingWithASingleBitProducesDifferentOutputFromZeroSeed() {
         final int n = 100;
 
         // Output with a zero seed
@@ -65,7 +65,7 @@ public class TwoCmresTest {
     }
 
     @Test
-    public void testSubcycleGeneratorsMustBeDifferent() {
+    void testSubcycleGeneratorsMustBeDifferent() {
         final int max = TwoCmres.numberOfSubcycleGenerators();
         for (int i = 0; i < max; i++) {
             final int subCycle = i;
@@ -75,7 +75,7 @@ public class TwoCmresTest {
     }
 
     @Test
-    public void testSubcycleGeneratorsIndex() {
+    void testSubcycleGeneratorsIndex() {
         final int seed = 246810;
 
         // Valid indices are between 0 (included) and max (excluded).
@@ -101,7 +101,7 @@ public class TwoCmresTest {
     }
 
     @Test
-    public void testCmresFactoryThrowsWithDuplicateMultiplier() {
+    void testCmresFactoryThrowsWithDuplicateMultiplier() {
         final ArrayList<Cmres> list = new ArrayList<>();
         final long multiply = 0;
         final int rotate = 3;
diff --git a/commons-rng-core/src/test/java/org/apache/commons/rng/core/source64/XoRoShiRo1024PlusPlusTest.java b/commons-rng-core/src/test/java/org/apache/commons/rng/core/source64/XoRoShiRo1024PlusPlusTest.java
index 3c8a02f..c61361e 100644
--- a/commons-rng-core/src/test/java/org/apache/commons/rng/core/source64/XoRoShiRo1024PlusPlusTest.java
+++ b/commons-rng-core/src/test/java/org/apache/commons/rng/core/source64/XoRoShiRo1024PlusPlusTest.java
@@ -19,7 +19,7 @@ package org.apache.commons.rng.core.source64;
 import org.apache.commons.rng.core.RandomAssert;
 import org.junit.jupiter.api.Test;
 
-public class XoRoShiRo1024PlusPlusTest {
+class XoRoShiRo1024PlusPlusTest {
     /** The size of the array SEED. */
     private static final int SEED_SIZE = 16;
 
@@ -75,34 +75,34 @@ public class XoRoShiRo1024PlusPlusTest {
     };
 
     @Test
-    public void testReferenceCode() {
+    void testReferenceCode() {
         RandomAssert.assertEquals(EXPECTED_SEQUENCE, new XoRoShiRo1024PlusPlus(SEED));
     }
 
     @Test
-    public void testConstructorWithZeroSeedIsNonFunctional() {
+    void testConstructorWithZeroSeedIsNonFunctional() {
         RandomAssert.assertNextIntZeroOutput(new XoRoShiRo1024PlusPlus(new long[SEED_SIZE]), 2 * SEED_SIZE);
     }
 
     @Test
-    public void testConstructorWithSingleBitSeedIsFunctional() {
+    void testConstructorWithSingleBitSeedIsFunctional() {
         RandomAssert.assertLongArrayConstructorWithSingleBitSeedIsFunctional(XoRoShiRo1024PlusPlus.class, SEED_SIZE);
     }
 
     @Test
-    public void testConstructorWithoutFullLengthSeed() {
+    void testConstructorWithoutFullLengthSeed() {
         // Hit the case when the input seed is self-seeded when not full length
         RandomAssert.assertNextLongNonZeroOutput(new XoRoShiRo1024PlusPlus(new long[] {SEED[0]}),
                 SEED_SIZE, SEED_SIZE);
     }
 
     @Test
-    public void testJump() {
+    void testJump() {
         RandomAssert.assertJumpEquals(EXPECTED_SEQUENCE, EXPECTED_SEQUENCE_AFTER_JUMP, new XoRoShiRo1024PlusPlus(SEED));
     }
 
     @Test
-    public void testLongJump() {
+    void testLongJump() {
         RandomAssert.assertLongJumpEquals(EXPECTED_SEQUENCE, EXPECTED_SEQUENCE_AFTER_LONG_JUMP, new XoRoShiRo1024PlusPlus(SEED));
     }
 }
diff --git a/commons-rng-core/src/test/java/org/apache/commons/rng/core/source64/XoRoShiRo1024StarStarTest.java b/commons-rng-core/src/test/java/org/apache/commons/rng/core/source64/XoRoShiRo1024StarStarTest.java
index 7ae986d..30bdf85 100644
--- a/commons-rng-core/src/test/java/org/apache/commons/rng/core/source64/XoRoShiRo1024StarStarTest.java
+++ b/commons-rng-core/src/test/java/org/apache/commons/rng/core/source64/XoRoShiRo1024StarStarTest.java
@@ -19,7 +19,7 @@ package org.apache.commons.rng.core.source64;
 import org.apache.commons.rng.core.RandomAssert;
 import org.junit.jupiter.api.Test;
 
-public class XoRoShiRo1024StarStarTest {
+class XoRoShiRo1024StarStarTest {
     /** The size of the array SEED. */
     private static final int SEED_SIZE = 16;
 
@@ -75,34 +75,34 @@ public class XoRoShiRo1024StarStarTest {
     };
 
     @Test
-    public void testReferenceCode() {
+    void testReferenceCode() {
         RandomAssert.assertEquals(EXPECTED_SEQUENCE, new XoRoShiRo1024StarStar(SEED));
     }
 
     @Test
-    public void testConstructorWithZeroSeedIsNonFunctional() {
+    void testConstructorWithZeroSeedIsNonFunctional() {
         RandomAssert.assertNextIntZeroOutput(new XoRoShiRo1024StarStar(new long[SEED_SIZE]), 2 * SEED_SIZE);
     }
 
     @Test
-    public void testConstructorWithSingleBitSeedIsFunctional() {
+    void testConstructorWithSingleBitSeedIsFunctional() {
         RandomAssert.assertLongArrayConstructorWithSingleBitSeedIsFunctional(XoRoShiRo1024StarStar.class, SEED_SIZE);
     }
 
     @Test
-    public void testConstructorWithoutFullLengthSeed() {
+    void testConstructorWithoutFullLengthSeed() {
         // Hit the case when the input seed is self-seeded when not full length
         RandomAssert.assertNextLongNonZeroOutput(new XoRoShiRo1024StarStar(new long[] {SEED[0]}),
                 SEED_SIZE, SEED_SIZE);
     }
 
     @Test
-    public void testJump() {
+    void testJump() {
         RandomAssert.assertJumpEquals(EXPECTED_SEQUENCE, EXPECTED_SEQUENCE_AFTER_JUMP, new XoRoShiRo1024StarStar(SEED));
     }
 
     @Test
-    public void testLongJump() {
+    void testLongJump() {
         RandomAssert.assertLongJumpEquals(EXPECTED_SEQUENCE, EXPECTED_SEQUENCE_AFTER_LONG_JUMP, new XoRoShiRo1024StarStar(SEED));
     }
 }
diff --git a/commons-rng-core/src/test/java/org/apache/commons/rng/core/source64/XoRoShiRo1024StarTest.java b/commons-rng-core/src/test/java/org/apache/commons/rng/core/source64/XoRoShiRo1024StarTest.java
index f768221..8c4137b 100644
--- a/commons-rng-core/src/test/java/org/apache/commons/rng/core/source64/XoRoShiRo1024StarTest.java
+++ b/commons-rng-core/src/test/java/org/apache/commons/rng/core/source64/XoRoShiRo1024StarTest.java
@@ -19,7 +19,7 @@ package org.apache.commons.rng.core.source64;
 import org.apache.commons.rng.core.RandomAssert;
 import org.junit.jupiter.api.Test;
 
-public class XoRoShiRo1024StarTest {
+class XoRoShiRo1024StarTest {
     /** The size of the array SEED. */
     private static final int SEED_SIZE = 16;
 
@@ -75,34 +75,34 @@ public class XoRoShiRo1024StarTest {
     };
 
     @Test
-    public void testReferenceCode() {
+    void testReferenceCode() {
         RandomAssert.assertEquals(EXPECTED_SEQUENCE, new XoRoShiRo1024Star(SEED));
     }
 
     @Test
-    public void testConstructorWithZeroSeedIsNonFunctional() {
+    void testConstructorWithZeroSeedIsNonFunctional() {
         RandomAssert.assertNextIntZeroOutput(new XoRoShiRo1024Star(new long[SEED_SIZE]), 2 * SEED_SIZE);
     }
 
     @Test
-    public void testConstructorWithSingleBitSeedIsFunctional() {
+    void testConstructorWithSingleBitSeedIsFunctional() {
         RandomAssert.assertLongArrayConstructorWithSingleBitSeedIsFunctional(XoRoShiRo1024Star.class, SEED_SIZE);
     }
 
     @Test
-    public void testConstructorWithoutFullLengthSeed() {
+    void testConstructorWithoutFullLengthSeed() {
         // Hit the case when the input seed is self-seeded when not full length
         RandomAssert.assertNextLongNonZeroOutput(new XoRoShiRo1024Star(new long[] {SEED[0]}),
                 SEED_SIZE, SEED_SIZE);
     }
 
     @Test
-    public void testJump() {
+    void testJump() {
         RandomAssert.assertJumpEquals(EXPECTED_SEQUENCE, EXPECTED_SEQUENCE_AFTER_JUMP, new XoRoShiRo1024Star(SEED));
     }
 
     @Test
-    public void testLongJump() {
+    void testLongJump() {
         RandomAssert.assertLongJumpEquals(EXPECTED_SEQUENCE, EXPECTED_SEQUENCE_AFTER_LONG_JUMP, new XoRoShiRo1024Star(SEED));
     }
 }
diff --git a/commons-rng-core/src/test/java/org/apache/commons/rng/core/source64/XoRoShiRo128PlusPlusTest.java b/commons-rng-core/src/test/java/org/apache/commons/rng/core/source64/XoRoShiRo128PlusPlusTest.java
index 660f78b..1a5313d 100644
--- a/commons-rng-core/src/test/java/org/apache/commons/rng/core/source64/XoRoShiRo128PlusPlusTest.java
+++ b/commons-rng-core/src/test/java/org/apache/commons/rng/core/source64/XoRoShiRo128PlusPlusTest.java
@@ -20,7 +20,7 @@ import org.apache.commons.rng.core.RandomAssert;
 import org.junit.jupiter.api.Test;
 import org.junit.jupiter.api.Assertions;
 
-public class XoRoShiRo128PlusPlusTest {
+class XoRoShiRo128PlusPlusTest {
     /** The size of the array SEED. */
     private static final int SEED_SIZE = 2;
 
@@ -73,41 +73,41 @@ public class XoRoShiRo128PlusPlusTest {
     };
 
     @Test
-    public void testReferenceCode() {
+    void testReferenceCode() {
         RandomAssert.assertEquals(EXPECTED_SEQUENCE, new XoRoShiRo128PlusPlus(SEED));
     }
 
     @Test
-    public void testConstructorWithZeroSeedIsNonFunctional() {
+    void testConstructorWithZeroSeedIsNonFunctional() {
         RandomAssert.assertNextIntZeroOutput(new XoRoShiRo128PlusPlus(new long[SEED_SIZE]), 2 * SEED_SIZE);
     }
 
     @Test
-    public void testConstructorWithSingleBitSeedIsFunctional() {
+    void testConstructorWithSingleBitSeedIsFunctional() {
         RandomAssert.assertLongArrayConstructorWithSingleBitSeedIsFunctional(XoRoShiRo128PlusPlus.class, SEED_SIZE);
     }
 
     @Test
-    public void testConstructorWithoutFullLengthSeed() {
+    void testConstructorWithoutFullLengthSeed() {
         // Hit the case when the input seed is self-seeded when not full length
         RandomAssert.assertNextLongNonZeroOutput(new XoRoShiRo128PlusPlus(new long[] {SEED[0]}),
                 SEED_SIZE, SEED_SIZE);
     }
 
     @Test
-    public void testElementConstructor() {
+    void testElementConstructor() {
         final XoRoShiRo128PlusPlus rng1 = new XoRoShiRo128PlusPlus(SEED);
         final XoRoShiRo128PlusPlus rng2 = new XoRoShiRo128PlusPlus(SEED[0], SEED[1]);
         RandomAssert.assertNextLongEquals(SEED.length * 2, rng1, rng2);
     }
 
     @Test
-    public void testJump() {
+    void testJump() {
         RandomAssert.assertJumpEquals(EXPECTED_SEQUENCE, EXPECTED_SEQUENCE_AFTER_JUMP, new XoRoShiRo128PlusPlus(SEED));
     }
 
     @Test
-    public void testLongJump() {
+    void testLongJump() {
         RandomAssert.assertLongJumpEquals(EXPECTED_SEQUENCE, EXPECTED_SEQUENCE_AFTER_LONG_JUMP, new XoRoShiRo128PlusPlus(SEED));
     }
 
@@ -117,7 +117,7 @@ public class XoRoShiRo128PlusPlusTest {
      * throws an exception if used.
      */
     @Test
-    public void testNextOutputThrows() {
+    void testNextOutputThrows() {
         Assertions.assertThrows(UnsupportedOperationException.class, () -> new XoRoShiRo128PlusPlus(SEED).nextOutput());
     }
 }
diff --git a/commons-rng-core/src/test/java/org/apache/commons/rng/core/source64/XoRoShiRo128PlusTest.java b/commons-rng-core/src/test/java/org/apache/commons/rng/core/source64/XoRoShiRo128PlusTest.java
index c7482f5..a5cf853 100644
--- a/commons-rng-core/src/test/java/org/apache/commons/rng/core/source64/XoRoShiRo128PlusTest.java
+++ b/commons-rng-core/src/test/java/org/apache/commons/rng/core/source64/XoRoShiRo128PlusTest.java
@@ -19,7 +19,7 @@ package org.apache.commons.rng.core.source64;
 import org.apache.commons.rng.core.RandomAssert;
 import org.junit.jupiter.api.Test;
 
-public class XoRoShiRo128PlusTest {
+class XoRoShiRo128PlusTest {
     /** The size of the array SEED. */
     private static final int SEED_SIZE = 2;
 
@@ -72,41 +72,41 @@ public class XoRoShiRo128PlusTest {
     };
 
     @Test
-    public void testReferenceCode() {
+    void testReferenceCode() {
         RandomAssert.assertEquals(EXPECTED_SEQUENCE, new XoRoShiRo128Plus(SEED));
     }
 
     @Test
-    public void testConstructorWithZeroSeedIsNonFunctional() {
+    void testConstructorWithZeroSeedIsNonFunctional() {
         RandomAssert.assertNextIntZeroOutput(new XoRoShiRo128Plus(new long[SEED_SIZE]), 2 * SEED_SIZE);
     }
 
     @Test
-    public void testConstructorWithSingleBitSeedIsFunctional() {
+    void testConstructorWithSingleBitSeedIsFunctional() {
         RandomAssert.assertLongArrayConstructorWithSingleBitSeedIsFunctional(XoRoShiRo128Plus.class, SEED_SIZE);
     }
 
     @Test
-    public void testConstructorWithoutFullLengthSeed() {
+    void testConstructorWithoutFullLengthSeed() {
         // Hit the case when the input seed is self-seeded when not full length
         RandomAssert.assertNextLongNonZeroOutput(new XoRoShiRo128Plus(new long[] {SEED[0]}),
                 SEED_SIZE, SEED_SIZE);
     }
 
     @Test
-    public void testElementConstructor() {
+    void testElementConstructor() {
         final XoRoShiRo128Plus rng1 = new XoRoShiRo128Plus(SEED);
         final XoRoShiRo128Plus rng2 = new XoRoShiRo128Plus(SEED[0], SEED[1]);
         RandomAssert.assertNextLongEquals(SEED.length * 2, rng1, rng2);
     }
 
     @Test
-    public void testJump() {
+    void testJump() {
         RandomAssert.assertJumpEquals(EXPECTED_SEQUENCE, EXPECTED_SEQUENCE_AFTER_JUMP, new XoRoShiRo128Plus(SEED));
     }
 
     @Test
-    public void testLongJump() {
+    void testLongJump() {
         RandomAssert.assertLongJumpEquals(EXPECTED_SEQUENCE, EXPECTED_SEQUENCE_AFTER_LONG_JUMP, new XoRoShiRo128Plus(SEED));
     }
 }
diff --git a/commons-rng-core/src/test/java/org/apache/commons/rng/core/source64/XoRoShiRo128StarStarTest.java b/commons-rng-core/src/test/java/org/apache/commons/rng/core/source64/XoRoShiRo128StarStarTest.java
index ec05345..05699e6 100644
--- a/commons-rng-core/src/test/java/org/apache/commons/rng/core/source64/XoRoShiRo128StarStarTest.java
+++ b/commons-rng-core/src/test/java/org/apache/commons/rng/core/source64/XoRoShiRo128StarStarTest.java
@@ -19,7 +19,7 @@ package org.apache.commons.rng.core.source64;
 import org.apache.commons.rng.core.RandomAssert;
 import org.junit.jupiter.api.Test;
 
-public class XoRoShiRo128StarStarTest {
+class XoRoShiRo128StarStarTest {
     /** The size of the array SEED. */
     private static final int SEED_SIZE = 2;
 
@@ -72,41 +72,41 @@ public class XoRoShiRo128StarStarTest {
     };
 
     @Test
-    public void testReferenceCode() {
+    void testReferenceCode() {
         RandomAssert.assertEquals(EXPECTED_SEQUENCE, new XoRoShiRo128StarStar(SEED));
     }
 
     @Test
-    public void testConstructorWithZeroSeedIsNonFunctional() {
+    void testConstructorWithZeroSeedIsNonFunctional() {
         RandomAssert.assertNextIntZeroOutput(new XoRoShiRo128StarStar(new long[SEED_SIZE]), 2 * SEED_SIZE);
     }
 
     @Test
-    public void testConstructorWithSingleBitSeedIsFunctional() {
+    void testConstructorWithSingleBitSeedIsFunctional() {
         RandomAssert.assertLongArrayConstructorWithSingleBitSeedIsFunctional(XoRoShiRo128StarStar.class, SEED_SIZE);
     }
 
     @Test
-    public void testConstructorWithoutFullLengthSeed() {
+    void testConstructorWithoutFullLengthSeed() {
         // Hit the case when the input seed is self-seeded when not full length
         RandomAssert.assertNextLongNonZeroOutput(new XoRoShiRo128StarStar(new long[] {SEED[0]}),
                 SEED_SIZE, SEED_SIZE);
     }
 
     @Test
-    public void testElementConstructor() {
+    void testElementConstructor() {
         final XoRoShiRo128StarStar rng1 = new XoRoShiRo128StarStar(SEED);
         final XoRoShiRo128StarStar rng2 = new XoRoShiRo128StarStar(SEED[0], SEED[1]);
         RandomAssert.assertNextLongEquals(SEED.length * 2, rng1, rng2);
     }
 
     @Test
-    public void testJump() {
+    void testJump() {
         RandomAssert.assertJumpEquals(EXPECTED_SEQUENCE, EXPECTED_SEQUENCE_AFTER_JUMP, new XoRoShiRo128StarStar(SEED));
     }
 
     @Test
-    public void testLongJump() {
+    void testLongJump() {
         RandomAssert.assertLongJumpEquals(EXPECTED_SEQUENCE, EXPECTED_SEQUENCE_AFTER_LONG_JUMP, new XoRoShiRo128StarStar(SEED));
     }
 }
diff --git a/commons-rng-core/src/test/java/org/apache/commons/rng/core/source64/XoShiRo256PlusPlusTest.java b/commons-rng-core/src/test/java/org/apache/commons/rng/core/source64/XoShiRo256PlusPlusTest.java
index 9664197..89ce863 100644
--- a/commons-rng-core/src/test/java/org/apache/commons/rng/core/source64/XoShiRo256PlusPlusTest.java
+++ b/commons-rng-core/src/test/java/org/apache/commons/rng/core/source64/XoShiRo256PlusPlusTest.java
@@ -19,7 +19,7 @@ package org.apache.commons.rng.core.source64;
 import org.apache.commons.rng.core.RandomAssert;
 import org.junit.jupiter.api.Test;
 
-public class XoShiRo256PlusPlusTest {
+class XoShiRo256PlusPlusTest {
     /** The size of the array SEED. */
     private static final int SEED_SIZE = 4;
 
@@ -72,41 +72,41 @@ public class XoShiRo256PlusPlusTest {
     };
 
     @Test
-    public void testReferenceCode() {
+    void testReferenceCode() {
         RandomAssert.assertEquals(EXPECTED_SEQUENCE, new XoShiRo256PlusPlus(SEED));
     }
 
     @Test
-    public void testConstructorWithZeroSeedIsNonFunctional() {
+    void testConstructorWithZeroSeedIsNonFunctional() {
         RandomAssert.assertNextIntZeroOutput(new XoShiRo256PlusPlus(new long[SEED_SIZE]), 2 * SEED_SIZE);
     }
 
     @Test
-    public void testConstructorWithSingleBitSeedIsFunctional() {
+    void testConstructorWithSingleBitSeedIsFunctional() {
         RandomAssert.assertLongArrayConstructorWithSingleBitSeedIsFunctional(XoShiRo256PlusPlus.class, SEED_SIZE);
     }
 
     @Test
-    public void testConstructorWithoutFullLengthSeed() {
+    void testConstructorWithoutFullLengthSeed() {
         // Hit the case when the input seed is self-seeded when not full length
         RandomAssert.assertNextLongNonZeroOutput(new XoShiRo256PlusPlus(new long[] {SEED[0]}),
                 SEED_SIZE, SEED_SIZE);
     }
 
     @Test
-    public void testElementConstructor() {
+    void testElementConstructor() {
         final XoShiRo256PlusPlus rng1 = new XoShiRo256PlusPlus(SEED);
         final XoShiRo256PlusPlus rng2 = new XoShiRo256PlusPlus(SEED[0], SEED[1], SEED[2], SEED[3]);
         RandomAssert.assertNextLongEquals(SEED.length * 2, rng1, rng2);
     }
 
     @Test
-    public void testJump() {
+    void testJump() {
         RandomAssert.assertJumpEquals(EXPECTED_SEQUENCE, EXPECTED_SEQUENCE_AFTER_JUMP, new XoShiRo256PlusPlus(SEED));
     }
 
     @Test
-    public void testLongJump() {
+    void testLongJump() {
         RandomAssert.assertLongJumpEquals(EXPECTED_SEQUENCE, EXPECTED_SEQUENCE_AFTER_LONG_JUMP, new XoShiRo256PlusPlus(SEED));
     }
 }
diff --git a/commons-rng-core/src/test/java/org/apache/commons/rng/core/source64/XoShiRo256PlusTest.java b/commons-rng-core/src/test/java/org/apache/commons/rng/core/source64/XoShiRo256PlusTest.java
index 9c6a1c4..1395dad 100644
--- a/commons-rng-core/src/test/java/org/apache/commons/rng/core/source64/XoShiRo256PlusTest.java
+++ b/commons-rng-core/src/test/java/org/apache/commons/rng/core/source64/XoShiRo256PlusTest.java
@@ -19,7 +19,7 @@ package org.apache.commons.rng.core.source64;
 import org.apache.commons.rng.core.RandomAssert;
 import org.junit.jupiter.api.Test;
 
-public class XoShiRo256PlusTest {
+class XoShiRo256PlusTest {
     /** The size of the array SEED. */
     private static final int SEED_SIZE = 4;
 
@@ -72,41 +72,41 @@ public class XoShiRo256PlusTest {
     };
 
     @Test
-    public void testReferenceCode() {
+    void testReferenceCode() {
         RandomAssert.assertEquals(EXPECTED_SEQUENCE, new XoShiRo256Plus(SEED));
     }
 
     @Test
-    public void testConstructorWithZeroSeedIsNonFunctional() {
+    void testConstructorWithZeroSeedIsNonFunctional() {
         RandomAssert.assertNextIntZeroOutput(new XoShiRo256Plus(new long[SEED_SIZE]), 2 * SEED_SIZE);
     }
 
     @Test
-    public void testConstructorWithSingleBitSeedIsFunctional() {
+    void testConstructorWithSingleBitSeedIsFunctional() {
         RandomAssert.assertLongArrayConstructorWithSingleBitSeedIsFunctional(XoShiRo256Plus.class, SEED_SIZE);
     }
 
     @Test
-    public void testConstructorWithoutFullLengthSeed() {
+    void testConstructorWithoutFullLengthSeed() {
         // Hit the case when the input seed is self-seeded when not full length
         RandomAssert.assertNextLongNonZeroOutput(new XoShiRo256Plus(new long[] {SEED[0]}),
                 SEED_SIZE, SEED_SIZE);
     }
 
     @Test
-    public void testElementConstructor() {
+    void testElementConstructor() {
         final XoShiRo256Plus rng1 = new XoShiRo256Plus(SEED);
         final XoShiRo256Plus rng2 = new XoShiRo256Plus(SEED[0], SEED[1], SEED[2], SEED[3]);
         RandomAssert.assertNextLongEquals(SEED.length * 2, rng1, rng2);
     }
 
     @Test
-    public void testJump() {
+    void testJump() {
         RandomAssert.assertJumpEquals(EXPECTED_SEQUENCE, EXPECTED_SEQUENCE_AFTER_JUMP, new XoShiRo256Plus(SEED));
     }
 
     @Test
-    public void testLongJump() {
+    void testLongJump() {
         RandomAssert.assertLongJumpEquals(EXPECTED_SEQUENCE, EXPECTED_SEQUENCE_AFTER_LONG_JUMP, new XoShiRo256Plus(SEED));
     }
 }
diff --git a/commons-rng-core/src/test/java/org/apache/commons/rng/core/source64/XoShiRo256StarStarTest.java b/commons-rng-core/src/test/java/org/apache/commons/rng/core/source64/XoShiRo256StarStarTest.java
index 1e0a7df..2f62951 100644
--- a/commons-rng-core/src/test/java/org/apache/commons/rng/core/source64/XoShiRo256StarStarTest.java
+++ b/commons-rng-core/src/test/java/org/apache/commons/rng/core/source64/XoShiRo256StarStarTest.java
@@ -19,7 +19,7 @@ package org.apache.commons.rng.core.source64;
 import org.apache.commons.rng.core.RandomAssert;
 import org.junit.jupiter.api.Test;
 
-public class XoShiRo256StarStarTest {
+class XoShiRo256StarStarTest {
     /** The size of the array SEED. */
     private static final int SEED_SIZE = 4;
 
@@ -72,41 +72,41 @@ public class XoShiRo256StarStarTest {
     };
 
     @Test
-    public void testReferenceCode() {
+    void testReferenceCode() {
         RandomAssert.assertEquals(EXPECTED_SEQUENCE, new XoShiRo256StarStar(SEED));
     }
 
     @Test
-    public void testConstructorWithZeroSeedIsNonFunctional() {
+    void testConstructorWithZeroSeedIsNonFunctional() {
         RandomAssert.assertNextIntZeroOutput(new XoShiRo256StarStar(new long[SEED_SIZE]), 2 * SEED_SIZE);
     }
 
     @Test
-    public void testConstructorWithSingleBitSeedIsFunctional() {
+    void testConstructorWithSingleBitSeedIsFunctional() {
         RandomAssert.assertLongArrayConstructorWithSingleBitSeedIsFunctional(XoShiRo256StarStar.class, SEED_SIZE);
     }
 
     @Test
-    public void testConstructorWithoutFullLengthSeed() {
+    void testConstructorWithoutFullLengthSeed() {
         // Hit the case when the input seed is self-seeded when not full length
         RandomAssert.assertNextLongNonZeroOutput(new XoShiRo256StarStar(new long[] {SEED[0]}),
                 SEED_SIZE, SEED_SIZE);
     }
 
     @Test
-    public void testElementConstructor() {
+    void testElementConstructor() {
         final XoShiRo256StarStar rng1 = new XoShiRo256StarStar(SEED);
         final XoShiRo256StarStar rng2 = new XoShiRo256StarStar(SEED[0], SEED[1], SEED[2], SEED[3]);
         RandomAssert.assertNextLongEquals(SEED.length * 2, rng1, rng2);
     }
 
     @Test
-    public void testJump() {
+    void testJump() {
         RandomAssert.assertJumpEquals(EXPECTED_SEQUENCE, EXPECTED_SEQUENCE_AFTER_JUMP, new XoShiRo256StarStar(SEED));
     }
 
     @Test
-    public void testLongJump() {
+    void testLongJump() {
         RandomAssert.assertLongJumpEquals(EXPECTED_SEQUENCE, EXPECTED_SEQUENCE_AFTER_LONG_JUMP, new XoShiRo256StarStar(SEED));
     }
 }
diff --git a/commons-rng-core/src/test/java/org/apache/commons/rng/core/source64/XoShiRo512PlusPlusTest.java b/commons-rng-core/src/test/java/org/apache/commons/rng/core/source64/XoShiRo512PlusPlusTest.java
index 1e3dc36..ab20624 100644
--- a/commons-rng-core/src/test/java/org/apache/commons/rng/core/source64/XoShiRo512PlusPlusTest.java
+++ b/commons-rng-core/src/test/java/org/apache/commons/rng/core/source64/XoShiRo512PlusPlusTest.java
@@ -19,7 +19,7 @@ package org.apache.commons.rng.core.source64;
 import org.apache.commons.rng.core.RandomAssert;
 import org.junit.jupiter.api.Test;
 
-public class XoShiRo512PlusPlusTest {
+class XoShiRo512PlusPlusTest {
     /** The size of the array SEED. */
     private static final int SEED_SIZE = 8;
 
@@ -73,29 +73,29 @@ public class XoShiRo512PlusPlusTest {
     };
 
     @Test
-    public void testReferenceCode() {
+    void testReferenceCode() {
         RandomAssert.assertEquals(EXPECTED_SEQUENCE, new XoShiRo512PlusPlus(SEED));
     }
 
     @Test
-    public void testConstructorWithZeroSeedIsNonFunctional() {
+    void testConstructorWithZeroSeedIsNonFunctional() {
         RandomAssert.assertNextIntZeroOutput(new XoShiRo512PlusPlus(new long[SEED_SIZE]), 2 * SEED_SIZE);
     }
 
     @Test
-    public void testConstructorWithSingleBitSeedIsFunctional() {
+    void testConstructorWithSingleBitSeedIsFunctional() {
         RandomAssert.assertLongArrayConstructorWithSingleBitSeedIsFunctional(XoShiRo512PlusPlus.class, SEED_SIZE);
     }
 
     @Test
-    public void testConstructorWithoutFullLengthSeed() {
+    void testConstructorWithoutFullLengthSeed() {
         // Hit the case when the input seed is self-seeded when not full length
         RandomAssert.assertNextLongNonZeroOutput(new XoShiRo512PlusPlus(new long[] {SEED[0]}),
                 SEED_SIZE, SEED_SIZE);
     }
 
     @Test
-    public void testElementConstructor() {
+    void testElementConstructor() {
         final XoShiRo512PlusPlus rng1 = new XoShiRo512PlusPlus(SEED);
         final XoShiRo512PlusPlus rng2 = new XoShiRo512PlusPlus(SEED[0], SEED[1], SEED[2], SEED[3],
                                                                SEED[4], SEED[5], SEED[6], SEED[7]);
@@ -103,12 +103,12 @@ public class XoShiRo512PlusPlusTest {
     }
 
     @Test
-    public void testJump() {
+    void testJump() {
         RandomAssert.assertJumpEquals(EXPECTED_SEQUENCE, EXPECTED_SEQUENCE_AFTER_JUMP, new XoShiRo512PlusPlus(SEED));
     }
 
     @Test
-    public void testLongJump() {
+    void testLongJump() {
         RandomAssert.assertLongJumpEquals(EXPECTED_SEQUENCE, EXPECTED_SEQUENCE_AFTER_LONG_JUMP, new XoShiRo512PlusPlus(SEED));
     }
 }
diff --git a/commons-rng-core/src/test/java/org/apache/commons/rng/core/source64/XoShiRo512PlusTest.java b/commons-rng-core/src/test/java/org/apache/commons/rng/core/source64/XoShiRo512PlusTest.java
index 4b16cd1..76d41cd 100644
--- a/commons-rng-core/src/test/java/org/apache/commons/rng/core/source64/XoShiRo512PlusTest.java
+++ b/commons-rng-core/src/test/java/org/apache/commons/rng/core/source64/XoShiRo512PlusTest.java
@@ -19,7 +19,7 @@ package org.apache.commons.rng.core.source64;
 import org.apache.commons.rng.core.RandomAssert;
 import org.junit.jupiter.api.Test;
 
-public class XoShiRo512PlusTest {
+class XoShiRo512PlusTest {
     /** The size of the array SEED. */
     private static final int SEED_SIZE = 8;
 
@@ -73,29 +73,29 @@ public class XoShiRo512PlusTest {
     };
 
     @Test
-    public void testReferenceCode() {
+    void testReferenceCode() {
         RandomAssert.assertEquals(EXPECTED_SEQUENCE, new XoShiRo512Plus(SEED));
     }
 
     @Test
-    public void testConstructorWithZeroSeedIsNonFunctional() {
+    void testConstructorWithZeroSeedIsNonFunctional() {
         RandomAssert.assertNextIntZeroOutput(new XoShiRo512Plus(new long[SEED_SIZE]), 2 * SEED_SIZE);
     }
 
     @Test
-    public void testConstructorWithSingleBitSeedIsFunctional() {
+    void testConstructorWithSingleBitSeedIsFunctional() {
         RandomAssert.assertLongArrayConstructorWithSingleBitSeedIsFunctional(XoShiRo512Plus.class, SEED_SIZE);
     }
 
     @Test
-    public void testConstructorWithoutFullLengthSeed() {
+    void testConstructorWithoutFullLengthSeed() {
         // Hit the case when the input seed is self-seeded when not full length
         RandomAssert.assertNextLongNonZeroOutput(new XoShiRo512Plus(new long[] {SEED[0]}),
                 SEED_SIZE, SEED_SIZE);
     }
 
     @Test
-    public void testElementConstructor() {
+    void testElementConstructor() {
         final XoShiRo512Plus rng1 = new XoShiRo512Plus(SEED);
         final XoShiRo512Plus rng2 = new XoShiRo512Plus(SEED[0], SEED[1], SEED[2], SEED[3],
                                                        SEED[4], SEED[5], SEED[6], SEED[7]);
@@ -103,12 +103,12 @@ public class XoShiRo512PlusTest {
     }
 
     @Test
-    public void testJump() {
+    void testJump() {
         RandomAssert.assertJumpEquals(EXPECTED_SEQUENCE, EXPECTED_SEQUENCE_AFTER_JUMP, new XoShiRo512Plus(SEED));
     }
 
     @Test
-    public void testLongJump() {
+    void testLongJump() {
         RandomAssert.assertLongJumpEquals(EXPECTED_SEQUENCE, EXPECTED_SEQUENCE_AFTER_LONG_JUMP, new XoShiRo512Plus(SEED));
     }
 }
diff --git a/commons-rng-core/src/test/java/org/apache/commons/rng/core/source64/XoShiRo512StarStarTest.java b/commons-rng-core/src/test/java/org/apache/commons/rng/core/source64/XoShiRo512StarStarTest.java
index cc19dd8..87d95e9 100644
--- a/commons-rng-core/src/test/java/org/apache/commons/rng/core/source64/XoShiRo512StarStarTest.java
+++ b/commons-rng-core/src/test/java/org/apache/commons/rng/core/source64/XoShiRo512StarStarTest.java
@@ -19,7 +19,7 @@ package org.apache.commons.rng.core.source64;
 import org.apache.commons.rng.core.RandomAssert;
 import org.junit.jupiter.api.Test;
 
-public class XoShiRo512StarStarTest {
+class XoShiRo512StarStarTest {
     /** The size of the array SEED. */
     private static final int SEED_SIZE = 8;
 
@@ -73,29 +73,29 @@ public class XoShiRo512StarStarTest {
     };
 
     @Test
-    public void testReferenceCode() {
+    void testReferenceCode() {
         RandomAssert.assertEquals(EXPECTED_SEQUENCE, new XoShiRo512StarStar(SEED));
     }
 
     @Test
-    public void testConstructorWithZeroSeedIsNonFunctional() {
+    void testConstructorWithZeroSeedIsNonFunctional() {
         RandomAssert.assertNextIntZeroOutput(new XoShiRo512StarStar(new long[SEED_SIZE]), 2 * SEED_SIZE);
     }
 
     @Test
-    public void testConstructorWithSingleBitSeedIsFunctional() {
+    void testConstructorWithSingleBitSeedIsFunctional() {
         RandomAssert.assertLongArrayConstructorWithSingleBitSeedIsFunctional(XoShiRo512StarStar.class, SEED_SIZE);
     }
 
     @Test
-    public void testConstructorWithoutFullLengthSeed() {
+    void testConstructorWithoutFullLengthSeed() {
         // Hit the case when the input seed is self-seeded when not full length
         RandomAssert.assertNextLongNonZeroOutput(new XoShiRo512StarStar(new long[] {SEED[0]}),
                 SEED_SIZE, SEED_SIZE);
     }
 
     @Test
-    public void testElementConstructor() {
+    void testElementConstructor() {
         final XoShiRo512StarStar rng1 = new XoShiRo512StarStar(SEED);
         final XoShiRo512StarStar rng2 = new XoShiRo512StarStar(SEED[0], SEED[1], SEED[2], SEED[3],
                                                                SEED[4], SEED[5], SEED[6], SEED[7]);
@@ -103,12 +103,12 @@ public class XoShiRo512StarStarTest {
     }
 
     @Test
-    public void testJump() {
+    void testJump() {
         RandomAssert.assertJumpEquals(EXPECTED_SEQUENCE, EXPECTED_SEQUENCE_AFTER_JUMP, new XoShiRo512StarStar(SEED));
     }
 
     @Test
-    public void testLongJump() {
+    void testLongJump() {
         RandomAssert.assertLongJumpEquals(EXPECTED_SEQUENCE, EXPECTED_SEQUENCE_AFTER_LONG_JUMP, new XoShiRo512StarStar(SEED));
     }
 }
diff --git a/commons-rng-core/src/test/java/org/apache/commons/rng/core/source64/XorShift1024StarPhiTest.java b/commons-rng-core/src/test/java/org/apache/commons/rng/core/source64/XorShift1024StarPhiTest.java
index 28f5feb..9d1bc88 100644
--- a/commons-rng-core/src/test/java/org/apache/commons/rng/core/source64/XorShift1024StarPhiTest.java
+++ b/commons-rng-core/src/test/java/org/apache/commons/rng/core/source64/XorShift1024StarPhiTest.java
@@ -19,7 +19,7 @@ package org.apache.commons.rng.core.source64;
 import org.apache.commons.rng.core.RandomAssert;
 import org.junit.jupiter.api.Test;
 
-public class XorShift1024StarPhiTest {
+class XorShift1024StarPhiTest {
     /** The size of the array SEED. */
     private static final int SEED_SIZE = 16;
 
@@ -62,22 +62,22 @@ public class XorShift1024StarPhiTest {
     };
 
     @Test
-    public void testReferenceCode() {
+    void testReferenceCode() {
         RandomAssert.assertEquals(EXPECTED_SEQUENCE, new XorShift1024StarPhi(SEED));
     }
 
     @Test
-    public void testConstructorWithZeroSeedIsNonFunctional() {
+    void testConstructorWithZeroSeedIsNonFunctional() {
         RandomAssert.assertNextIntZeroOutput(new XorShift1024StarPhi(new long[SEED_SIZE]), 2 * SEED_SIZE);
     }
 
     @Test
-    public void testConstructorWithSingleBitSeedIsFunctional() {
+    void testConstructorWithSingleBitSeedIsFunctional() {
         RandomAssert.assertLongArrayConstructorWithSingleBitSeedIsFunctional(XorShift1024StarPhi.class, SEED_SIZE);
     }
 
     @Test
-    public void testJump() {
+    void testJump() {
         RandomAssert.assertJumpEquals(EXPECTED_SEQUENCE, EXPECTED_SEQUENCE_AFTER_JUMP, new XorShift1024StarPhi(SEED));
     }
 }
diff --git a/commons-rng-core/src/test/java/org/apache/commons/rng/core/source64/XorShift1024StarTest.java b/commons-rng-core/src/test/java/org/apache/commons/rng/core/source64/XorShift1024StarTest.java
index 82f80f4..b08a15d 100644
--- a/commons-rng-core/src/test/java/org/apache/commons/rng/core/source64/XorShift1024StarTest.java
+++ b/commons-rng-core/src/test/java/org/apache/commons/rng/core/source64/XorShift1024StarTest.java
@@ -19,7 +19,7 @@ package org.apache.commons.rng.core.source64;
 import org.apache.commons.rng.core.RandomAssert;
 import org.junit.jupiter.api.Test;
 
-public class XorShift1024StarTest {
+class XorShift1024StarTest {
     /** The size of the array SEED. */
     private static final int SEED_SIZE = 16;
 
@@ -62,22 +62,22 @@ public class XorShift1024StarTest {
     };
 
     @Test
-    public void testReferenceCode() {
+    void testReferenceCode() {
         RandomAssert.assertEquals(EXPECTED_SEQUENCE, new XorShift1024Star(SEED));
     }
 
     @Test
-    public void testConstructorWithZeroSeedIsNonFunctional() {
+    void testConstructorWithZeroSeedIsNonFunctional() {
         RandomAssert.assertNextIntZeroOutput(new XorShift1024Star(new long[SEED_SIZE]), 2 * SEED_SIZE);
     }
 
     @Test
-    public void testConstructorWithSingleBitSeedIsFunctional() {
+    void testConstructorWithSingleBitSeedIsFunctional() {
         RandomAssert.assertLongArrayConstructorWithSingleBitSeedIsFunctional(XorShift1024Star.class, SEED_SIZE);
     }
 
     @Test
-    public void testJump() {
+    void testJump() {
         RandomAssert.assertJumpEquals(EXPECTED_SEQUENCE, EXPECTED_SEQUENCE_AFTER_JUMP, new XorShift1024Star(SEED));
     }
 }
diff --git a/commons-rng-core/src/test/java/org/apache/commons/rng/core/util/NumberFactoryTest.java b/commons-rng-core/src/test/java/org/apache/commons/rng/core/util/NumberFactoryTest.java
index e145b71..cfa9fb5 100644
--- a/commons-rng-core/src/test/java/org/apache/commons/rng/core/util/NumberFactoryTest.java
+++ b/commons-rng-core/src/test/java/org/apache/commons/rng/core/util/NumberFactoryTest.java
@@ -23,7 +23,7 @@ import org.junit.jupiter.api.Test;
 /**
  * Tests for the {@link NumberFactory}.
  */
-public class NumberFactoryTest {
+class NumberFactoryTest {
     /** sizeof(int). */
     private static final int INT_SIZE = 4;
     /** sizeof(long). */
@@ -38,7 +38,7 @@ public class NumberFactoryTest {
         Integer.MAX_VALUE, Integer.MIN_VALUE, 0x9e3779b9};
 
     @Test
-    public void testMakeBooleanFromInt() {
+    void testMakeBooleanFromInt() {
         // Test if the bit is set differently then the booleans are opposite
         final boolean b1 = NumberFactory.makeBoolean(0);
         final boolean b2 = NumberFactory.makeBoolean(0xffffffff);
@@ -46,7 +46,7 @@ public class NumberFactoryTest {
     }
 
     @Test
-    public void testMakeBooleanFromLong() {
+    void testMakeBooleanFromLong() {
         // Test if the bit is set differently then the booleans are opposite
         final boolean b1 = NumberFactory.makeBoolean(0L);
         final boolean b2 = NumberFactory.makeBoolean(0xffffffffffffffffL);
@@ -54,7 +54,7 @@ public class NumberFactoryTest {
     }
 
     @Test
-    public void testMakeIntFromLong() {
+    void testMakeIntFromLong() {
         // Test the high order bits and low order bits are xor'd together
         Assertions.assertEquals(0xffffffff, NumberFactory.makeInt(0xffffffff00000000L));
         Assertions.assertEquals(0x00000000, NumberFactory.makeInt(0xffffffffffffffffL));
@@ -67,7 +67,7 @@ public class NumberFactoryTest {
     }
 
     @Test
-    public void testExtractLoExtractHi() {
+    void testExtractLoExtractHi() {
         for (long v : LONG_TEST_VALUES) {
             final int vL = NumberFactory.extractLo(v);
             final int vH = NumberFactory.extractHi(v);
@@ -78,7 +78,7 @@ public class NumberFactoryTest {
     }
 
     @Test
-    public void testLong2Long() {
+    void testLong2Long() {
         for (long v : LONG_TEST_VALUES) {
             final int vL = NumberFactory.extractLo(v);
             final int vH = NumberFactory.extractHi(v);
@@ -88,7 +88,7 @@ public class NumberFactoryTest {
     }
 
     @Test
-    public void testLongToByteArraySignificanceOrder() {
+    void testLongToByteArraySignificanceOrder() {
         // Start at the least significant bit
         long value = 1;
         for (int i = 0; i < LONG_SIZE; i++) {
@@ -103,7 +103,7 @@ public class NumberFactoryTest {
     }
 
     @Test
-    public void testLongFromByteArray2Long() {
+    void testLongFromByteArray2Long() {
         for (long expected : LONG_TEST_VALUES) {
             final byte[] b = NumberFactory.makeByteArray(expected);
             Assertions.assertEquals(expected, NumberFactory.makeLong(b));
@@ -111,13 +111,13 @@ public class NumberFactoryTest {
     }
 
     @Test
-    public void testLongArrayFromByteArray2LongArray() {
+    void testLongArrayFromByteArray2LongArray() {
         final byte[] b = NumberFactory.makeByteArray(LONG_TEST_VALUES);
         Assertions.assertArrayEquals(LONG_TEST_VALUES, NumberFactory.makeLongArray(b));
     }
 
     @Test
-    public void testLongArrayToByteArrayMatchesLongToByteArray() {
+    void testLongArrayToByteArrayMatchesLongToByteArray() {
         // Test individually the bytes are the same as the array conversion
         for (int i = 0; i < LONG_TEST_VALUES.length; i++) {
             final byte[] b1 = NumberFactory.makeByteArray(LONG_TEST_VALUES[i]);
@@ -127,7 +127,7 @@ public class NumberFactoryTest {
     }
 
     @Test
-    public void testIntToByteArraySignificanceOrder() {
+    void testIntToByteArraySignificanceOrder() {
         // Start at the least significant bit
         int value = 1;
         for (int i = 0; i < INT_SIZE; i++) {
@@ -142,7 +142,7 @@ public class NumberFactoryTest {
     }
 
     @Test
-    public void testIntFromByteArray2Int() {
+    void testIntFromByteArray2Int() {
         for (int expected : INT_TEST_VALUES) {
             final byte[] b = NumberFactory.makeByteArray(expected);
             Assertions.assertEquals(expected, NumberFactory.makeInt(b));
@@ -150,13 +150,13 @@ public class NumberFactoryTest {
     }
 
     @Test
-    public void testIntArrayFromByteArray2IntArray() {
+    void testIntArrayFromByteArray2IntArray() {
         final byte[] b = NumberFactory.makeByteArray(INT_TEST_VALUES);
         Assertions.assertArrayEquals(INT_TEST_VALUES, NumberFactory.makeIntArray(b));
     }
 
     @Test
-    public void testIntArrayToByteArrayMatchesIntToByteArray() {
+    void testIntArrayToByteArrayMatchesIntToByteArray() {
         // Test individually the bytes are the same as the array conversion
         for (int i = 0; i < INT_TEST_VALUES.length; i++) {
             final byte[] b1 = NumberFactory.makeByteArray(INT_TEST_VALUES[i]);
@@ -166,7 +166,7 @@ public class NumberFactoryTest {
     }
 
     @Test
-    public void testMakeIntPrecondition1() {
+    void testMakeIntPrecondition1() {
         for (int i = 0; i <= 10; i++) {
             final byte[] bytes = new byte[i];
             if (i != INT_SIZE) {
@@ -179,7 +179,7 @@ public class NumberFactoryTest {
     }
 
     @Test
-    public void testMakeIntArrayPrecondition1() {
+    void testMakeIntArrayPrecondition1() {
         for (int i = 0; i <= 20; i++) {
             final byte[] bytes = new byte[i];
             if (i != 0 && i % INT_SIZE != 0) {
@@ -192,7 +192,7 @@ public class NumberFactoryTest {
     }
 
     @Test
-    public void testMakeLongPrecondition1() {
+    void testMakeLongPrecondition1() {
         for (int i = 0; i <= 10; i++) {
             final byte[] bytes = new byte[i];
             if (i != LONG_SIZE) {
@@ -205,7 +205,7 @@ public class NumberFactoryTest {
     }
 
     @Test
-    public void testMakeLongArrayPrecondition1() {
+    void testMakeLongArrayPrecondition1() {
         for (int i = 0; i <= 20; i++) {
             final byte[] bytes = new byte[i];
             if (i != 0 && i % LONG_SIZE != 0) {
@@ -222,7 +222,7 @@ public class NumberFactoryTest {
      * value should be in the range between 0 and 1.
      */
     @Test
-    public void testFloatGenerationMethods() {
+    void testFloatGenerationMethods() {
         final int allBits = 0xffffffff;
 
         // Not capable of generating 1. Set the delta with 1 or 2 ULP of 1.
@@ -241,7 +241,7 @@ public class NumberFactoryTest {
      * value should be in the range between 0 and 1.
      */
     @Test
-    public void testDoubleGenerationMethods() {
+    void testDoubleGenerationMethods() {
         final long allBits = 0xffffffffffffffffL;
 
         // Not capable of generating 1. Set the delta with 1 or 2 ULP of 1.
@@ -256,7 +256,7 @@ public class NumberFactoryTest {
     }
 
     @Test
-    public void testMakeDoubleFromLong() {
+    void testMakeDoubleFromLong() {
         final long allBits = 0xffffffffffffffffL;
         final long noBits = 0;
         // Within 1 ULP of 1.0
@@ -265,7 +265,7 @@ public class NumberFactoryTest {
     }
 
     @Test
-    public void testMakeDoubleFromIntInt() {
+    void testMakeDoubleFromIntInt() {
         final int allBits = 0xffffffff;
         final int noBits = 0;
         // Within 1 ULP of 1.0
@@ -274,7 +274,7 @@ public class NumberFactoryTest {
     }
 
     @Test
-    public void testMakeFloatFromInt() {
+    void testMakeFloatFromInt() {
         final int allBits = 0xffffffff;
         final int noBits = 0;
         // Within 1 ULP of 1.0f
diff --git a/commons-rng-examples/examples-stress/src/test/java/org/apache/commons/rng/examples/stress/HexTest.java b/commons-rng-examples/examples-stress/src/test/java/org/apache/commons/rng/examples/stress/HexTest.java
index cba3d5e..fd21217 100644
--- a/commons-rng-examples/examples-stress/src/test/java/org/apache/commons/rng/examples/stress/HexTest.java
+++ b/commons-rng-examples/examples-stress/src/test/java/org/apache/commons/rng/examples/stress/HexTest.java
@@ -26,7 +26,7 @@ import java.util.concurrent.ThreadLocalRandom;
 /**
  * Tests for {@link Hex}.
  */
-public class HexTest {
+class HexTest {
     /** Upper-case hex digits. */
     private static final char[] DIGITS = {
         '0', '1', '2', '3', '4', '5', '6', '7', '8', '9', 'A', 'B', 'C', 'D', 'E', 'F'
@@ -39,7 +39,7 @@ public class HexTest {
      * in the results file can be used to create the same seed.
      */
     @Test
-    public void testHexEncodeAndDecode() {
+    void testHexEncodeAndDecode() {
         // Empty bytes
         for (int size = 0; size < 10; size++) {
             assertHexEncodeAndDecode(new byte[size]);
@@ -74,7 +74,7 @@ public class HexTest {
      * can be converted to bytes and then recorded in the results file.
      */
     @Test
-    public void testHexDecodeAndEncode() {
+    void testHexDecodeAndEncode() {
         // Note: char[] must be an even length.
         // Empty chars.
         for (int size = 0; size < 10; size++) {
@@ -108,12 +108,12 @@ public class HexTest {
     }
 
     @Test
-    public void testHexThrowsWithOddNumberOfCharacters() {
+    void testHexThrowsWithOddNumberOfCharacters() {
         Assertions.assertThrows(IllegalArgumentException.class, () -> Hex.decodeHex("0"));
     }
 
     @Test
-    public void testHexThrowsWithIllegalHexCharacters() {
+    void testHexThrowsWithIllegalHexCharacters() {
         Assertions.assertThrows(IllegalArgumentException.class, () -> Hex.decodeHex("0g"));
     }
 }
diff --git a/commons-rng-examples/examples-stress/src/test/java/org/apache/commons/rng/examples/stress/RngDataOutputTest.java b/commons-rng-examples/examples-stress/src/test/java/org/apache/commons/rng/examples/stress/RngDataOutputTest.java
index 12f6312..b41a747 100644
--- a/commons-rng-examples/examples-stress/src/test/java/org/apache/commons/rng/examples/stress/RngDataOutputTest.java
+++ b/commons-rng-examples/examples-stress/src/test/java/org/apache/commons/rng/examples/stress/RngDataOutputTest.java
@@ -35,7 +35,7 @@ import java.util.function.UnaryOperator;
 /**
  * Tests for {@link RngDataOutput}.
  */
-public class RngDataOutputTest {
+class RngDataOutputTest {
     /**
      * A factory for creating RngDataOutput objects.
      */
@@ -52,7 +52,7 @@ public class RngDataOutputTest {
     }
 
     @Test
-    public void testIntBigEndian() throws IOException {
+    void testIntBigEndian() throws IOException {
         assertRngOutput(RandomSource.PCG_MCG_XSH_RS_32,
             UnaryOperator.identity(),
             RngDataOutputTest::writeInt,
@@ -60,7 +60,7 @@ public class RngDataOutputTest {
     }
 
     @Test
-    public void testIntLittleEndian() throws IOException {
+    void testIntLittleEndian() throws IOException {
         assertRngOutput(RandomSource.PCG_MCG_XSH_RS_32,
             RNGUtils::createReverseBytesProvider,
             RngDataOutputTest::writeInt,
@@ -68,7 +68,7 @@ public class RngDataOutputTest {
     }
 
     @Test
-    public void testLongBigEndian() throws IOException {
+    void testLongBigEndian() throws IOException {
         assertRngOutput(RandomSource.SPLIT_MIX_64,
             UnaryOperator.identity(),
             RngDataOutputTest::writeLong,
@@ -76,7 +76,7 @@ public class RngDataOutputTest {
     }
 
     @Test
-    public void testLongLittleEndian() throws IOException {
+    void testLongLittleEndian() throws IOException {
         assertRngOutput(RandomSource.SPLIT_MIX_64,
             RNGUtils::createReverseBytesProvider,
             RngDataOutputTest::writeLong,
@@ -84,7 +84,7 @@ public class RngDataOutputTest {
     }
 
     @Test
-    public void testLongAsIntBigEndian() throws IOException {
+    void testLongAsIntBigEndian() throws IOException {
         assertRngOutput(RandomSource.SPLIT_MIX_64,
             // Convert SplitMix64 to an int provider so it is detected as requiring double the
             // length output.
@@ -99,7 +99,7 @@ public class RngDataOutputTest {
     }
 
     @Test
-    public void testLongAsIntLittleEndian() throws IOException {
+    void testLongAsIntLittleEndian() throws IOException {
         assertRngOutput(RandomSource.SPLIT_MIX_64,
             // Convert SplitMix64 to an int provider so it is detected as requiring double the
             // length output. Then reverse the bytes.
diff --git a/commons-rng-sampling/src/test/java/org/apache/commons/rng/sampling/CollectionSamplerTest.java b/commons-rng-sampling/src/test/java/org/apache/commons/rng/sampling/CollectionSamplerTest.java
index ba9ad22..03c0e76 100644
--- a/commons-rng-sampling/src/test/java/org/apache/commons/rng/sampling/CollectionSamplerTest.java
+++ b/commons-rng-sampling/src/test/java/org/apache/commons/rng/sampling/CollectionSamplerTest.java
@@ -28,10 +28,10 @@ import org.apache.commons.rng.simple.RandomSource;
 /**
  * Tests for {@link CollectionSampler}.
  */
-public class CollectionSamplerTest {
+class CollectionSamplerTest {
 
     @Test
-    public void testSampleTrivial() {
+    void testSampleTrivial() {
         final ArrayList<String> list = new ArrayList<String>();
         list.add("Apache");
         list.add("Commons");
@@ -50,7 +50,7 @@ public class CollectionSamplerTest {
     }
 
     @Test
-    public void testSamplePrecondition() {
+    void testSamplePrecondition() {
         // Must fail for empty collection.
         Assertions.assertThrows(IllegalArgumentException.class,
             () -> new CollectionSampler<String>(RandomSource.SPLIT_MIX_64.create(0L),
@@ -61,7 +61,7 @@ public class CollectionSamplerTest {
      * Test the SharedStateSampler implementation.
      */
     @Test
-    public void testSharedStateSampler() {
+    void testSharedStateSampler() {
         final UniformRandomProvider rng1 = RandomSource.SPLIT_MIX_64.create(0L);
         final UniformRandomProvider rng2 = RandomSource.SPLIT_MIX_64.create(0L);
         final List<String> list = Arrays.asList("Apache", "Commons", "RNG");
diff --git a/commons-rng-sampling/src/test/java/org/apache/commons/rng/sampling/CombinationSamplerTest.java b/commons-rng-sampling/src/test/java/org/apache/commons/rng/sampling/CombinationSamplerTest.java
index baa48f6..97f7cfa 100644
--- a/commons-rng-sampling/src/test/java/org/apache/commons/rng/sampling/CombinationSamplerTest.java
+++ b/commons-rng-sampling/src/test/java/org/apache/commons/rng/sampling/CombinationSamplerTest.java
@@ -29,11 +29,11 @@ import org.apache.commons.rng.simple.RandomSource;
 /**
  * Tests for {@link CombinationSampler}.
  */
-public class CombinationSamplerTest {
+class CombinationSamplerTest {
     private final UniformRandomProvider rng = RandomSource.XO_RO_SHI_RO_128_PP.create();
 
     @Test
-    public void testSampleIsInDomain() {
+    void testSampleIsInDomain() {
         final int n = 6;
         for (int k = 1; k <= n; k++) {
             final CombinationSampler sampler = new CombinationSampler(rng, n, k);
@@ -45,21 +45,21 @@ public class CombinationSamplerTest {
     }
 
     @Test
-    public void testUniformWithKlessThanHalfN() {
+    void testUniformWithKlessThanHalfN() {
         final int n = 8;
         final int k = 2;
         assertUniformSamples(n, k);
     }
 
     @Test
-    public void testUniformWithKmoreThanHalfN() {
+    void testUniformWithKmoreThanHalfN() {
         final int n = 8;
         final int k = 6;
         assertUniformSamples(n, k);
     }
 
     @Test
-    public void testSampleWhenNequalsKIsNotShuffled() {
+    void testSampleWhenNequalsKIsNotShuffled() {
         // Check n == k boundary case.
         // This is allowed but the sample is not shuffled.
         for (int n = 1; n < 3; n++) {
@@ -74,7 +74,7 @@ public class CombinationSamplerTest {
     }
 
     @Test
-    public void testKgreaterThanNThrows() {
+    void testKgreaterThanNThrows() {
         // Must fail for k > n.
         final int n = 2;
         final int k = 3;
@@ -83,7 +83,7 @@ public class CombinationSamplerTest {
     }
 
     @Test
-    public void testNequalsZeroThrows() {
+    void testNequalsZeroThrows() {
         // Must fail for n = 0.
         final int n = 0;
         final int k = 3;
@@ -92,7 +92,7 @@ public class CombinationSamplerTest {
     }
 
     @Test
-    public void testKequalsZeroThrows() {
+    void testKequalsZeroThrows() {
         // Must fail for k = 0.
         final int n = 2;
         final int k = 0;
@@ -101,7 +101,7 @@ public class CombinationSamplerTest {
     }
 
     @Test
-    public void testNisNegativeThrows() {
+    void testNisNegativeThrows() {
         // Must fail for n <= 0.
         final int n = -1;
         final int k = 3;
@@ -110,7 +110,7 @@ public class CombinationSamplerTest {
     }
 
     @Test
-    public void testKisNegativeThrows() {
+    void testKisNegativeThrows() {
         // Must fail for k <= 0.
         final int n = 0;
         final int k = -1;
@@ -122,7 +122,7 @@ public class CombinationSamplerTest {
      * Test the SharedStateSampler implementation.
      */
     @Test
-    public void testSharedStateSampler() {
+    void testSharedStateSampler() {
         final UniformRandomProvider rng1 = RandomSource.SPLIT_MIX_64.create(0L);
         final UniformRandomProvider rng2 = RandomSource.SPLIT_MIX_64.create(0L);
         final int n = 17;
diff --git a/commons-rng-sampling/src/test/java/org/apache/commons/rng/sampling/CompositeSamplersTest.java b/commons-rng-sampling/src/test/java/org/apache/commons/rng/sampling/CompositeSamplersTest.java
index dde1d1f..87a62a7 100644
--- a/commons-rng-sampling/src/test/java/org/apache/commons/rng/sampling/CompositeSamplersTest.java
+++ b/commons-rng-sampling/src/test/java/org/apache/commons/rng/sampling/CompositeSamplersTest.java
@@ -40,12 +40,12 @@ import org.apache.commons.rng.simple.RandomSource;
 /**
  * Test class for {@link CompositeSamplers}.
  */
-public class CompositeSamplersTest {
+class CompositeSamplersTest {
     /**
      * Test the default implementations of the discrete probability sampler factory.
      */
     @Test
-    public void testDiscreteProbabilitySampler() {
+    void testDiscreteProbabilitySampler() {
         final UniformRandomProvider rng = RandomSource.MWC_256.create(78979L);
         final double[] probabilities = {0.1, 0.2, 0.3, 0.4};
         final double mean = 0.2 + 2 * 0.3 + 3 * 0.4;
@@ -64,7 +64,7 @@ public class CompositeSamplersTest {
      * Test an empty builder cannot build a sampler.
      */
     @Test
-    public void testEmptyBuilderThrows() {
+    void testEmptyBuilderThrows() {
         final UniformRandomProvider rng = RandomSource.SPLIT_MIX_64.create(0L);
         final Builder<SharedStateObjectSampler<Integer>> builder = CompositeSamplers
                 .newSharedStateObjectSamplerBuilder();
@@ -77,7 +77,7 @@ public class CompositeSamplersTest {
      * Test adding null sampler to a builder.
      */
     @Test
-    public void testNullSharedStateObjectSamplerThrows() {
+    void testNullSharedStateObjectSamplerThrows() {
         final Builder<SharedStateObjectSampler<Integer>> builder = CompositeSamplers
                 .newSharedStateObjectSamplerBuilder();
         Assertions.assertThrows(NullPointerException.class,
@@ -88,7 +88,7 @@ public class CompositeSamplersTest {
      * Test invalid weights (zero, negative, NaN, infinte).
      */
     @Test
-    public void testInvalidWeights() {
+    void testInvalidWeights() {
         final UniformRandomProvider rng = RandomSource.SPLIT_MIX_64.create(0L);
         final Builder<SharedStateObjectSampler<Integer>> builder = CompositeSamplers
                 .newSharedStateObjectSamplerBuilder();
@@ -110,7 +110,7 @@ public class CompositeSamplersTest {
      * Test a single sampler added to the builder is returned without a composite.
      */
     @Test
-    public void testSingleSharedStateObjectSampler() {
+    void testSingleSharedStateObjectSampler() {
         final UniformRandomProvider rng = RandomSource.SPLIT_MIX_64.create(0L);
         final Builder<SharedStateObjectSampler<Integer>> builder = CompositeSamplers
                 .newSharedStateObjectSamplerBuilder();
@@ -125,7 +125,7 @@ public class CompositeSamplersTest {
      * Test sampling is uniform across several ObjectSampler samplers.
      */
     @Test
-    public void testObjectSamplerSamples() {
+    void testObjectSamplerSamples() {
         final Builder<ObjectSampler<Integer>> builder = CompositeSamplers.newObjectSamplerBuilder();
         final UniformRandomProvider rng = RandomSource.PCG_XSH_RR_32_OS.create(345);
         final int n = 15;
@@ -139,7 +139,7 @@ public class CompositeSamplersTest {
      * Test sampling is uniform across several SharedStateObjectSampler samplers.
      */
     @Test
-    public void testSharedStateObjectSamplerSamples() {
+    void testSharedStateObjectSamplerSamples() {
         final Builder<SharedStateObjectSampler<Integer>> builder = CompositeSamplers
                 .newSharedStateObjectSamplerBuilder();
         final UniformRandomProvider rng = RandomSource.PCG_XSH_RS_32_OS.create(299);
@@ -157,7 +157,7 @@ public class CompositeSamplersTest {
      * using a custom factory that implements SharedStateDiscreteSampler.
      */
     @Test
-    public void testSharedStateObjectSamplerSamplesWithCustomSharedStateDiscreteSamplerFactory() {
+    void testSharedStateObjectSamplerSamplesWithCustomSharedStateDiscreteSamplerFactory() {
         final Builder<SharedStateObjectSampler<Integer>> builder = CompositeSamplers
                 .newSharedStateObjectSamplerBuilder();
         final AtomicInteger factoryCount = new AtomicInteger();
@@ -187,7 +187,7 @@ public class CompositeSamplersTest {
      * using a custom factory that implements DiscreteSampler (so must be wrapped).
      */
     @Test
-    public void testSharedStateObjectSamplerSamplesWithCustomDiscreteSamplerFactory() {
+    void testSharedStateObjectSamplerSamplesWithCustomDiscreteSamplerFactory() {
         final Builder<SharedStateObjectSampler<Integer>> builder = CompositeSamplers
                 .newSharedStateObjectSamplerBuilder();
         final AtomicInteger factoryCount = new AtomicInteger();
@@ -228,7 +228,7 @@ public class CompositeSamplersTest {
      * uniform.
      */
     @Test
-    public void testObjectSamplerSamplesWithUniformWeights() {
+    void testObjectSamplerSamplesWithUniformWeights() {
         final Builder<ObjectSampler<Integer>> builder = CompositeSamplers.newObjectSamplerBuilder();
         final UniformRandomProvider rng = RandomSource.JSF_64.create(678345);
         final int max = 60;
@@ -245,7 +245,7 @@ public class CompositeSamplersTest {
      * infinity.
      */
     @Test
-    public void testObjectSamplerSamplesWithVeryLargeWeights() {
+    void testObjectSamplerSamplesWithVeryLargeWeights() {
         final Builder<ObjectSampler<Integer>> builder = CompositeSamplers.newObjectSamplerBuilder();
         final UniformRandomProvider rng = RandomSource.SFC_64.create(267934293);
         // Ratio 4:4:2:1
@@ -268,7 +268,7 @@ public class CompositeSamplersTest {
      * by the reciprocal of the sum.
      */
     @Test
-    public void testObjectSamplerSamplesWithSubNormalWeights() {
+    void testObjectSamplerSamplesWithSubNormalWeights() {
         final Builder<ObjectSampler<Integer>> builder = CompositeSamplers.newObjectSamplerBuilder();
         final UniformRandomProvider rng = RandomSource.MSWS.create(6786);
         // Ratio 4:4:2:1
@@ -360,7 +360,7 @@ public class CompositeSamplersTest {
      * Test sampling is uniform across several DiscreteSampler samplers.
      */
     @Test
-    public void testDiscreteSamplerSamples() {
+    void testDiscreteSamplerSamples() {
         final Builder<DiscreteSampler> builder = CompositeSamplers.newDiscreteSamplerBuilder();
         final UniformRandomProvider rng = RandomSource.PCG_XSH_RR_32_OS.create(345);
         final int n = 15;
@@ -374,7 +374,7 @@ public class CompositeSamplersTest {
      * Test sampling is uniform across several SharedStateDiscreteSampler samplers.
      */
     @Test
-    public void testSharedStateDiscreteSamplerSamples() {
+    void testSharedStateDiscreteSamplerSamples() {
         final Builder<SharedStateDiscreteSampler> builder = CompositeSamplers.newSharedStateDiscreteSamplerBuilder();
         final UniformRandomProvider rng = RandomSource.PCG_XSH_RS_32_OS.create(299);
         final int n = 11;
@@ -454,7 +454,7 @@ public class CompositeSamplersTest {
      * Test sampling is uniform across several ContinuousSampler samplers.
      */
     @Test
-    public void testContinuousSamplerSamples() {
+    void testContinuousSamplerSamples() {
         final Builder<ContinuousSampler> builder = CompositeSamplers.newContinuousSamplerBuilder();
         final UniformRandomProvider rng = RandomSource.XO_SHI_RO_256_PP.create(9283756);
         final int n = 15;
@@ -468,7 +468,7 @@ public class CompositeSamplersTest {
      * Test sampling is uniform across several SharedStateContinuousSampler samplers.
      */
     @Test
-    public void testSharedStateContinuousSamplerSamples() {
+    void testSharedStateContinuousSamplerSamples() {
         final Builder<SharedStateContinuousSampler> builder = CompositeSamplers
                 .newSharedStateContinuousSamplerBuilder();
         final UniformRandomProvider rng = RandomSource.PCG_RXS_M_XS_64_OS.create(0x567567345L);
@@ -551,7 +551,7 @@ public class CompositeSamplersTest {
      * Test sampling is uniform across several LongSampler samplers.
      */
     @Test
-    public void testLongSamplerSamples() {
+    void testLongSamplerSamples() {
         final Builder<LongSampler> builder = CompositeSamplers.newLongSamplerBuilder();
         final UniformRandomProvider rng = RandomSource.KISS.create(67842321783L);
         final int n = 15;
@@ -565,7 +565,7 @@ public class CompositeSamplersTest {
      * Test sampling is uniform across several SharedStateLongSampler samplers.
      */
     @Test
-    public void testSharedStateLongSamplerSamples() {
+    void testSharedStateLongSamplerSamples() {
         final Builder<SharedStateLongSampler> builder = CompositeSamplers.newSharedStateLongSamplerBuilder();
         final UniformRandomProvider rng = RandomSource.KISS.create(12369279382030L);
         final int n = 11;
@@ -648,7 +648,7 @@ public class CompositeSamplersTest {
      * SharedStateObjectSampler.
      */
     @Test
-    public void testSharedStateObjectSampler() {
+    void testSharedStateObjectSampler() {
         testSharedStateObjectSampler(false);
     }
 
@@ -657,7 +657,7 @@ public class CompositeSamplersTest {
      * SharedStateObjectSampler with a factory that does not support a shared state sampler.
      */
     @Test
-    public void testSharedStateObjectSamplerWithCustomFactory() {
+    void testSharedStateObjectSamplerWithCustomFactory() {
         testSharedStateObjectSampler(true);
     }
 
@@ -697,7 +697,7 @@ public class CompositeSamplersTest {
      * SharedStateDiscreteSampler.
      */
     @Test
-    public void testSharedStateDiscreteSampler() {
+    void testSharedStateDiscreteSampler() {
         testSharedStateDiscreteSampler(false);
     }
 
@@ -706,7 +706,7 @@ public class CompositeSamplersTest {
      * SharedStateDiscreteSampler with a factory that does not support a shared state sampler.
      */
     @Test
-    public void testSharedStateDiscreteSamplerWithCustomFactory() {
+    void testSharedStateDiscreteSamplerWithCustomFactory() {
         testSharedStateDiscreteSampler(true);
     }
 
@@ -745,7 +745,7 @@ public class CompositeSamplersTest {
      * SharedStateContinuousSampler.
      */
     @Test
-    public void testSharedStateContinuousSampler() {
+    void testSharedStateContinuousSampler() {
         testSharedStateContinuousSampler(false);
     }
 
@@ -754,7 +754,7 @@ public class CompositeSamplersTest {
      * SharedStateContinuousSampler with a factory that does not support a shared state sampler.
      */
     @Test
-    public void testSharedStateContinuousSamplerWithCustomFactory() {
+    void testSharedStateContinuousSamplerWithCustomFactory() {
         testSharedStateContinuousSampler(true);
     }
 
@@ -817,7 +817,7 @@ public class CompositeSamplersTest {
      * SharedStateLongSampler.
      */
     @Test
-    public void testSharedStateLongSampler() {
+    void testSharedStateLongSampler() {
         testSharedStateLongSampler(false);
     }
 
@@ -826,7 +826,7 @@ public class CompositeSamplersTest {
      * SharedStateLongSampler with a factory that does not support a shared state sampler.
      */
     @Test
-    public void testSharedStateLongSamplerWithCustomFactory() {
+    void testSharedStateLongSamplerWithCustomFactory() {
         testSharedStateLongSampler(true);
     }
 
diff --git a/commons-rng-sampling/src/test/java/org/apache/commons/rng/sampling/DiscreteProbabilityCollectionSamplerTest.java b/commons-rng-sampling/src/test/java/org/apache/commons/rng/sampling/DiscreteProbabilityCollectionSamplerTest.java
index ea9d1b2..a45aeb2 100644
--- a/commons-rng-sampling/src/test/java/org/apache/commons/rng/sampling/DiscreteProbabilityCollectionSamplerTest.java
+++ b/commons-rng-sampling/src/test/java/org/apache/commons/rng/sampling/DiscreteProbabilityCollectionSamplerTest.java
@@ -32,12 +32,12 @@ import org.apache.commons.rng.simple.RandomSource;
 /**
  * Test class for {@link DiscreteProbabilityCollectionSampler}.
  */
-public class DiscreteProbabilityCollectionSamplerTest {
+class DiscreteProbabilityCollectionSamplerTest {
     /** RNG. */
     private final UniformRandomProvider rng = RandomSource.XO_SHI_RO_128_PP.create();
 
     @Test
-    public void testPrecondition1() {
+    void testPrecondition1() {
         // Size mismatch
         Assertions.assertThrows(IllegalArgumentException.class,
             () -> new DiscreteProbabilityCollectionSampler<>(rng,
@@ -46,7 +46,7 @@ public class DiscreteProbabilityCollectionSamplerTest {
     }
 
     @Test
-    public void testPrecondition2() {
+    void testPrecondition2() {
         // Negative probability
         Assertions.assertThrows(IllegalArgumentException.class,
             () -> new DiscreteProbabilityCollectionSampler<>(rng,
@@ -55,7 +55,7 @@ public class DiscreteProbabilityCollectionSamplerTest {
     }
 
     @Test
-    public void testPrecondition3() {
+    void testPrecondition3() {
         // Probabilities do not sum above 0
         Assertions.assertThrows(IllegalArgumentException.class,
             () -> new DiscreteProbabilityCollectionSampler<>(rng,
@@ -64,7 +64,7 @@ public class DiscreteProbabilityCollectionSamplerTest {
     }
 
     @Test
-    public void testPrecondition4() {
+    void testPrecondition4() {
         // NaN probability
         Assertions.assertThrows(IllegalArgumentException.class,
             () -> new DiscreteProbabilityCollectionSampler<>(rng,
@@ -73,7 +73,7 @@ public class DiscreteProbabilityCollectionSamplerTest {
     }
 
     @Test
-    public void testPrecondition5() {
+    void testPrecondition5() {
         // Infinite probability
         Assertions.assertThrows(IllegalArgumentException.class,
             () -> new DiscreteProbabilityCollectionSampler<>(rng,
@@ -82,7 +82,7 @@ public class DiscreteProbabilityCollectionSamplerTest {
     }
 
     @Test
-    public void testPrecondition6() {
+    void testPrecondition6() {
         // Empty Map<T, Double> not allowed
         Assertions.assertThrows(IllegalArgumentException.class,
             () -> new DiscreteProbabilityCollectionSampler<>(rng,
@@ -90,7 +90,7 @@ public class DiscreteProbabilityCollectionSamplerTest {
     }
 
     @Test
-    public void testPrecondition7() {
+    void testPrecondition7() {
         // Empty List<T> not allowed
         Assertions.assertThrows(IllegalArgumentException.class,
             () -> new DiscreteProbabilityCollectionSampler<>(rng,
@@ -99,7 +99,7 @@ public class DiscreteProbabilityCollectionSamplerTest {
     }
 
     @Test
-    public void testSample() {
+    void testSample() {
         final DiscreteProbabilityCollectionSampler<Double> sampler =
             new DiscreteProbabilityCollectionSampler<>(rng,
                                                        Arrays.asList(3d, -1d, 3d, 7d, -2d, 8d),
@@ -124,7 +124,7 @@ public class DiscreteProbabilityCollectionSamplerTest {
 
 
     @Test
-    public void testSampleUsingMap() {
+    void testSampleUsingMap() {
         final UniformRandomProvider rng1 = RandomSource.SPLIT_MIX_64.create(0L);
         final UniformRandomProvider rng2 = RandomSource.SPLIT_MIX_64.create(0L);
         final List<Integer> items = Arrays.asList(1, 3, 4, 6, 9);
@@ -151,7 +151,7 @@ public class DiscreteProbabilityCollectionSamplerTest {
      * identify the end item of the cumulative probability array.
      */
     @Test
-    public void testSampleWithProbabilityAtLastItem() {
+    void testSampleWithProbabilityAtLastItem() {
         // Ensure the samples pick probability 0 (the first item) and then
         // a probability (for the second item) that hits an edge case.
         final UniformRandomProvider dummyRng = new UniformRandomProvider() {
@@ -188,7 +188,7 @@ public class DiscreteProbabilityCollectionSamplerTest {
      * Test the SharedStateSampler implementation.
      */
     @Test
-    public void testSharedStateSampler() {
+    void testSharedStateSampler() {
         final UniformRandomProvider rng1 = RandomSource.SPLIT_MIX_64.create(0L);
         final UniformRandomProvider rng2 = RandomSource.SPLIT_MIX_64.create(0L);
         final List<Double> items = Arrays.asList(1d, 2d, 3d, 4d);
diff --git a/commons-rng-sampling/src/test/java/org/apache/commons/rng/sampling/ListSamplerTest.java b/commons-rng-sampling/src/test/java/org/apache/commons/rng/sampling/ListSamplerTest.java
index 76f2e10..391ec83 100644
--- a/commons-rng-sampling/src/test/java/org/apache/commons/rng/sampling/ListSamplerTest.java
+++ b/commons-rng-sampling/src/test/java/org/apache/commons/rng/sampling/ListSamplerTest.java
@@ -36,12 +36,12 @@ import org.apache.commons.rng.simple.RandomSource;
 /**
  * Tests for {@link ListSampler}.
  */
-public class ListSamplerTest {
+class ListSamplerTest {
     private final UniformRandomProvider rng = RandomSource.ISAAC.create(6543432321L);
     private final ChiSquareTest chiSquareTest = new ChiSquareTest();
 
     @Test
-    public void testSample() {
+    void testSample() {
         final String[][] c = {{"0", "1"}, {"0", "2"}, {"0", "3"}, {"0", "4"},
                               {"1", "2"}, {"1", "3"}, {"1", "4"},
                               {"2", "3"}, {"2", "4"},
@@ -71,7 +71,7 @@ public class ListSamplerTest {
     }
 
     @Test
-    public void testSampleWhole() {
+    void testSampleWhole() {
         // Sample of size = size of collection must return the same collection.
         final List<String> list = new ArrayList<>();
         list.add("one");
@@ -82,7 +82,7 @@ public class ListSamplerTest {
     }
 
     @Test
-    public void testSamplePrecondition1() {
+    void testSamplePrecondition1() {
         // Must fail for sample size > collection size.
         final List<String> list = new ArrayList<>();
         list.add("one");
@@ -91,7 +91,7 @@ public class ListSamplerTest {
     }
 
     @Test
-    public void testSamplePrecondition2() {
+    void testSamplePrecondition2() {
         // Must fail for empty collection.
         final List<String> list = new ArrayList<>();
         Assertions.assertThrows(IllegalArgumentException.class,
@@ -99,7 +99,7 @@ public class ListSamplerTest {
     }
 
     @Test
-    public void testShuffle() {
+    void testShuffle() {
         final List<Integer> orig = new ArrayList<>();
         for (int i = 0; i < 10; i++) {
             orig.add((i + 1) * rng.nextInt());
@@ -119,7 +119,7 @@ public class ListSamplerTest {
     }
 
     @Test
-    public void testShuffleTail() {
+    void testShuffleTail() {
         final List<Integer> orig = new ArrayList<>();
         for (int i = 0; i < 10; i++) {
             orig.add((i + 1) * rng.nextInt());
@@ -137,7 +137,7 @@ public class ListSamplerTest {
     }
 
     @Test
-    public void testShuffleHead() {
+    void testShuffleHead() {
         final List<Integer> orig = new ArrayList<>();
         for (int i = 0; i < 10; i++) {
             orig.add((i + 1) * rng.nextInt());
@@ -160,7 +160,7 @@ public class ListSamplerTest {
      * output order should match.
      */
     @Test
-    public void testShuffleMatchesPermutationSamplerShuffle() {
+    void testShuffleMatchesPermutationSamplerShuffle() {
         final List<Integer> orig = new ArrayList<>();
         for (int i = 0; i < 10; i++) {
             orig.add((i + 1) * rng.nextInt());
@@ -176,7 +176,7 @@ public class ListSamplerTest {
      * output order should match.
      */
     @Test
-    public void testShuffleMatchesPermutationSamplerShuffleDirectional() {
+    void testShuffleMatchesPermutationSamplerShuffleDirectional() {
         final List<Integer> orig = new ArrayList<>();
         for (int i = 0; i < 10; i++) {
             orig.add((i + 1) * rng.nextInt());
@@ -193,7 +193,7 @@ public class ListSamplerTest {
      * using a RandomAccess list is faster than the one with an iterator.
      */
     @Test
-    public void testShuffleWithSmallLinkedList() {
+    void testShuffleWithSmallLinkedList() {
         final int size = 3;
         final List<Integer> orig = new ArrayList<>();
         for (int i = 0; i < size; i++) {
diff --git a/commons-rng-sampling/src/test/java/org/apache/commons/rng/sampling/PermutationSamplerTest.java b/commons-rng-sampling/src/test/java/org/apache/commons/rng/sampling/PermutationSamplerTest.java
index af4937c..94d85f0 100644
--- a/commons-rng-sampling/src/test/java/org/apache/commons/rng/sampling/PermutationSamplerTest.java
+++ b/commons-rng-sampling/src/test/java/org/apache/commons/rng/sampling/PermutationSamplerTest.java
@@ -29,12 +29,12 @@ import org.apache.commons.rng.simple.RandomSource;
 /**
  * Tests for {@link PermutationSampler}.
  */
-public class PermutationSamplerTest {
+class PermutationSamplerTest {
     private final UniformRandomProvider rng = RandomSource.ISAAC.create(1232343456L);
     private final ChiSquareTest chiSquareTest = new ChiSquareTest();
 
     @Test
-    public void testSampleTrivial() {
+    void testSampleTrivial() {
         final int n = 6;
         final int k = 3;
         final PermutationSampler sampler = new PermutationSampler(RandomSource.KISS.create(),
@@ -51,7 +51,7 @@ public class PermutationSamplerTest {
     }
 
     @Test
-    public void testSampleChiSquareTest() {
+    void testSampleChiSquareTest() {
         final int n = 3;
         final int k = 3;
         final int[][] p = {{0, 1, 2}, {0, 2, 1},
@@ -61,7 +61,7 @@ public class PermutationSamplerTest {
     }
 
     @Test
-    public void testSubSampleChiSquareTest() {
+    void testSubSampleChiSquareTest() {
         final int n = 4;
         final int k = 2;
         final int[][] p = {{0, 1}, {1, 0},
@@ -74,7 +74,7 @@ public class PermutationSamplerTest {
     }
 
     @Test
-    public void testSampleBoundaryCase() {
+    void testSampleBoundaryCase() {
         // Check size = 1 boundary case.
         final PermutationSampler sampler = new PermutationSampler(rng, 1, 1);
         final int[] perm = sampler.sample();
@@ -83,35 +83,35 @@ public class PermutationSamplerTest {
     }
 
     @Test
-    public void testSamplePrecondition1() {
+    void testSamplePrecondition1() {
         // Must fail for k > n.
         Assertions.assertThrows(IllegalArgumentException.class,
             () -> new PermutationSampler(rng, 2, 3));
     }
 
     @Test
-    public void testSamplePrecondition2() {
+    void testSamplePrecondition2() {
         // Must fail for n = 0.
         Assertions.assertThrows(IllegalArgumentException.class,
             () -> new PermutationSampler(rng, 0, 0));
     }
 
     @Test
-    public void testSamplePrecondition3() {
+    void testSamplePrecondition3() {
         // Must fail for k < n < 0.
         Assertions.assertThrows(IllegalArgumentException.class,
             () -> new PermutationSampler(rng, -1, 0));
     }
 
     @Test
-    public void testSamplePrecondition4() {
+    void testSamplePrecondition4() {
         // Must fail for k < n < 0.
         Assertions.assertThrows(IllegalArgumentException.class,
             () -> new PermutationSampler(rng, 1, -1));
     }
 
     @Test
-    public void testNatural() {
+    void testNatural() {
         final int n = 4;
         final int[] expected = {0, 1, 2, 3};
 
@@ -122,13 +122,13 @@ public class PermutationSamplerTest {
     }
 
     @Test
-    public void testNaturalZero() {
+    void testNaturalZero() {
         final int[] natural = PermutationSampler.natural(0);
         Assertions.assertEquals(0, natural.length);
     }
 
     @Test
-    public void testShuffleNoDuplicates() {
+    void testShuffleNoDuplicates() {
         final int n = 100;
         final int[] orig = PermutationSampler.natural(n);
         PermutationSampler.shuffle(rng, orig);
@@ -145,7 +145,7 @@ public class PermutationSamplerTest {
     }
 
     @Test
-    public void testShuffleTail() {
+    void testShuffleTail() {
         final int[] orig = new int[] {0, 1, 2, 3, 4, 5, 6, 7, 8, 9};
         final int[] list = orig.clone();
         final int start = 4;
@@ -168,7 +168,7 @@ public class PermutationSamplerTest {
     }
 
     @Test
-    public void testShuffleHead() {
+    void testShuffleHead() {
         final int[] orig = new int[] {0, 1, 2, 3, 4, 5, 6, 7, 8, 9};
         final int[] list = orig.clone();
         final int start = 4;
@@ -194,7 +194,7 @@ public class PermutationSamplerTest {
      * Test the SharedStateSampler implementation.
      */
     @Test
-    public void testSharedStateSampler() {
+    void testSharedStateSampler() {
         final UniformRandomProvider rng1 = RandomSource.SPLIT_MIX_64.create(0L);
         final UniformRandomProvider rng2 = RandomSource.SPLIT_MIX_64.create(0L);
         final int n = 17;
diff --git a/commons-rng-sampling/src/test/java/org/apache/commons/rng/sampling/UnitSphereSamplerTest.java b/commons-rng-sampling/src/test/java/org/apache/commons/rng/sampling/UnitSphereSamplerTest.java
index ef1af4b..1906e8f 100644
--- a/commons-rng-sampling/src/test/java/org/apache/commons/rng/sampling/UnitSphereSamplerTest.java
+++ b/commons-rng-sampling/src/test/java/org/apache/commons/rng/sampling/UnitSphereSamplerTest.java
@@ -27,7 +27,7 @@ import org.apache.commons.rng.core.source64.SplitMix64;
 /**
  * Test for {@link UnitSphereSampler}.
  */
-public class UnitSphereSamplerTest {
+class UnitSphereSamplerTest {
     /** 2 pi */
     private static final double TWO_PI = 2 * Math.PI;
 
@@ -35,7 +35,7 @@ public class UnitSphereSamplerTest {
      * Test a non-positive dimension.
      */
     @Test
-    public void testInvalidDimensionThrows() {
+    void testInvalidDimensionThrows() {
         // Use instance constructor not factory constructor to exercise 1.X public API
         Assertions.assertThrows(IllegalArgumentException.class,
             () -> new UnitSphereSampler(0, null));
@@ -45,7 +45,7 @@ public class UnitSphereSamplerTest {
      * Test a non-positive dimension.
      */
     @Test
-    public void testInvalidDimensionThrowsWithFactoryConstructor() {
+    void testInvalidDimensionThrowsWithFactoryConstructor() {
         Assertions.assertThrows(IllegalArgumentException.class,
             () -> UnitSphereSampler.of(null, 0));
     }
@@ -54,7 +54,7 @@ public class UnitSphereSamplerTest {
      * Test the distribution of points in one dimension.
      */
     @Test
-    public void testDistribution1D() {
+    void testDistribution1D() {
         testDistribution1D(false);
     }
 
@@ -62,7 +62,7 @@ public class UnitSphereSamplerTest {
      * Test the distribution of points in one dimension with the factory constructor.
      */
     @Test
-    public void testDistribution1DWithFactoryConstructor() {
+    void testDistribution1DWithFactoryConstructor() {
         testDistribution1D(true);
     }
 
@@ -125,7 +125,7 @@ public class UnitSphereSamplerTest {
      * Test the distribution of points in two dimensions.
      */
     @Test
-    public void testDistribution2D() {
+    void testDistribution2D() {
         testDistribution2D(false);
     }
 
@@ -133,7 +133,7 @@ public class UnitSphereSamplerTest {
      * Test the distribution of points in two dimensions with the factory constructor.
      */
     @Test
-    public void testDistribution2DWithFactoryConstructor() {
+    void testDistribution2DWithFactoryConstructor() {
         testDistribution2D(true);
     }
 
@@ -168,7 +168,7 @@ public class UnitSphereSamplerTest {
      * Test the distribution of points in three dimensions.
      */
     @Test
-    public void testDistribution3D() {
+    void testDistribution3D() {
         testDistribution3D(false);
     }
 
@@ -176,7 +176,7 @@ public class UnitSphereSamplerTest {
      * Test the distribution of points in three dimensions with the factory constructor.
      */
     @Test
-    public void testDistribution3DWithFactoryConstructor() {
+    void testDistribution3DWithFactoryConstructor() {
         testDistribution3D(true);
     }
 
@@ -220,7 +220,7 @@ public class UnitSphereSamplerTest {
      * Test the distribution of points in four dimensions.
      */
     @Test
-    public void testDistribution4D() {
+    void testDistribution4D() {
         testDistribution4D(false);
     }
 
@@ -228,7 +228,7 @@ public class UnitSphereSamplerTest {
      * Test the distribution of points in four dimensions with the factory constructor.
      */
     @Test
-    public void testDistribution4DWithFactoryConstructor() {
+    void testDistribution4DWithFactoryConstructor() {
         testDistribution4D(true);
     }
 
@@ -348,7 +348,7 @@ public class UnitSphereSamplerTest {
      * Test infinite recursion occurs with a bad provider in 2D.
      */
     @Test
-    public void testBadProvider2D() {
+    void testBadProvider2D() {
         Assertions.assertThrows(StackOverflowError.class,
             () -> testBadProvider(2));
     }
@@ -357,7 +357,7 @@ public class UnitSphereSamplerTest {
      * Test infinite recursion occurs with a bad provider in 3D.
      */
     @Test
-    public void testBadProvider3D() {
+    void testBadProvider3D() {
         Assertions.assertThrows(StackOverflowError.class,
             () -> testBadProvider(3));
     }
@@ -366,7 +366,7 @@ public class UnitSphereSamplerTest {
      * Test infinite recursion occurs with a bad provider in 4D.
      */
     @Test
-    public void testBadProvider4D() {
+    void testBadProvider4D() {
         Assertions.assertThrows(StackOverflowError.class,
             () -> testBadProvider(4));
     }
@@ -396,7 +396,7 @@ public class UnitSphereSamplerTest {
      * Test the edge case where the normalisation sum to divide by is zero for 2D.
      */
     @Test
-    public void testInvalidInverseNormalisation2D() {
+    void testInvalidInverseNormalisation2D() {
         testInvalidInverseNormalisationND(2);
     }
 
@@ -404,7 +404,7 @@ public class UnitSphereSamplerTest {
      * Test the edge case where the normalisation sum to divide by is zero for 3D.
      */
     @Test
-    public void testInvalidInverseNormalisation3D() {
+    void testInvalidInverseNormalisation3D() {
         testInvalidInverseNormalisationND(3);
     }
 
@@ -412,7 +412,7 @@ public class UnitSphereSamplerTest {
      * Test the edge case where the normalisation sum to divide by is zero for 4D.
      */
     @Test
-    public void testInvalidInverseNormalisation4D() {
+    void testInvalidInverseNormalisation4D() {
         testInvalidInverseNormalisationND(4);
     }
 
@@ -444,7 +444,7 @@ public class UnitSphereSamplerTest {
      * zero is valid. Any norm squared after zero should produce a valid scaling factor.
      */
     @Test
-    public void testNextNormSquaredAfterZeroIsValid() {
+    void testNextNormSquaredAfterZeroIsValid() {
         // The sampler explicitly handles length == 0 using recursion.
         // Anything above zero should be valid.
         final double normSq = Math.nextUp(0.0);
@@ -458,7 +458,7 @@ public class UnitSphereSamplerTest {
      * Test the SharedStateSampler implementation for 1D.
      */
     @Test
-    public void testSharedStateSampler1D() {
+    void testSharedStateSampler1D() {
         testSharedStateSampler(1, false);
     }
 
@@ -466,7 +466,7 @@ public class UnitSphereSamplerTest {
      * Test the SharedStateSampler implementation for 2D.
      */
     @Test
-    public void testSharedStateSampler2D() {
+    void testSharedStateSampler2D() {
         testSharedStateSampler(2, false);
     }
 
@@ -474,7 +474,7 @@ public class UnitSphereSamplerTest {
      * Test the SharedStateSampler implementation for 3D.
      */
     @Test
-    public void testSharedStateSampler3D() {
+    void testSharedStateSampler3D() {
         testSharedStateSampler(3, false);
     }
 
@@ -482,7 +482,7 @@ public class UnitSphereSamplerTest {
      * Test the SharedStateSampler implementation for 4D.
      */
     @Test
-    public void testSharedStateSampler4D() {
+    void testSharedStateSampler4D() {
         testSharedStateSampler(4, false);
     }
 
@@ -490,7 +490,7 @@ public class UnitSphereSamplerTest {
      * Test the SharedStateSampler implementation for 1D using the factory constructor.
      */
     @Test
-    public void testSharedStateSampler1DWithFactoryConstructor() {
+    void testSharedStateSampler1DWithFactoryConstructor() {
         testSharedStateSampler(1, true);
     }
 
@@ -498,7 +498,7 @@ public class UnitSphereSamplerTest {
      * Test the SharedStateSampler implementation for 2D using the factory constructor.
      */
     @Test
-    public void testSharedStateSampler2DWithFactoryConstructor() {
+    void testSharedStateSampler2DWithFactoryConstructor() {
         testSharedStateSampler(2, true);
     }
 
@@ -506,7 +506,7 @@ public class UnitSphereSamplerTest {
      * Test the SharedStateSampler implementation for 3D using the factory constructor.
      */
     @Test
-    public void testSharedStateSampler3DWithFactoryConstructor() {
+    void testSharedStateSampler3DWithFactoryConstructor() {
         testSharedStateSampler(3, true);
     }
 
@@ -514,7 +514,7 @@ public class UnitSphereSamplerTest {
      * Test the SharedStateSampler implementation for 4D using the factory constructor.
      */
     @Test
-    public void testSharedStateSampler4DWithFactoryConstructor() {
+    void testSharedStateSampler4DWithFactoryConstructor() {
         testSharedStateSampler(4, true);
     }
 
diff --git a/commons-rng-sampling/src/test/java/org/apache/commons/rng/sampling/distribution/AhrensDieterExponentialSamplerTest.java b/commons-rng-sampling/src/test/java/org/apache/commons/rng/sampling/distribution/AhrensDieterExponentialSamplerTest.java
index 3de03dd..0496f9d 100644
--- a/commons-rng-sampling/src/test/java/org/apache/commons/rng/sampling/distribution/AhrensDieterExponentialSamplerTest.java
+++ b/commons-rng-sampling/src/test/java/org/apache/commons/rng/sampling/distribution/AhrensDieterExponentialSamplerTest.java
@@ -28,12 +28,12 @@ import org.junit.jupiter.api.Test;
 /**
  * Test for the {@link AhrensDieterExponentialSampler}. The tests hit edge cases for the sampler.
  */
-public class AhrensDieterExponentialSamplerTest {
+class AhrensDieterExponentialSamplerTest {
     /**
      * Test the constructor with a bad mean.
      */
     @Test
-    public void testConstructorThrowsWithZeroMean() {
+    void testConstructorThrowsWithZeroMean() {
         final RestorableUniformRandomProvider rng =
             RandomSource.SPLIT_MIX_64.create(0L);
         final double mean = 0;
@@ -44,7 +44,7 @@ public class AhrensDieterExponentialSamplerTest {
      * Test the SharedStateSampler implementation.
      */
     @Test
-    public void testSharedStateSampler() {
+    void testSharedStateSampler() {
         final UniformRandomProvider rng1 = RandomSource.SPLIT_MIX_64.create(0L);
         final UniformRandomProvider rng2 = RandomSource.SPLIT_MIX_64.create(0L);
         final double mean = 1.23;
@@ -59,7 +59,7 @@ public class AhrensDieterExponentialSamplerTest {
      * See RNG-144.
      */
     @Test
-    public void testSamplerWithZeroFromRandomGenerator() {
+    void testSamplerWithZeroFromRandomGenerator() {
         // A broken generator that returns zero.
         final UniformRandomProvider rng = new SplitMix64(0) {
             @Override
@@ -81,7 +81,7 @@ public class AhrensDieterExponentialSamplerTest {
      * double will be at the top of the range {@code [0, 1]}.
      */
     @Test
-    public void testSamplerWithOneFromRandomGenerator() {
+    void testSamplerWithOneFromRandomGenerator() {
         // A broken generator that returns all the bits set.
         final UniformRandomProvider rng = new SplitMix64(0) {
             @Override
diff --git a/commons-rng-sampling/src/test/java/org/apache/commons/rng/sampling/distribution/AhrensDieterMarsagliaTsangGammaSamplerTest.java b/commons-rng-sampling/src/test/java/org/apache/commons/rng/sampling/distribution/AhrensDieterMarsagliaTsangGammaSamplerTest.java
index fee51ac..2b56245 100644
--- a/commons-rng-sampling/src/test/java/org/apache/commons/rng/sampling/distribution/AhrensDieterMarsagliaTsangGammaSamplerTest.java
+++ b/commons-rng-sampling/src/test/java/org/apache/commons/rng/sampling/distribution/AhrensDieterMarsagliaTsangGammaSamplerTest.java
@@ -26,12 +26,12 @@ import org.junit.jupiter.api.Test;
 /**
  * Test for the {@link AhrensDieterMarsagliaTsangGammaSampler}. The tests hit edge cases for the sampler.
  */
-public class AhrensDieterMarsagliaTsangGammaSamplerTest {
+class AhrensDieterMarsagliaTsangGammaSamplerTest {
     /**
      * Test the constructor with a bad alpha.
      */
     @Test
-    public void testConstructorThrowsWithZeroAlpha() {
+    void testConstructorThrowsWithZeroAlpha() {
         final RestorableUniformRandomProvider rng =
             RandomSource.SPLIT_MIX_64.create(0L);
         final double alpha = 0;
@@ -44,7 +44,7 @@ public class AhrensDieterMarsagliaTsangGammaSamplerTest {
      * Test the constructor with a bad theta.
      */
     @Test
-    public void testConstructorThrowsWithZeroTheta() {
+    void testConstructorThrowsWithZeroTheta() {
         final RestorableUniformRandomProvider rng =
             RandomSource.SPLIT_MIX_64.create(0L);
         final double alpha = 1;
@@ -57,7 +57,7 @@ public class AhrensDieterMarsagliaTsangGammaSamplerTest {
      * Test the SharedStateSampler implementation.
      */
     @Test
-    public void testSharedStateSamplerWithAlphaBelowOne() {
+    void testSharedStateSamplerWithAlphaBelowOne() {
         testSharedStateSampler(0.5, 3.456);
     }
 
@@ -65,7 +65,7 @@ public class AhrensDieterMarsagliaTsangGammaSamplerTest {
      * Test the SharedStateSampler implementation.
      */
     @Test
-    public void testSharedStateSamplerWithAlphaAboveOne() {
+    void testSharedStateSamplerWithAlphaAboveOne() {
         testSharedStateSampler(3.5, 3.456);
     }
 
@@ -90,7 +90,7 @@ public class AhrensDieterMarsagliaTsangGammaSamplerTest {
      * used in other tests does not create an instance of the wrapper class.
      */
     @Test
-    public void testToString() {
+    void testToString() {
         final UniformRandomProvider rng = RandomSource.SPLIT_MIX_64.create(0L);
         Assertions.assertTrue(new AhrensDieterMarsagliaTsangGammaSampler(rng, 1.0, 2.0).toString()
                 .toLowerCase().contains("gamma"));
diff --git a/commons-rng-sampling/src/test/java/org/apache/commons/rng/sampling/distribution/AliasMethodDiscreteSamplerTest.java b/commons-rng-sampling/src/test/java/org/apache/commons/rng/sampling/distribution/AliasMethodDiscreteSamplerTest.java
index 2276444..a721161 100644
--- a/commons-rng-sampling/src/test/java/org/apache/commons/rng/sampling/distribution/AliasMethodDiscreteSamplerTest.java
+++ b/commons-rng-sampling/src/test/java/org/apache/commons/rng/sampling/distribution/AliasMethodDiscreteSamplerTest.java
@@ -30,48 +30,48 @@ import java.util.Arrays;
 /**
  * Test for the {@link AliasMethodDiscreteSampler}.
  */
-public class AliasMethodDiscreteSamplerTest {
+class AliasMethodDiscreteSamplerTest {
     @Test
-    public void testConstructorThrowsWithNullProbabilites() {
+    void testConstructorThrowsWithNullProbabilites() {
         Assertions.assertThrows(IllegalArgumentException.class, () -> createSampler(null));
     }
 
     @Test
-    public void testConstructorThrowsWithZeroLengthProbabilites() {
+    void testConstructorThrowsWithZeroLengthProbabilites() {
         Assertions.assertThrows(IllegalArgumentException.class, () -> createSampler(new double[0]));
     }
 
     @Test
-    public void testConstructorThrowsWithNegativeProbabilites() {
+    void testConstructorThrowsWithNegativeProbabilites() {
         Assertions.assertThrows(IllegalArgumentException.class,
             () -> createSampler(new double[] {-1, 0.1, 0.2}));
     }
 
     @Test
-    public void testConstructorThrowsWithNaNProbabilites() {
+    void testConstructorThrowsWithNaNProbabilites() {
         Assertions.assertThrows(IllegalArgumentException.class,
             () -> createSampler(new double[] {0.1, Double.NaN, 0.2}));
     }
 
     @Test
-    public void testConstructorThrowsWithInfiniteProbabilites() {
+    void testConstructorThrowsWithInfiniteProbabilites() {
         Assertions.assertThrows(IllegalArgumentException.class,
             () -> createSampler(new double[] {0.1, Double.POSITIVE_INFINITY, 0.2}));
     }
 
     @Test
-    public void testConstructorThrowsWithInfiniteSumProbabilites() {
+    void testConstructorThrowsWithInfiniteSumProbabilites() {
         Assertions.assertThrows(IllegalArgumentException.class,
             () -> createSampler(new double[] {Double.MAX_VALUE, Double.MAX_VALUE}));
     }
 
     @Test
-    public void testConstructorThrowsWithZeroSumProbabilites() {
+    void testConstructorThrowsWithZeroSumProbabilites() {
         Assertions.assertThrows(IllegalArgumentException.class, () -> createSampler(new double[4]));
     }
 
     @Test
-    public void testToString() {
+    void testToString() {
         final SharedStateDiscreteSampler sampler = createSampler(new double[] {0.5, 0.5});
         Assertions.assertTrue(sampler.toString().toLowerCase().contains("alias method"));
     }
@@ -91,7 +91,7 @@ public class AliasMethodDiscreteSamplerTest {
      * Test sampling from a binomial distribution.
      */
     @Test
-    public void testBinomialSamples() {
+    void testBinomialSamples() {
         final int trials = 67;
         final double probabilityOfSuccess = 0.345;
         final BinomialDistribution dist = new BinomialDistribution(trials, probabilityOfSuccess);
@@ -106,7 +106,7 @@ public class AliasMethodDiscreteSamplerTest {
      * Test sampling from a Poisson distribution.
      */
     @Test
-    public void testPoissonSamples() {
+    void testPoissonSamples() {
         final double mean = 3.14;
         final PoissonDistribution dist = new PoissonDistribution(null, mean,
             PoissonDistribution.DEFAULT_EPSILON, PoissonDistribution.DEFAULT_MAX_ITERATIONS);
@@ -122,7 +122,7 @@ public class AliasMethodDiscreteSamplerTest {
      * Test sampling from a non-uniform distribution of probabilities (these sum to 1).
      */
     @Test
-    public void testNonUniformSamplesWithProbabilities() {
+    void testNonUniformSamplesWithProbabilities() {
         final double[] expected = {0.1, 0.2, 0.3, 0.1, 0.3 };
         checkSamples(expected);
     }
@@ -132,7 +132,7 @@ public class AliasMethodDiscreteSamplerTest {
      * the input probabilities.
      */
     @Test
-    public void testNonUniformSamplesWithProbabilitiesWithDefaultFactoryConstructor() {
+    void testNonUniformSamplesWithProbabilitiesWithDefaultFactoryConstructor() {
         final double[] expected = {0.1, 0.2, 0.3, 0.1, 0.3 };
         checkSamples(AliasMethodDiscreteSampler.of(RandomSource.SPLIT_MIX_64.create(), expected), expected);
     }
@@ -142,7 +142,7 @@ public class AliasMethodDiscreteSamplerTest {
      * probabilities).
      */
     @Test
-    public void testNonUniformSamplesWithObservations() {
+    void testNonUniformSamplesWithObservations() {
         final double[] expected = {1, 2, 3, 1, 3 };
         checkSamples(expected);
     }
@@ -152,7 +152,7 @@ public class AliasMethodDiscreteSamplerTest {
      * Extra zero-values are added to make the table size a power of 2.
      */
     @Test
-    public void testNonUniformSamplesWithProbabilitiesPaddedToPowerOf2() {
+    void testNonUniformSamplesWithProbabilitiesPaddedToPowerOf2() {
         final double[] expected = {0.1, 0, 0.2, 0.3, 0.1, 0.3, 0, 0 };
         checkSamples(expected);
     }
@@ -162,7 +162,7 @@ public class AliasMethodDiscreteSamplerTest {
      * probabilities). Extra zero-values are added to make the table size a power of 2.
      */
     @Test
-    public void testNonUniformSamplesWithObservationsPaddedToPowerOf2() {
+    void testNonUniformSamplesWithObservationsPaddedToPowerOf2() {
         final double[] expected = {1, 2, 3, 0, 1, 3, 0, 0 };
         checkSamples(expected);
     }
@@ -172,7 +172,7 @@ public class AliasMethodDiscreteSamplerTest {
      * Extra zero-values are added.
      */
     @Test
-    public void testNonUniformSamplesWithZeroProbabilities() {
+    void testNonUniformSamplesWithZeroProbabilities() {
         final double[] expected = {0.1, 0, 0.2, 0.3, 0.1, 0.3, 0 };
         checkSamples(expected);
     }
@@ -182,7 +182,7 @@ public class AliasMethodDiscreteSamplerTest {
      * probabilities). Extra zero-values are added.
      */
     @Test
-    public void testNonUniformSamplesWithZeroObservations() {
+    void testNonUniformSamplesWithZeroObservations() {
         final double[] expected = {1, 2, 3, 0, 1, 3, 0 };
         checkSamples(expected);
     }
@@ -192,7 +192,7 @@ public class AliasMethodDiscreteSamplerTest {
      * are no probabilities less than the mean.
      */
     @Test
-    public void testUniformSamplesWithNoObservationLessThanTheMean() {
+    void testUniformSamplesWithNoObservationLessThanTheMean() {
         final double[] expected = {2, 2, 2, 2, 2, 2 };
         checkSamples(expected);
     }
@@ -201,7 +201,7 @@ public class AliasMethodDiscreteSamplerTest {
      * Test sampling from a non-uniform distribution which is zero-padded to a large size.
      */
     @Test
-    public void testLargeTableSize() {
+    void testLargeTableSize() {
         double[] expected = {0.1, 0.2, 0.3, 0.1, 0.3 };
         // Pad to a large table size not supported for fast sampling (anything > 2^11)
         expected = Arrays.copyOf(expected, 1 << 12);
@@ -258,7 +258,7 @@ public class AliasMethodDiscreteSamplerTest {
      * Test the SharedStateSampler implementation for the specialised power-of-2 table size.
      */
     @Test
-    public void testSharedStateSamplerWithPowerOf2TableSize() {
+    void testSharedStateSamplerWithPowerOf2TableSize() {
         testSharedStateSampler(new double[] {0.1, 0.2, 0.3, 0.4});
     }
 
@@ -266,7 +266,7 @@ public class AliasMethodDiscreteSamplerTest {
      * Test the SharedStateSampler implementation for the generic non power-of-2 table size.
      */
     @Test
-    public void testSharedStateSamplerWithNonPowerOf2TableSize() {
+    void testSharedStateSamplerWithNonPowerOf2TableSize() {
         testSharedStateSampler(new double[] {0.1, 0.2, 0.3});
     }
 
diff --git a/commons-rng-sampling/src/test/java/org/apache/commons/rng/sampling/distribution/BoxMullerGaussianSamplerTest.java b/commons-rng-sampling/src/test/java/org/apache/commons/rng/sampling/distribution/BoxMullerGaussianSamplerTest.java
index 84135a3..7831f0a 100644
--- a/commons-rng-sampling/src/test/java/org/apache/commons/rng/sampling/distribution/BoxMullerGaussianSamplerTest.java
+++ b/commons-rng-sampling/src/test/java/org/apache/commons/rng/sampling/distribution/BoxMullerGaussianSamplerTest.java
@@ -24,13 +24,13 @@ import org.junit.jupiter.api.Assertions;
 /**
  * Test for the {@link BoxMullerGaussianSampler}. The tests hit edge cases for the sampler.
  */
-public class BoxMullerGaussianSamplerTest {
+class BoxMullerGaussianSamplerTest {
     /**
      * Test the constructor with a bad standard deviation.
      */
     @SuppressWarnings({"deprecation"})
     @Test
-    public void testConstructorThrowsWithZeroStandardDeviation() {
+    void testConstructorThrowsWithZeroStandardDeviation() {
         final RestorableUniformRandomProvider rng =
             RandomSource.SPLIT_MIX_64.create(0L);
         final double mean = 1;
diff --git a/commons-rng-sampling/src/test/java/org/apache/commons/rng/sampling/distribution/BoxMullerLogNormalSamplerTest.java b/commons-rng-sampling/src/test/java/org/apache/commons/rng/sampling/distribution/BoxMullerLogNormalSamplerTest.java
index 4c5b1de..72d6e67 100644
--- a/commons-rng-sampling/src/test/java/org/apache/commons/rng/sampling/distribution/BoxMullerLogNormalSamplerTest.java
+++ b/commons-rng-sampling/src/test/java/org/apache/commons/rng/sampling/distribution/BoxMullerLogNormalSamplerTest.java
@@ -24,13 +24,13 @@ import org.junit.jupiter.api.Assertions;
 /**
  * Test for the {@link BoxMullerLogNormalSampler}. The tests hit edge cases for the sampler.
  */
-public class BoxMullerLogNormalSamplerTest {
+class BoxMullerLogNormalSamplerTest {
     /**
      * Test the constructor with a bad scale.
      */
     @SuppressWarnings({"deprecation"})
     @Test
-    public void testConstructorThrowsWithNegativeScale() {
+    void testConstructorThrowsWithNegativeScale() {
         final RestorableUniformRandomProvider rng =
             RandomSource.SPLIT_MIX_64.create(0L);
         final double scale = -1e-6;
@@ -44,7 +44,7 @@ public class BoxMullerLogNormalSamplerTest {
      */
     @SuppressWarnings({"deprecation"})
     @Test
-    public void testConstructorThrowsWithZeroShape() {
+    void testConstructorThrowsWithZeroShape() {
         final RestorableUniformRandomProvider rng =
             RandomSource.SPLIT_MIX_64.create(0L);
         final double scale = 1;
diff --git a/commons-rng-sampling/src/test/java/org/apache/commons/rng/sampling/distribution/BoxMullerNormalisedGaussianSamplerTest.java b/commons-rng-sampling/src/test/java/org/apache/commons/rng/sampling/distribution/BoxMullerNormalisedGaussianSamplerTest.java
index c9c970a..c65a8c8 100644
--- a/commons-rng-sampling/src/test/java/org/apache/commons/rng/sampling/distribution/BoxMullerNormalisedGaussianSamplerTest.java
+++ b/commons-rng-sampling/src/test/java/org/apache/commons/rng/sampling/distribution/BoxMullerNormalisedGaussianSamplerTest.java
@@ -24,12 +24,12 @@ import org.junit.jupiter.api.Test;
 /**
  * Test for the {@link BoxMullerNormalizedGaussianSampler}.
  */
-public class BoxMullerNormalisedGaussianSamplerTest {
+class BoxMullerNormalisedGaussianSamplerTest {
     /**
      * Test the SharedStateSampler implementation.
      */
     @Test
-    public void testSharedStateSampler() {
+    void testSharedStateSampler() {
         final UniformRandomProvider rng1 = RandomSource.SPLIT_MIX_64.create(0L);
         final UniformRandomProvider rng2 = RandomSource.SPLIT_MIX_64.create(0L);
         final SharedStateContinuousSampler sampler1 =
diff --git a/commons-rng-sampling/src/test/java/org/apache/commons/rng/sampling/distribution/ChengBetaSamplerTest.java b/commons-rng-sampling/src/test/java/org/apache/commons/rng/sampling/distribution/ChengBetaSamplerTest.java
index 3c8d5ad..8c31206 100644
--- a/commons-rng-sampling/src/test/java/org/apache/commons/rng/sampling/distribution/ChengBetaSamplerTest.java
+++ b/commons-rng-sampling/src/test/java/org/apache/commons/rng/sampling/distribution/ChengBetaSamplerTest.java
@@ -26,12 +26,12 @@ import org.junit.jupiter.api.Test;
 /**
  * Test for the {@link ChengBetaSampler}. The tests hit edge cases for the sampler.
  */
-public class ChengBetaSamplerTest {
+class ChengBetaSamplerTest {
     /**
      * Test the constructor with a bad alpha.
      */
     @Test
-    public void testConstructorThrowsWithZeroAlpha() {
+    void testConstructorThrowsWithZeroAlpha() {
         final RestorableUniformRandomProvider rng =
             RandomSource.SPLIT_MIX_64.create(0L);
         final double alpha = 0;
@@ -44,7 +44,7 @@ public class ChengBetaSamplerTest {
      * Test the constructor with a bad beta.
      */
     @Test
-    public void testConstructorThrowsWithZeroBeta() {
+    void testConstructorThrowsWithZeroBeta() {
         final RestorableUniformRandomProvider rng =
             RandomSource.SPLIT_MIX_64.create(0L);
         final double alpha = 1;
@@ -57,7 +57,7 @@ public class ChengBetaSamplerTest {
      * Test the SharedStateSampler implementation.
      */
     @Test
-    public void testSharedStateSamplerWithAlphaAndBetaAbove1AndAlphaBelowBeta() {
+    void testSharedStateSamplerWithAlphaAndBetaAbove1AndAlphaBelowBeta() {
         testSharedStateSampler(1.23, 4.56);
     }
 
@@ -65,7 +65,7 @@ public class ChengBetaSamplerTest {
      * Test the SharedStateSampler implementation.
      */
     @Test
-    public void testSharedStateSamplerWithAlphaAndBetaAbove1AndAlphaAboveBeta() {
+    void testSharedStateSamplerWithAlphaAndBetaAbove1AndAlphaAboveBeta() {
         testSharedStateSampler(4.56, 1.23);
     }
 
@@ -73,7 +73,7 @@ public class ChengBetaSamplerTest {
      * Test the SharedStateSampler implementation.
      */
     @Test
-    public void testSharedStateSamplerWithAlphaOrBetaBelow1AndAlphaBelowBeta() {
+    void testSharedStateSamplerWithAlphaOrBetaBelow1AndAlphaBelowBeta() {
         testSharedStateSampler(0.23, 4.56);
     }
 
@@ -81,7 +81,7 @@ public class ChengBetaSamplerTest {
      * Test the SharedStateSampler implementation.
      */
     @Test
-    public void testSharedStateSamplerWithAlphaOrBetaBelow1AndAlphaAboveBeta() {
+    void testSharedStateSamplerWithAlphaOrBetaBelow1AndAlphaAboveBeta() {
         testSharedStateSampler(4.56, 0.23);
     }
 
@@ -106,7 +106,7 @@ public class ChengBetaSamplerTest {
      * used in other tests does not create an instance of the wrapper class.
      */
     @Test
-    public void testToString() {
+    void testToString() {
         final UniformRandomProvider rng = RandomSource.SPLIT_MIX_64.create(0L);
         Assertions.assertTrue(new ChengBetaSampler(rng, 1.0, 2.0).toString()
                 .toLowerCase().contains("beta"));
diff --git a/commons-rng-sampling/src/test/java/org/apache/commons/rng/sampling/distribution/ContinuousSamplerParametricTest.java b/commons-rng-sampling/src/test/java/org/apache/commons/rng/sampling/distribution/ContinuousSamplerParametricTest.java
index 058e3b0..6cae7af 100644
--- a/commons-rng-sampling/src/test/java/org/apache/commons/rng/sampling/distribution/ContinuousSamplerParametricTest.java
+++ b/commons-rng-sampling/src/test/java/org/apache/commons/rng/sampling/distribution/ContinuousSamplerParametricTest.java
@@ -27,14 +27,14 @@ import org.junit.jupiter.params.provider.MethodSource;
 /**
  * Tests for random deviates generators.
  */
-public class ContinuousSamplerParametricTest {
+class ContinuousSamplerParametricTest {
     private static Iterable<ContinuousSamplerTestData> getSamplerTestData() {
         return ContinuousSamplersList.list();
     }
 
     @ParameterizedTest
     @MethodSource("getSamplerTestData")
-    public void testSampling(ContinuousSamplerTestData data) {
+    void testSampling(ContinuousSamplerTestData data) {
         check(20000, data.getSampler(), data.getDeciles());
     }
 
diff --git a/commons-rng-sampling/src/test/java/org/apache/commons/rng/sampling/distribution/ContinuousUniformSamplerTest.java b/commons-rng-sampling/src/test/java/org/apache/commons/rng/sampling/distribution/ContinuousUniformSamplerTest.java
index a900fb7..688ada0 100644
--- a/commons-rng-sampling/src/test/java/org/apache/commons/rng/sampling/distribution/ContinuousUniformSamplerTest.java
+++ b/commons-rng-sampling/src/test/java/org/apache/commons/rng/sampling/distribution/ContinuousUniformSamplerTest.java
@@ -26,12 +26,12 @@ import org.junit.jupiter.api.Test;
 /**
  * Test for the {@link ContinuousUniformSampler}.
  */
-public class ContinuousUniformSamplerTest {
+class ContinuousUniformSamplerTest {
     /**
      * Test that the sampler algorithm does not require high to be above low.
      */
     @Test
-    public void testNoRestrictionOnOrderOfLowAndHighParameters() {
+    void testNoRestrictionOnOrderOfLowAndHighParameters() {
         final double low = 3.18;
         final double high = 5.23;
         final UniformRandomProvider rng = RandomSource.SPLIT_MIX_64.create();
@@ -55,7 +55,7 @@ public class ContinuousUniformSamplerTest {
      * that produce the limit of the uniform double output.
      */
     @Test
-    public void testExcludeBounds() {
+    void testExcludeBounds() {
         // A broken RNG that will return in an alternating sequence from 0 up or -1 down.
         // This is either zero bits or all the bits
         final UniformRandomProvider rng = new SplitMix64(0L) {
@@ -93,7 +93,7 @@ public class ContinuousUniformSamplerTest {
      * between the limits.
      */
     @Test
-    public void testInvalidOpenIntervalThrows() {
+    void testInvalidOpenIntervalThrows() {
         final UniformRandomProvider rng = RandomSource.SPLIT_MIX_64.create(0);
         for (final double[] interval : new double[][] {
             // Opposite signs. Require two doubles inside the range.
@@ -130,7 +130,7 @@ public class ContinuousUniformSamplerTest {
      * double values between the limits.
      */
     @Test
-    public void testTinyOpenIntervalSample() {
+    void testTinyOpenIntervalSample() {
         final UniformRandomProvider rng = RandomSource.SPLIT_MIX_64.create(0);
 
         // Test sub-normal ranges
@@ -159,7 +159,7 @@ public class ContinuousUniformSamplerTest {
      * Test the SharedStateSampler implementation.
      */
     @Test
-    public void testSharedStateSampler() {
+    void testSharedStateSampler() {
         testSharedStateSampler(false);
         testSharedStateSampler(true);
     }
@@ -204,7 +204,7 @@ public class ContinuousUniformSamplerTest {
      * when the generator does not produce the limit of the uniform double output.
      */
     @Test
-    public void testSamplerWithBoundsExcluded() {
+    void testSamplerWithBoundsExcluded() {
         // SplitMix64 only returns zero once in the output. Seeded with zero it outputs zero
         // at the end of the period.
         final UniformRandomProvider rng1 = RandomSource.SPLIT_MIX_64.create(0L);
diff --git a/commons-rng-sampling/src/test/java/org/apache/commons/rng/sampling/distribution/DirichletSamplerTest.java b/commons-rng-sampling/src/test/java/org/apache/commons/rng/sampling/distribution/DirichletSamplerTest.java
index 0d42e1c..9c75a7e 100644
--- a/commons-rng-sampling/src/test/java/org/apache/commons/rng/sampling/distribution/DirichletSamplerTest.java
+++ b/commons-rng-sampling/src/test/java/org/apache/commons/rng/sampling/distribution/DirichletSamplerTest.java
@@ -30,58 +30,58 @@ import org.apache.commons.rng.simple.RandomSource;
 /**
  * Test for {@link DirichletSampler}.
  */
-public class DirichletSamplerTest {
+class DirichletSamplerTest {
     @Test
-    public void testDistributionThrowsWithInvalidNumberOfCategories() {
+    void testDistributionThrowsWithInvalidNumberOfCategories() {
         final UniformRandomProvider rng = RandomSource.SPLIT_MIX_64.create(0L);
         Assertions.assertThrows(IllegalArgumentException.class,
             () -> DirichletSampler.of(rng, 1.0));
     }
 
     @Test
-    public void testDistributionThrowsWithZeroConcentration() {
+    void testDistributionThrowsWithZeroConcentration() {
         final UniformRandomProvider rng = RandomSource.SPLIT_MIX_64.create(0L);
         Assertions.assertThrows(IllegalArgumentException.class,
             () -> DirichletSampler.of(rng, 1.0, 0.0));
     }
 
     @Test
-    public void testDistributionThrowsWithNaNConcentration() {
+    void testDistributionThrowsWithNaNConcentration() {
         final UniformRandomProvider rng = RandomSource.SPLIT_MIX_64.create(0L);
         Assertions.assertThrows(IllegalArgumentException.class,
             () -> DirichletSampler.of(rng, 1.0, Double.NaN));
     }
 
     @Test
-    public void testDistributionThrowsWithInfiniteConcentration() {
+    void testDistributionThrowsWithInfiniteConcentration() {
         final UniformRandomProvider rng = RandomSource.SPLIT_MIX_64.create(0L);
         Assertions.assertThrows(IllegalArgumentException.class,
             () -> DirichletSampler.of(rng, 1.0, Double.POSITIVE_INFINITY));
     }
 
     @Test
-    public void testSymmetricDistributionThrowsWithInvalidNumberOfCategories() {
+    void testSymmetricDistributionThrowsWithInvalidNumberOfCategories() {
         final UniformRandomProvider rng = RandomSource.SPLIT_MIX_64.create(0L);
         Assertions.assertThrows(IllegalArgumentException.class,
                 () -> DirichletSampler.symmetric(rng, 1, 1.0));
     }
 
     @Test
-    public void testSymmetricDistributionThrowsWithZeroConcentration() {
+    void testSymmetricDistributionThrowsWithZeroConcentration() {
         final UniformRandomProvider rng = RandomSource.SPLIT_MIX_64.create(0L);
         Assertions.assertThrows(IllegalArgumentException.class,
             () -> DirichletSampler.symmetric(rng, 2, 0.0));
     }
 
     @Test
-    public void testSymmetricDistributionThrowsWithNaNConcentration() {
+    void testSymmetricDistributionThrowsWithNaNConcentration() {
         final UniformRandomProvider rng = RandomSource.SPLIT_MIX_64.create(0L);
         Assertions.assertThrows(IllegalArgumentException.class,
             () -> DirichletSampler.symmetric(rng, 2, Double.NaN));
     }
 
     @Test
-    public void testSymmetricDistributionThrowsWithInfiniteConcentration() {
+    void testSymmetricDistributionThrowsWithInfiniteConcentration() {
         final UniformRandomProvider rng = RandomSource.SPLIT_MIX_64.create(0L);
         Assertions.assertThrows(IllegalArgumentException.class,
             () -> DirichletSampler.symmetric(rng, 2, Double.POSITIVE_INFINITY));
@@ -93,7 +93,7 @@ public class DirichletSamplerTest {
      * normalisation is possible.
      */
     @Test
-    public void testInvalidSampleIsIgnored() {
+    void testInvalidSampleIsIgnored() {
         // An RNG implementation which should create zero samples from the underlying
         // exponential sampler for an initial sequence.
         final UniformRandomProvider rng = new SplitMix64(0L) {
@@ -111,7 +111,7 @@ public class DirichletSamplerTest {
     }
 
     @Test
-    public void testSharedStateSampler() {
+    void testSharedStateSampler() {
         final RandomSource randomSource = RandomSource.XO_RO_SHI_RO_128_PP;
         final byte[] seed = randomSource.createSeed();
         final UniformRandomProvider rng1 = randomSource.create(seed);
@@ -122,7 +122,7 @@ public class DirichletSamplerTest {
     }
 
     @Test
-    public void testSharedStateSamplerForSymmetricCase() {
+    void testSharedStateSamplerForSymmetricCase() {
         final RandomSource randomSource = RandomSource.XO_RO_SHI_RO_128_PP;
         final byte[] seed = randomSource.createSeed();
         final UniformRandomProvider rng1 = randomSource.create(seed);
@@ -133,7 +133,7 @@ public class DirichletSamplerTest {
     }
 
     @Test
-    public void testSymmetricCaseMatchesGeneralCase() {
+    void testSymmetricCaseMatchesGeneralCase() {
         final RandomSource randomSource = RandomSource.XO_RO_SHI_RO_128_PP;
         final byte[] seed = randomSource.createSeed();
         final UniformRandomProvider rng1 = randomSource.create(seed);
@@ -152,7 +152,7 @@ public class DirichletSamplerTest {
      * Test the toString method. This is added to ensure coverage.
      */
     @Test
-    public void testToString() {
+    void testToString() {
         final UniformRandomProvider rng = RandomSource.SPLIT_MIX_64.create(0L);
         final DirichletSampler sampler1 = DirichletSampler.symmetric(rng, 2, 1.0);
         final DirichletSampler sampler2 = DirichletSampler.of(rng, 0.5, 1, 1.5);
@@ -161,27 +161,27 @@ public class DirichletSamplerTest {
     }
 
     @Test
-    public void testSampling1() {
+    void testSampling1() {
         assertSamples(1, 2, 3);
     }
 
     @Test
-    public void testSampling2() {
+    void testSampling2() {
         assertSamples(1, 1, 1);
     }
 
     @Test
-    public void testSampling3() {
+    void testSampling3() {
         assertSamples(0.5, 1, 1.5);
     }
 
     @Test
-    public void testSampling4() {
+    void testSampling4() {
         assertSamples(1, 3);
     }
 
     @Test
-    public void testSampling5() {
+    void testSampling5() {
         assertSamples(1, 2, 3, 4);
     }
 
diff --git a/commons-rng-sampling/src/test/java/org/apache/commons/rng/sampling/distribution/DiscreteSamplerParametricTest.java b/commons-rng-sampling/src/test/java/org/apache/commons/rng/sampling/distribution/DiscreteSamplerParametricTest.java
index f65c68c..9c5079d 100644
--- a/commons-rng-sampling/src/test/java/org/apache/commons/rng/sampling/distribution/DiscreteSamplerParametricTest.java
+++ b/commons-rng-sampling/src/test/java/org/apache/commons/rng/sampling/distribution/DiscreteSamplerParametricTest.java
@@ -29,14 +29,14 @@ import org.apache.commons.math3.stat.inference.ChiSquareTest;
 /**
  * Tests for random deviates generators.
  */
-public class DiscreteSamplerParametricTest {
+class DiscreteSamplerParametricTest {
     private static Iterable<DiscreteSamplerTestData> getSamplerTestData() {
         return DiscreteSamplersList.list();
     }
 
     @ParameterizedTest
     @MethodSource("getSamplerTestData")
-    public void testSampling(DiscreteSamplerTestData data) {
+    void testSampling(DiscreteSamplerTestData data) {
         final int sampleSize = 10000;
         // Probabilities are normalised by the chi-square test
         check(sampleSize,
diff --git a/commons-rng-sampling/src/test/java/org/apache/commons/rng/sampling/distribution/DiscreteUniformSamplerTest.java b/commons-rng-sampling/src/test/java/org/apache/commons/rng/sampling/distribution/DiscreteUniformSamplerTest.java
index 3c85797..0665f4d 100644
--- a/commons-rng-sampling/src/test/java/org/apache/commons/rng/sampling/distribution/DiscreteUniformSamplerTest.java
+++ b/commons-rng-sampling/src/test/java/org/apache/commons/rng/sampling/distribution/DiscreteUniformSamplerTest.java
@@ -29,12 +29,12 @@ import java.util.Locale;
  * Test for the {@link DiscreteUniformSampler}. The tests hit edge cases for the sampler
  * and demonstrates uniformity of output when the underlying RNG output is uniform.
  */
-public class DiscreteUniformSamplerTest {
+class DiscreteUniformSamplerTest {
     /**
      * Test the constructor with a bad range.
      */
     @Test
-    public void testConstructorThrowsWithLowerAboveUpper() {
+    void testConstructorThrowsWithLowerAboveUpper() {
         final int upper = 55;
         final int lower = upper + 1;
         final UniformRandomProvider rng = RandomSource.SPLIT_MIX_64.create(0L);
@@ -43,7 +43,7 @@ public class DiscreteUniformSamplerTest {
     }
 
     @Test
-    public void testSamplesWithRangeOf1() {
+    void testSamplesWithRangeOf1() {
         final int upper = 99;
         final int lower = upper;
         final UniformRandomProvider rng = RandomSource.SPLIT_MIX_64.create();
@@ -58,7 +58,7 @@ public class DiscreteUniformSamplerTest {
      * The output should be the same as the int values produced from a RNG.
      */
     @Test
-    public void testSamplesWithFullRange() {
+    void testSamplesWithFullRange() {
         final int upper = Integer.MAX_VALUE;
         final int lower = Integer.MIN_VALUE;
         final UniformRandomProvider rng1 = RandomSource.SPLIT_MIX_64.create(0L);
@@ -76,7 +76,7 @@ public class DiscreteUniformSamplerTest {
      * the same.
      */
     @Test
-    public void testSamplesWithSmallNonPowerOf2Range() {
+    void testSamplesWithSmallNonPowerOf2Range() {
         final int upper = 257;
         for (final int lower : new int[] {-13, 0, 13}) {
             final int n = upper - lower + 1;
@@ -94,7 +94,7 @@ public class DiscreteUniformSamplerTest {
      * This tests the minimum and maximum output should be the range limits.
      */
     @Test
-    public void testSamplesWithPowerOf2Range() {
+    void testSamplesWithPowerOf2Range() {
         final UniformRandomProvider rngZeroBits = new IntProvider() {
             @Override
             public int next() {
@@ -130,7 +130,7 @@ public class DiscreteUniformSamplerTest {
      * This tests the output is created using a bit shift.
      */
     @Test
-    public void testSamplesWithPowerOf2RangeIsBitShift() {
+    void testSamplesWithPowerOf2RangeIsBitShift() {
         final int lower = 0;
         SharedStateDiscreteSampler sampler;
         // Power of 2 sampler used for a bit shift of 1 to 31.
@@ -152,7 +152,7 @@ public class DiscreteUniformSamplerTest {
      * This tests the large range algorithm uses a rejection method.
      */
     @Test
-    public void testSamplesWithLargeNonPowerOf2RangeIsRejectionMethod() {
+    void testSamplesWithLargeNonPowerOf2RangeIsRejectionMethod() {
         // Create a range bigger than 2^63
         final int upper = Integer.MAX_VALUE / 2 + 1;
         final int lower = Integer.MIN_VALUE / 2 - 1;
@@ -170,17 +170,17 @@ public class DiscreteUniformSamplerTest {
     }
 
     @Test
-    public void testOffsetSamplesWithNonPowerOf2Range() {
+    void testOffsetSamplesWithNonPowerOf2Range() {
         assertOffsetSamples(257);
     }
 
     @Test
-    public void testOffsetSamplesWithPowerOf2Range() {
+    void testOffsetSamplesWithPowerOf2Range() {
         assertOffsetSamples(256);
     }
 
     @Test
-    public void testOffsetSamplesWithRangeOf1() {
+    void testOffsetSamplesWithRangeOf1() {
         assertOffsetSamples(1);
     }
 
@@ -210,7 +210,7 @@ public class DiscreteUniformSamplerTest {
      * Test the sample uniformity when using a small range that is not a power of 2.
      */
     @Test
-    public void testSampleUniformityWithNonPowerOf2Range() {
+    void testSampleUniformityWithNonPowerOf2Range() {
         // Test using a RNG that outputs an evenly spaced set of integers.
         // Create a Weyl sequence using George Marsaglia’s increment from:
         // Marsaglia, G (July 2003). "Xorshift RNGs". Journal of Statistical Software. 8 (14).
@@ -266,7 +266,7 @@ public class DiscreteUniformSamplerTest {
      * Test the sample uniformity when using a small range that is a power of 2.
      */
     @Test
-    public void testSampleUniformityWithPowerOf2Range() {
+    void testSampleUniformityWithPowerOf2Range() {
         // Test using a RNG that outputs a counter of integers.
         // The n most significant bits will be represented uniformly over a
         // sequence that is a 2^n long.
@@ -307,7 +307,7 @@ public class DiscreteUniformSamplerTest {
      * as the first value from the RNG and tests it is rejected.
      */
     @Test
-    public void testSampleRejectionWithNonPowerOf2Range() {
+    void testSampleRejectionWithNonPowerOf2Range() {
         // Test using a RNG that returns a sequence.
         // The first value of zero should produce a sample that is rejected.
         final int[] value = new int[1];
@@ -333,23 +333,23 @@ public class DiscreteUniformSamplerTest {
     }
 
     @Test
-    public void testSharedStateSamplerWithSmallRange() {
+    void testSharedStateSamplerWithSmallRange() {
         testSharedStateSampler(5, 67);
     }
 
     @Test
-    public void testSharedStateSamplerWithLargeRange() {
+    void testSharedStateSamplerWithLargeRange() {
         // Set the range so rejection below or above the threshold occurs with approximately p=0.25
         testSharedStateSampler(Integer.MIN_VALUE / 2 - 1, Integer.MAX_VALUE / 2 + 1);
     }
 
     @Test
-    public void testSharedStateSamplerWithPowerOf2Range() {
+    void testSharedStateSamplerWithPowerOf2Range() {
         testSharedStateSampler(0, 31);
     }
 
     @Test
-    public void testSharedStateSamplerWithRangeOf1() {
+    void testSharedStateSamplerWithRangeOf1() {
         testSharedStateSampler(9, 9);
     }
 
@@ -370,23 +370,23 @@ public class DiscreteUniformSamplerTest {
     }
 
     @Test
-    public void testToStringWithSmallRange() {
+    void testToStringWithSmallRange() {
         assertToString(5, 67);
     }
 
     @Test
-    public void testToStringWithLargeRange() {
+    void testToStringWithLargeRange() {
         assertToString(-99999999, Integer.MAX_VALUE);
     }
 
     @Test
-    public void testToStringWithPowerOf2Range() {
+    void testToStringWithPowerOf2Range() {
         // Note the range is upper - lower + 1
         assertToString(0, 31);
     }
 
     @Test
-    public void testToStringWithRangeOf1() {
+    void testToStringWithRangeOf1() {
         assertToString(9, 9);
     }
 
diff --git a/commons-rng-sampling/src/test/java/org/apache/commons/rng/sampling/distribution/GaussianSamplerTest.java b/commons-rng-sampling/src/test/java/org/apache/commons/rng/sampling/distribution/GaussianSamplerTest.java
index f9e803e..3299c7c 100644
--- a/commons-rng-sampling/src/test/java/org/apache/commons/rng/sampling/distribution/GaussianSamplerTest.java
+++ b/commons-rng-sampling/src/test/java/org/apache/commons/rng/sampling/distribution/GaussianSamplerTest.java
@@ -27,12 +27,12 @@ import org.junit.jupiter.api.Assertions;
 /**
  * Test for the {@link GaussianSampler}. The tests hit edge cases for the sampler.
  */
-public class GaussianSamplerTest {
+class GaussianSamplerTest {
     /**
      * Test the constructor with a zero standard deviation.
      */
     @Test
-    public void testConstructorThrowsWithZeroStandardDeviation() {
+    void testConstructorThrowsWithZeroStandardDeviation() {
         final RestorableUniformRandomProvider rng =
             RandomSource.SPLIT_MIX_64.create(0L);
         final NormalizedGaussianSampler gauss = ZigguratSampler.NormalizedGaussian.of(rng);
@@ -46,7 +46,7 @@ public class GaussianSamplerTest {
      * Test the constructor with an infinite standard deviation.
      */
     @Test
-    public void testConstructorThrowsWithInfiniteStandardDeviation() {
+    void testConstructorThrowsWithInfiniteStandardDeviation() {
         final RestorableUniformRandomProvider rng =
             RandomSource.SPLIT_MIX_64.create(0L);
         final NormalizedGaussianSampler gauss = new ZigguratNormalizedGaussianSampler(rng);
@@ -60,7 +60,7 @@ public class GaussianSamplerTest {
      * Test the constructor with a NaN standard deviation.
      */
     @Test
-    public void testConstructorThrowsWithNaNStandardDeviation() {
+    void testConstructorThrowsWithNaNStandardDeviation() {
         final RestorableUniformRandomProvider rng =
             RandomSource.SPLIT_MIX_64.create(0L);
         final NormalizedGaussianSampler gauss = new ZigguratNormalizedGaussianSampler(rng);
@@ -74,7 +74,7 @@ public class GaussianSamplerTest {
      * Test the constructor with an infinite mean.
      */
     @Test
-    public void testConstructorThrowsWithInfiniteMean() {
+    void testConstructorThrowsWithInfiniteMean() {
         final RestorableUniformRandomProvider rng =
             RandomSource.SPLIT_MIX_64.create(0L);
         final NormalizedGaussianSampler gauss = new ZigguratNormalizedGaussianSampler(rng);
@@ -88,7 +88,7 @@ public class GaussianSamplerTest {
      * Test the constructor with a NaN mean.
      */
     @Test
-    public void testConstructorThrowsWithNaNMean() {
+    void testConstructorThrowsWithNaNMean() {
         final RestorableUniformRandomProvider rng =
             RandomSource.SPLIT_MIX_64.create(0L);
         final NormalizedGaussianSampler gauss = new ZigguratNormalizedGaussianSampler(rng);
@@ -102,7 +102,7 @@ public class GaussianSamplerTest {
      * Test the SharedStateSampler implementation.
      */
     @Test
-    public void testSharedStateSampler() {
+    void testSharedStateSampler() {
         final UniformRandomProvider rng1 = RandomSource.SPLIT_MIX_64.create(0L);
         final UniformRandomProvider rng2 = RandomSource.SPLIT_MIX_64.create(0L);
         final NormalizedGaussianSampler gauss = ZigguratSampler.NormalizedGaussian.of(rng1);
@@ -119,7 +119,7 @@ public class GaussianSamplerTest {
      * not a SharedStateSampler.
      */
     @Test
-    public void testSharedStateSamplerThrowsIfUnderlyingSamplerDoesNotShareState() {
+    void testSharedStateSamplerThrowsIfUnderlyingSamplerDoesNotShareState() {
         final UniformRandomProvider rng2 = RandomSource.SPLIT_MIX_64.create(0L);
         final NormalizedGaussianSampler gauss = new NormalizedGaussianSampler() {
             @Override
@@ -140,7 +140,7 @@ public class GaussianSamplerTest {
      * a SharedStateSampler that returns an incorrect type.
      */
     @Test
-    public void testSharedStateSamplerThrowsIfUnderlyingSamplerReturnsWrongSharedState() {
+    void testSharedStateSamplerThrowsIfUnderlyingSamplerReturnsWrongSharedState() {
         final UniformRandomProvider rng2 = RandomSource.SPLIT_MIX_64.create(0L);
         final NormalizedGaussianSampler gauss = new BadSharedStateNormalizedGaussianSampler();
         final double mean = 1.23;
diff --git a/commons-rng-sampling/src/test/java/org/apache/commons/rng/sampling/distribution/GeometricSamplerTest.java b/commons-rng-sampling/src/test/java/org/apache/commons/rng/sampling/distribution/GeometricSamplerTest.java
index 6465d78..a1c50aa 100644
--- a/commons-rng-sampling/src/test/java/org/apache/commons/rng/sampling/distribution/GeometricSamplerTest.java
+++ b/commons-rng-sampling/src/test/java/org/apache/commons/rng/sampling/distribution/GeometricSamplerTest.java
@@ -25,13 +25,13 @@ import org.junit.jupiter.api.Test;
 /**
  * Test for the {@link GeometricSampler}. The tests hit edge cases for the sampler.
  */
-public class GeometricSamplerTest {
+class GeometricSamplerTest {
     /**
      * Test the edge case where the probability of success is 1. This is a valid geometric
      * distribution where the sample should always be 0.
      */
     @Test
-    public void testProbabilityOfSuccessIsOneGeneratesZeroForSamples() {
+    void testProbabilityOfSuccessIsOneGeneratesZeroForSamples() {
         final UniformRandomProvider rng = RandomSource.SPLIT_MIX_64.create(0L);
         final SharedStateDiscreteSampler sampler = GeometricSampler.of(rng, 1);
         // All samples should be 0
@@ -45,7 +45,7 @@ public class GeometricSamplerTest {
      * mean for the exponential distribution.
      */
     @Test
-    public void testProbabilityOfSuccessUnderOneIsValid() {
+    void testProbabilityOfSuccessUnderOneIsValid() {
         // The sampler explicitly handles probabilityOfSuccess == 1 as an edge case.
         // Anything under it should be valid for sampling from an ExponentialDistribution.
         final double probabilityOfSuccess = Math.nextDown(1);
@@ -64,7 +64,7 @@ public class GeometricSamplerTest {
      * {@link Object#toString()} method to the normal case tested elsewhere.
      */
     @Test
-    public void testProbabilityOfSuccessIsOneSamplerToString() {
+    void testProbabilityOfSuccessIsOneSamplerToString() {
         final UniformRandomProvider unusedRng = RandomSource.SPLIT_MIX_64.create(0L);
         final SharedStateDiscreteSampler sampler = GeometricSampler.of(unusedRng, 1);
         Assertions.assertTrue(sampler.toString().contains("Geometric"),
@@ -81,7 +81,7 @@ public class GeometricSamplerTest {
      * is introduced.
      */
     @Test
-    public void testProbabilityOfSuccessIsAlmostZeroGeneratesMaxValueForSamples() {
+    void testProbabilityOfSuccessIsAlmostZeroGeneratesMaxValueForSamples() {
         final UniformRandomProvider rng = RandomSource.SPLIT_MIX_64.create(0L);
         final SharedStateDiscreteSampler sampler = GeometricSampler.of(rng, Double.MIN_VALUE);
         // All samples should be max value
@@ -95,7 +95,7 @@ public class GeometricSamplerTest {
      * Test probability of success {@code >1} is not allowed.
      */
     @Test
-    public void testProbabilityOfSuccessAboveOneThrows() {
+    void testProbabilityOfSuccessAboveOneThrows() {
         final UniformRandomProvider unusedRng = RandomSource.SPLIT_MIX_64.create(0L);
         final double probabilityOfSuccess = Math.nextUp(1.0);
         Assertions.assertThrows(IllegalArgumentException.class,
@@ -106,7 +106,7 @@ public class GeometricSamplerTest {
      * Test probability of success {@code 0} is not allowed.
      */
     @Test
-    public void testProbabilityOfSuccessIsZeroThrows() {
+    void testProbabilityOfSuccessIsZeroThrows() {
         final UniformRandomProvider unusedRng = RandomSource.SPLIT_MIX_64.create(0L);
         final double probabilityOfSuccess = 0;
         Assertions.assertThrows(IllegalArgumentException.class,
@@ -117,7 +117,7 @@ public class GeometricSamplerTest {
      * Test the SharedStateSampler implementation.
      */
     @Test
-    public void testSharedStateSampler() {
+    void testSharedStateSampler() {
         testSharedStateSampler(0.5);
     }
 
@@ -126,7 +126,7 @@ public class GeometricSamplerTest {
      * success is {@code 1.0}.
      */
     @Test
-    public void testSharedStateSamplerWithProbabilityOfSuccessOne() {
+    void testSharedStateSamplerWithProbabilityOfSuccessOne() {
         testSharedStateSampler(1.0);
     }
 
diff --git a/commons-rng-sampling/src/test/java/org/apache/commons/rng/sampling/distribution/GuideTableDiscreteSamplerTest.java b/commons-rng-sampling/src/test/java/org/apache/commons/rng/sampling/distribution/GuideTableDiscreteSamplerTest.java
index 4864e53..f715476 100644
--- a/commons-rng-sampling/src/test/java/org/apache/commons/rng/sampling/distribution/GuideTableDiscreteSamplerTest.java
+++ b/commons-rng-sampling/src/test/java/org/apache/commons/rng/sampling/distribution/GuideTableDiscreteSamplerTest.java
@@ -28,49 +28,49 @@ import org.junit.jupiter.api.Test;
 /**
  * Test for the {@link GuideTableDiscreteSampler}.
  */
-public class GuideTableDiscreteSamplerTest {
+class GuideTableDiscreteSamplerTest {
     @Test
-    public void testConstructorThrowsWithNullProbabilites() {
+    void testConstructorThrowsWithNullProbabilites() {
         assertConstructorThrows(null, 1.0);
     }
 
     @Test
-    public void testConstructorThrowsWithZeroLengthProbabilites() {
+    void testConstructorThrowsWithZeroLengthProbabilites() {
         assertConstructorThrows(new double[0], 1.0);
     }
 
     @Test
-    public void testConstructorThrowsWithNegativeProbabilites() {
+    void testConstructorThrowsWithNegativeProbabilites() {
         assertConstructorThrows(new double[] {-1, 0.1, 0.2}, 1.0);
     }
 
     @Test
-    public void testConstructorThrowsWithNaNProbabilites() {
+    void testConstructorThrowsWithNaNProbabilites() {
         assertConstructorThrows(new double[] {0.1, Double.NaN, 0.2}, 1.0);
     }
 
     @Test
-    public void testConstructorThrowsWithInfiniteProbabilites() {
+    void testConstructorThrowsWithInfiniteProbabilites() {
         assertConstructorThrows(new double[] {0.1, Double.POSITIVE_INFINITY, 0.2}, 1.0);
     }
 
     @Test
-    public void testConstructorThrowsWithInfiniteSumProbabilites() {
+    void testConstructorThrowsWithInfiniteSumProbabilites() {
         assertConstructorThrows(new double[] {Double.MAX_VALUE, Double.MAX_VALUE}, 1.0);
     }
 
     @Test
-    public void testConstructorThrowsWithZeroSumProbabilites() {
+    void testConstructorThrowsWithZeroSumProbabilites() {
         assertConstructorThrows(new double[4], 1.0);
     }
 
     @Test
-    public void testConstructorThrowsWithZeroAlpha() {
+    void testConstructorThrowsWithZeroAlpha() {
         assertConstructorThrows(new double[] {0.5, 0.5}, 0.0);
     }
 
     @Test
-    public void testConstructorThrowsWithNegativeAlpha() {
+    void testConstructorThrowsWithNegativeAlpha() {
         assertConstructorThrows(new double[] {0.5, 0.5}, -1.0);
     }
 
@@ -87,7 +87,7 @@ public class GuideTableDiscreteSamplerTest {
     }
 
     @Test
-    public void testToString() {
+    void testToString() {
         final UniformRandomProvider rng = RandomSource.SPLIT_MIX_64.create();
         final SharedStateDiscreteSampler sampler = GuideTableDiscreteSampler.of(rng, new double[] {0.5, 0.5}, 1.0);
         Assertions.assertTrue(sampler.toString().toLowerCase().contains("guide table"));
@@ -97,7 +97,7 @@ public class GuideTableDiscreteSamplerTest {
      * Test sampling from a binomial distribution.
      */
     @Test
-    public void testBinomialSamples() {
+    void testBinomialSamples() {
         final int trials = 67;
         final double probabilityOfSuccess = 0.345;
         final BinomialDistribution dist = new BinomialDistribution(null, trials, probabilityOfSuccess);
@@ -112,7 +112,7 @@ public class GuideTableDiscreteSamplerTest {
      * Test sampling from a Poisson distribution.
      */
     @Test
-    public void testPoissonSamples() {
+    void testPoissonSamples() {
         final double mean = 3.14;
         final PoissonDistribution dist = new PoissonDistribution(null, mean,
             PoissonDistribution.DEFAULT_EPSILON, PoissonDistribution.DEFAULT_MAX_ITERATIONS);
@@ -128,7 +128,7 @@ public class GuideTableDiscreteSamplerTest {
      * Test sampling from a non-uniform distribution of probabilities (these sum to 1).
      */
     @Test
-    public void testNonUniformSamplesWithProbabilities() {
+    void testNonUniformSamplesWithProbabilities() {
         final double[] expected = {0.1, 0.2, 0.3, 0.1, 0.3};
         checkSamples(expected, 1.0);
     }
@@ -138,7 +138,7 @@ public class GuideTableDiscreteSamplerTest {
      * the default.
      */
     @Test
-    public void testNonUniformSamplesWithProbabilitiesWithSmallAlpha() {
+    void testNonUniformSamplesWithProbabilitiesWithSmallAlpha() {
         final double[] expected = {0.1, 0.2, 0.3, 0.1, 0.3};
         checkSamples(expected, 0.1);
     }
@@ -148,7 +148,7 @@ public class GuideTableDiscreteSamplerTest {
      * the default.
      */
     @Test
-    public void testNonUniformSamplesWithProbabilitiesWithLargeAlpha() {
+    void testNonUniformSamplesWithProbabilitiesWithLargeAlpha() {
         final double[] expected = {0.1, 0.2, 0.3, 0.1, 0.3};
         checkSamples(expected, 10.0);
     }
@@ -158,7 +158,7 @@ public class GuideTableDiscreteSamplerTest {
      * probabilities).
      */
     @Test
-    public void testNonUniformSamplesWithObservations() {
+    void testNonUniformSamplesWithObservations() {
         final double[] expected = {1, 2, 3, 1, 3};
         checkSamples(expected, 1.0);
     }
@@ -168,7 +168,7 @@ public class GuideTableDiscreteSamplerTest {
      * Extra zero-values are added.
      */
     @Test
-    public void testNonUniformSamplesWithZeroProbabilities() {
+    void testNonUniformSamplesWithZeroProbabilities() {
         final double[] expected = {0.1, 0, 0.2, 0.3, 0.1, 0.3, 0};
         checkSamples(expected, 1.0);
     }
@@ -178,7 +178,7 @@ public class GuideTableDiscreteSamplerTest {
      * probabilities). Extra zero-values are added.
      */
     @Test
-    public void testNonUniformSamplesWithZeroObservations() {
+    void testNonUniformSamplesWithZeroObservations() {
         final double[] expected = {1, 2, 3, 0, 1, 3, 0};
         checkSamples(expected, 1.0);
     }
@@ -188,7 +188,7 @@ public class GuideTableDiscreteSamplerTest {
      * are no probabilities less than the mean.
      */
     @Test
-    public void testUniformSamplesWithNoObservationLessThanTheMean() {
+    void testUniformSamplesWithNoObservationLessThanTheMean() {
         final double[] expected = {2, 2, 2, 2, 2, 2};
         checkSamples(expected, 1.0);
     }
@@ -243,7 +243,7 @@ public class GuideTableDiscreteSamplerTest {
      * Test the SharedStateSampler implementation.
      */
     @Test
-    public void testSharedStateSampler() {
+    void testSharedStateSampler() {
         final UniformRandomProvider rng1 = RandomSource.SPLIT_MIX_64.create(0L);
         final UniformRandomProvider rng2 = RandomSource.SPLIT_MIX_64.create(0L);
         final double[] probabilities = {0.1, 0, 0.2, 0.3, 0.1, 0.3, 0};
diff --git a/commons-rng-sampling/src/test/java/org/apache/commons/rng/sampling/distribution/InternalUtilsTest.java b/commons-rng-sampling/src/test/java/org/apache/commons/rng/sampling/distribution/InternalUtilsTest.java
index 4d6c19c..dc2e5df 100644
--- a/commons-rng-sampling/src/test/java/org/apache/commons/rng/sampling/distribution/InternalUtilsTest.java
+++ b/commons-rng-sampling/src/test/java/org/apache/commons/rng/sampling/distribution/InternalUtilsTest.java
@@ -24,12 +24,12 @@ import org.junit.jupiter.api.Test;
 /**
  * Test for the {@link InternalUtils}.
  */
-public class InternalUtilsTest {
+class InternalUtilsTest {
     /** The maximum value for n! that is representable as a long. */
     private static final int MAX_REPRESENTABLE = 20;
 
     @Test
-    public void testFactorial() {
+    void testFactorial() {
         Assertions.assertEquals(1L, InternalUtils.factorial(0));
         long result = 1;
         for (int n = 1; n <= MAX_REPRESENTABLE; n++) {
@@ -39,19 +39,19 @@ public class InternalUtilsTest {
     }
 
     @Test
-    public void testFactorialThrowsWhenNegative() {
+    void testFactorialThrowsWhenNegative() {
         Assertions.assertThrows(IndexOutOfBoundsException.class,
             () -> InternalUtils.factorial(-1));
     }
 
     @Test
-    public void testFactorialThrowsWhenNotRepresentableAsLong() {
+    void testFactorialThrowsWhenNotRepresentableAsLong() {
         Assertions.assertThrows(IndexOutOfBoundsException.class,
             () -> InternalUtils.factorial(MAX_REPRESENTABLE + 1));
     }
 
     @Test
-    public void testFactorialLog() {
+    void testFactorialLog() {
         // Cache size allows some of the factorials to be cached and some
         // to be under the precomputed factorials.
         FactorialLog factorialLog = FactorialLog.create().withCache(MAX_REPRESENTABLE / 2);
@@ -64,7 +64,7 @@ public class InternalUtilsTest {
     }
 
     @Test
-    public void testFactorialLogCacheSizeAboveRepresentableFactorials() {
+    void testFactorialLogCacheSizeAboveRepresentableFactorials() {
         final int limit = MAX_REPRESENTABLE + 5;
         FactorialLog factorialLog = FactorialLog.create().withCache(limit);
         for (int n = MAX_REPRESENTABLE; n <= limit; n++) {
@@ -75,7 +75,7 @@ public class InternalUtilsTest {
     }
 
     @Test
-    public void testFactorialLogCacheExpansion() {
+    void testFactorialLogCacheExpansion() {
         // There is no way to determine if the cache values were reused but this test
         // exercises the method to ensure it does not error.
         final FactorialLog factorialLog = FactorialLog.create()
@@ -95,13 +95,13 @@ public class InternalUtilsTest {
     }
 
     @Test
-    public void testLogFactorialThrowsWhenNegative() {
+    void testLogFactorialThrowsWhenNegative() {
         Assertions.assertThrows(IndexOutOfBoundsException.class,
             () -> FactorialLog.create().value(-1));
     }
 
     @Test
-    public void testLogFactorialWithCacheThrowsWhenNegative() {
+    void testLogFactorialWithCacheThrowsWhenNegative() {
         Assertions.assertThrows(NegativeArraySizeException.class,
             () -> FactorialLog.create().withCache(-1));
     }
diff --git a/commons-rng-sampling/src/test/java/org/apache/commons/rng/sampling/distribution/InverseTransformContinuousSamplerTest.java b/commons-rng-sampling/src/test/java/org/apache/commons/rng/sampling/distribution/InverseTransformContinuousSamplerTest.java
index 4a7e974..325a980 100644
--- a/commons-rng-sampling/src/test/java/org/apache/commons/rng/sampling/distribution/InverseTransformContinuousSamplerTest.java
+++ b/commons-rng-sampling/src/test/java/org/apache/commons/rng/sampling/distribution/InverseTransformContinuousSamplerTest.java
@@ -24,12 +24,12 @@ import org.junit.jupiter.api.Test;
 /**
  * Test for the {@link InverseTransformContinuousSampler}.
  */
-public class InverseTransformContinuousSamplerTest {
+class InverseTransformContinuousSamplerTest {
     /**
      * Test the SharedStateSampler implementation.
      */
     @Test
-    public void testSharedStateSampler() {
+    void testSharedStateSampler() {
         ContinuousInverseCumulativeProbabilityFunction function =
             new ContinuousInverseCumulativeProbabilityFunction() {
                 @Override
diff --git a/commons-rng-sampling/src/test/java/org/apache/commons/rng/sampling/distribution/InverseTransformDiscreteSamplerTest.java b/commons-rng-sampling/src/test/java/org/apache/commons/rng/sampling/distribution/InverseTransformDiscreteSamplerTest.java
index 66abfad..73d6e7d 100644
--- a/commons-rng-sampling/src/test/java/org/apache/commons/rng/sampling/distribution/InverseTransformDiscreteSamplerTest.java
+++ b/commons-rng-sampling/src/test/java/org/apache/commons/rng/sampling/distribution/InverseTransformDiscreteSamplerTest.java
@@ -24,12 +24,12 @@ import org.junit.jupiter.api.Test;
 /**
  * Test for the {@link InverseTransformDiscreteSampler}.
  */
-public class InverseTransformDiscreteSamplerTest {
+class InverseTransformDiscreteSamplerTest {
     /**
      * Test the SharedStateSampler implementation.
      */
     @Test
-    public void testSharedStateSampler() {
+    void testSharedStateSampler() {
         DiscreteInverseCumulativeProbabilityFunction function =
             new DiscreteInverseCumulativeProbabilityFunction() {
                 @Override
diff --git a/commons-rng-sampling/src/test/java/org/apache/commons/rng/sampling/distribution/InverseTransformParetoSamplerTest.java b/commons-rng-sampling/src/test/java/org/apache/commons/rng/sampling/distribution/InverseTransformParetoSamplerTest.java
index 6021077..6eed29f 100644
--- a/commons-rng-sampling/src/test/java/org/apache/commons/rng/sampling/distribution/InverseTransformParetoSamplerTest.java
+++ b/commons-rng-sampling/src/test/java/org/apache/commons/rng/sampling/distribution/InverseTransformParetoSamplerTest.java
@@ -26,12 +26,12 @@ import org.junit.jupiter.api.Assertions;
 /**
  * Test for the {@link InverseTransformParetoSampler}. The tests hit edge cases for the sampler.
  */
-public class InverseTransformParetoSamplerTest {
+class InverseTransformParetoSamplerTest {
     /**
      * Test the constructor with a bad scale.
      */
     @Test
-    public void testConstructorThrowsWithZeroScale() {
+    void testConstructorThrowsWithZeroScale() {
         final RestorableUniformRandomProvider rng =
             RandomSource.SPLIT_MIX_64.create(0L);
         final double scale = 0;
@@ -44,7 +44,7 @@ public class InverseTransformParetoSamplerTest {
      * Test the constructor with a bad shape.
      */
     @Test
-    public void testConstructorThrowsWithZeroShape() {
+    void testConstructorThrowsWithZeroShape() {
         final RestorableUniformRandomProvider rng =
             RandomSource.SPLIT_MIX_64.create(0L);
         final double scale = 1;
@@ -57,7 +57,7 @@ public class InverseTransformParetoSamplerTest {
      * Test the SharedStateSampler implementation.
      */
     @Test
-    public void testSharedStateSampler() {
+    void testSharedStateSampler() {
         final UniformRandomProvider rng1 = RandomSource.SPLIT_MIX_64.create(0L);
         final UniformRandomProvider rng2 = RandomSource.SPLIT_MIX_64.create(0L);
         final double scale = 1.23;
diff --git a/commons-rng-sampling/src/test/java/org/apache/commons/rng/sampling/distribution/KempSmallMeanPoissonSamplerTest.java b/commons-rng-sampling/src/test/java/org/apache/commons/rng/sampling/distribution/KempSmallMeanPoissonSamplerTest.java
index 935f4c3..51dc06b 100644
--- a/commons-rng-sampling/src/test/java/org/apache/commons/rng/sampling/distribution/KempSmallMeanPoissonSamplerTest.java
+++ b/commons-rng-sampling/src/test/java/org/apache/commons/rng/sampling/distribution/KempSmallMeanPoissonSamplerTest.java
@@ -27,7 +27,7 @@ import org.junit.jupiter.api.Test;
  * Test for the {@link KempSmallMeanPoissonSampler}. The tests hit edge cases for the
  * sampler and tests it functions at the supported upper bound on the mean.
  */
-public class KempSmallMeanPoissonSamplerTest {
+class KempSmallMeanPoissonSamplerTest {
     /**
      * The upper limit on the mean.
      *
@@ -43,7 +43,7 @@ public class KempSmallMeanPoissonSamplerTest {
      * Test the constructor with a bad mean.
      */
     @Test
-    public void testConstructorThrowsWithMeanLargerThanUpperBound() {
+    void testConstructorThrowsWithMeanLargerThanUpperBound() {
         final double mean = SUPPORTED_UPPER_BOUND + 1;
         Assertions.assertThrows(IllegalArgumentException.class,
             () -> KempSmallMeanPoissonSampler.of(dummyRng, mean));
@@ -53,7 +53,7 @@ public class KempSmallMeanPoissonSamplerTest {
      * Test the constructor with zero mean.
      */
     @Test
-    public void testConstructorThrowsWithZeroMean() {
+    void testConstructorThrowsWithZeroMean() {
         final double mean = 0;
         Assertions.assertThrows(IllegalArgumentException.class,
             () -> KempSmallMeanPoissonSampler.of(dummyRng, mean));
@@ -63,7 +63,7 @@ public class KempSmallMeanPoissonSamplerTest {
      * Test the constructor with a negative mean.
      */
     @Test
-    public void testConstructorThrowsWithNegativeMean() {
+    void testConstructorThrowsWithNegativeMean() {
         final double mean = -1;
         Assertions.assertThrows(IllegalArgumentException.class,
             () -> KempSmallMeanPoissonSampler.of(dummyRng, mean));
@@ -73,7 +73,7 @@ public class KempSmallMeanPoissonSamplerTest {
      * Test the constructor with a NaN mean.
      */
     @Test
-    public void testConstructorWithNaNMean() {
+    void testConstructorWithNaNMean() {
         final double mean = Double.NaN;
         Assertions.assertThrows(IllegalArgumentException.class,
             () -> KempSmallMeanPoissonSampler.of(dummyRng, mean));
@@ -84,7 +84,7 @@ public class KempSmallMeanPoissonSamplerTest {
      * starting from 1.
      */
     @Test
-    public void testSummationFrom1AtUpperBound() {
+    void testSummationFrom1AtUpperBound() {
         final double mean = SUPPORTED_UPPER_BOUND;
         double u = 1;
         int x = 0;
@@ -103,7 +103,7 @@ public class KempSmallMeanPoissonSamplerTest {
      * starting from 0.
      */
     @Test
-    public void testSummationTo1AtUpperBound() {
+    void testSummationTo1AtUpperBound() {
         final double mean = SUPPORTED_UPPER_BOUND;
         double u = 0;
         int x = 0;
@@ -121,7 +121,7 @@ public class KempSmallMeanPoissonSamplerTest {
      * Test the sampler functions at the upper bound on the mean.
      */
     @Test
-    public void testSamplerAtUpperBounds() {
+    void testSamplerAtUpperBounds() {
         final double mean = SUPPORTED_UPPER_BOUND;
 
         // Test some ranges for the cumulative probability
@@ -150,7 +150,7 @@ public class KempSmallMeanPoissonSamplerTest {
      * Test the SharedStateSampler implementation.
      */
     @Test
-    public void testSharedStateSampler() {
+    void testSharedStateSampler() {
         final UniformRandomProvider rng1 = RandomSource.SPLIT_MIX_64.create(0L);
         final UniformRandomProvider rng2 = RandomSource.SPLIT_MIX_64.create(0L);
         final double mean = 1.23;
diff --git a/commons-rng-sampling/src/test/java/org/apache/commons/rng/sampling/distribution/LargeMeanPoissonSamplerTest.java b/commons-rng-sampling/src/test/java/org/apache/commons/rng/sampling/distribution/LargeMeanPoissonSamplerTest.java
index b8aa3da..8921ac0 100644
--- a/commons-rng-sampling/src/test/java/org/apache/commons/rng/sampling/distribution/LargeMeanPoissonSamplerTest.java
+++ b/commons-rng-sampling/src/test/java/org/apache/commons/rng/sampling/distribution/LargeMeanPoissonSamplerTest.java
@@ -29,7 +29,7 @@ import org.junit.jupiter.api.Test;
  * This test checks the {@link LargeMeanPoissonSampler} can be created
  * from a saved state.
  */
-public class LargeMeanPoissonSamplerTest {
+class LargeMeanPoissonSamplerTest {
 
     // Edge cases for construction
 
@@ -37,7 +37,7 @@ public class LargeMeanPoissonSamplerTest {
      * Test the constructor with a bad mean.
      */
     @Test
-    public void testConstructorThrowsWithMeanLargerThanUpperBound() {
+    void testConstructorThrowsWithMeanLargerThanUpperBound() {
         final RestorableUniformRandomProvider rng =
                 RandomSource.SPLIT_MIX_64.create(0L);
         final double mean = Integer.MAX_VALUE / 2 + 1;
@@ -49,7 +49,7 @@ public class LargeMeanPoissonSamplerTest {
      * Test the constructor with a mean below 1.
      */
     @Test
-    public void testConstructorThrowsWithMeanBelow1() {
+    void testConstructorThrowsWithMeanBelow1() {
         final RestorableUniformRandomProvider rng =
                 RandomSource.SPLIT_MIX_64.create(0L);
         final double mean = Math.nextDown(1);
@@ -61,7 +61,7 @@ public class LargeMeanPoissonSamplerTest {
      * Test the constructor using the state with a negative fractional mean.
      */
     @Test
-    public void testConstructorThrowsWithStateAndNegativeFractionalMean() {
+    void testConstructorThrowsWithStateAndNegativeFractionalMean() {
         final RestorableUniformRandomProvider rng =
                 RandomSource.SPLIT_MIX_64.create(0L);
         final LargeMeanPoissonSamplerState state = new LargeMeanPoissonSampler(rng, 1).getState();
@@ -73,7 +73,7 @@ public class LargeMeanPoissonSamplerTest {
      * Test the constructor with a non-fractional mean.
      */
     @Test
-    public void testConstructorThrowsWithStateAndNonFractionalMean() {
+    void testConstructorThrowsWithStateAndNonFractionalMean() {
         final RestorableUniformRandomProvider rng =
                 RandomSource.SPLIT_MIX_64.create(0L);
         final LargeMeanPoissonSamplerState state = new LargeMeanPoissonSampler(rng, 1).getState();
@@ -85,7 +85,7 @@ public class LargeMeanPoissonSamplerTest {
      * Test the constructor with fractional mean of 1.
      */
     @Test
-    public void testConstructorThrowsWithStateAndFractionalMeanOne() {
+    void testConstructorThrowsWithStateAndFractionalMeanOne() {
         final RestorableUniformRandomProvider rng =
                 RandomSource.SPLIT_MIX_64.create(0L);
         final LargeMeanPoissonSamplerState state = new LargeMeanPoissonSampler(rng, 1).getState();
@@ -100,7 +100,7 @@ public class LargeMeanPoissonSamplerTest {
      * is created using the saved state.
      */
     @Test
-    public void testCanComputeSameSamplesWhenConstructedWithState() {
+    void testCanComputeSameSamplesWhenConstructedWithState() {
         // Two identical RNGs
         final RestorableUniformRandomProvider rng1 =
                 RandomSource.MWC_256.create();
@@ -146,7 +146,7 @@ public class LargeMeanPoissonSamplerTest {
      * Test the SharedStateSampler implementation.
      */
     @Test
-    public void testSharedStateSamplerWithFractionalMean() {
+    void testSharedStateSamplerWithFractionalMean() {
         testSharedStateSampler(34.5);
     }
 
@@ -155,7 +155,7 @@ public class LargeMeanPoissonSamplerTest {
      * small mean sampler (i.e. no fraction part to the mean).
      */
     @Test
-    public void testSharedStateSamplerWithIntegerMean() {
+    void testSharedStateSamplerWithIntegerMean() {
         testSharedStateSampler(34.0);
     }
 
diff --git a/commons-rng-sampling/src/test/java/org/apache/commons/rng/sampling/distribution/LevySamplerTest.java b/commons-rng-sampling/src/test/java/org/apache/commons/rng/sampling/distribution/LevySamplerTest.java
index 1d578f5..7b47bcb 100644
--- a/commons-rng-sampling/src/test/java/org/apache/commons/rng/sampling/distribution/LevySamplerTest.java
+++ b/commons-rng-sampling/src/test/java/org/apache/commons/rng/sampling/distribution/LevySamplerTest.java
@@ -27,12 +27,12 @@ import org.junit.jupiter.api.Test;
 /**
  * Test for the {@link LevySampler}.
  */
-public class LevySamplerTest {
+class LevySamplerTest {
     /**
      * Test the constructor with a negative scale.
      */
     @Test
-    public void testConstructorThrowsWithNegativeScale() {
+    void testConstructorThrowsWithNegativeScale() {
         final UniformRandomProvider rng = RandomSource.SPLIT_MIX_64.create(0L);
         final double location = 1;
         final double scale = -1e-6;
@@ -44,7 +44,7 @@ public class LevySamplerTest {
      * Test the constructor with a zero scale.
      */
     @Test
-    public void testConstructorThrowsWithZeroScale() {
+    void testConstructorThrowsWithZeroScale() {
         final UniformRandomProvider rng = RandomSource.SPLIT_MIX_64.create(0L);
         final double location = 1;
         final double scale = 0;
@@ -56,7 +56,7 @@ public class LevySamplerTest {
      * Test the SharedStateSampler implementation.
      */
     @Test
-    public void testSharedStateSampler() {
+    void testSharedStateSampler() {
         final UniformRandomProvider rng1 = RandomSource.SPLIT_MIX_64.create(0L);
         final UniformRandomProvider rng2 = RandomSource.SPLIT_MIX_64.create(0L);
         final double location = 4.56;
@@ -70,7 +70,7 @@ public class LevySamplerTest {
      * Test the support of the standard distribution is {@code [0, inf)}.
      */
     @Test
-    public void testSupport() {
+    void testSupport() {
         final double location = 0.0;
         final double scale = 1.0;
         // Force the underlying ZigguratSampler.NormalizedGaussian to create 0
diff --git a/commons-rng-sampling/src/test/java/org/apache/commons/rng/sampling/distribution/LogNormalSamplerTest.java b/commons-rng-sampling/src/test/java/org/apache/commons/rng/sampling/distribution/LogNormalSamplerTest.java
index 73d52fb..2b574e9 100644
--- a/commons-rng-sampling/src/test/java/org/apache/commons/rng/sampling/distribution/LogNormalSamplerTest.java
+++ b/commons-rng-sampling/src/test/java/org/apache/commons/rng/sampling/distribution/LogNormalSamplerTest.java
@@ -27,12 +27,12 @@ import org.junit.jupiter.api.Assertions;
 /**
  * Test for the {@link LogNormalSampler}. The tests hit edge cases for the sampler.
  */
-public class LogNormalSamplerTest {
+class LogNormalSamplerTest {
     /**
      * Test the constructor with a bad shape.
      */
     @Test
-    public void testConstructorThrowsWithNegativeScale() {
+    void testConstructorThrowsWithNegativeScale() {
         final RestorableUniformRandomProvider rng =
             RandomSource.SPLIT_MIX_64.create(0L);
         final NormalizedGaussianSampler gauss = ZigguratSampler.NormalizedGaussian.of(rng);
@@ -46,7 +46,7 @@ public class LogNormalSamplerTest {
      * Test the constructor with a bad shape.
      */
     @Test
-    public void testConstructorThrowsWithZeroShape() {
+    void testConstructorThrowsWithZeroShape() {
         final RestorableUniformRandomProvider rng =
             RandomSource.SPLIT_MIX_64.create(0L);
         final NormalizedGaussianSampler gauss = ZigguratSampler.NormalizedGaussian.of(rng);
@@ -60,7 +60,7 @@ public class LogNormalSamplerTest {
      * Test the SharedStateSampler implementation.
      */
     @Test
-    public void testSharedStateSampler() {
+    void testSharedStateSampler() {
         final UniformRandomProvider rng1 = RandomSource.SPLIT_MIX_64.create(0L);
         final UniformRandomProvider rng2 = RandomSource.SPLIT_MIX_64.create(0L);
         final NormalizedGaussianSampler gauss = ZigguratSampler.NormalizedGaussian.of(rng1);
@@ -77,7 +77,7 @@ public class LogNormalSamplerTest {
      * not a SharedStateSampler.
      */
     @Test
-    public void testSharedStateSamplerThrowsIfUnderlyingSamplerDoesNotShareState() {
+    void testSharedStateSamplerThrowsIfUnderlyingSamplerDoesNotShareState() {
         final UniformRandomProvider rng2 = RandomSource.SPLIT_MIX_64.create(0L);
         final NormalizedGaussianSampler gauss = new NormalizedGaussianSampler() {
             @Override
@@ -98,7 +98,7 @@ public class LogNormalSamplerTest {
      * a SharedStateSampler that returns an incorrect type.
      */
     @Test
-    public void testSharedStateSamplerThrowsIfUnderlyingSamplerReturnsWrongSharedState() {
+    void testSharedStateSamplerThrowsIfUnderlyingSamplerReturnsWrongSharedState() {
         final UniformRandomProvider rng2 = RandomSource.SPLIT_MIX_64.create(0L);
         final NormalizedGaussianSampler gauss = new BadSharedStateNormalizedGaussianSampler();
         final double scale = 1.23;
diff --git a/commons-rng-sampling/src/test/java/org/apache/commons/rng/sampling/distribution/MarsagliaNormalisedGaussianSamplerTest.java b/commons-rng-sampling/src/test/java/org/apache/commons/rng/sampling/distribution/MarsagliaNormalisedGaussianSamplerTest.java
index 99c53c0..125faa6 100644
--- a/commons-rng-sampling/src/test/java/org/apache/commons/rng/sampling/distribution/MarsagliaNormalisedGaussianSamplerTest.java
+++ b/commons-rng-sampling/src/test/java/org/apache/commons/rng/sampling/distribution/MarsagliaNormalisedGaussianSamplerTest.java
@@ -26,12 +26,12 @@ import org.junit.jupiter.api.Test;
 /**
  * Test for the {@link MarsagliaNormalizedGaussianSampler}.
  */
-public class MarsagliaNormalisedGaussianSamplerTest {
+class MarsagliaNormalisedGaussianSamplerTest {
     /**
      * Test the SharedStateSampler implementation.
      */
     @Test
-    public void testSharedStateSampler() {
+    void testSharedStateSampler() {
         final UniformRandomProvider rng1 = RandomSource.SPLIT_MIX_64.create(0L);
         final UniformRandomProvider rng2 = RandomSource.SPLIT_MIX_64.create(0L);
         final SharedStateContinuousSampler sampler1 =
@@ -45,7 +45,7 @@ public class MarsagliaNormalisedGaussianSamplerTest {
      * of the pair is outside the unit circle or lies on the origin.
      */
     @Test
-    public void testSamplePairIsRejected() {
+    void testSamplePairIsRejected() {
         final double value = 0.25;
         final UniformRandomProvider rng = new IntProvider() {
             private int i;
diff --git a/commons-rng-sampling/src/test/java/org/apache/commons/rng/sampling/distribution/MarsagliaTsangWangDiscreteSamplerTest.java b/commons-rng-sampling/src/test/java/org/apache/commons/rng/sampling/distribution/MarsagliaTsangWangDiscreteSamplerTest.java
index e8b3705..e839fb1 100644
--- a/commons-rng-sampling/src/test/java/org/apache/commons/rng/sampling/distribution/MarsagliaTsangWangDiscreteSamplerTest.java
+++ b/commons-rng-sampling/src/test/java/org/apache/commons/rng/sampling/distribution/MarsagliaTsangWangDiscreteSamplerTest.java
@@ -31,39 +31,39 @@ import org.junit.jupiter.api.Test;
  *
  * <p>Statistical testing of the sampler is performed using entries in {@link DiscreteSamplersList}.</p>
  */
-public class MarsagliaTsangWangDiscreteSamplerTest {
+class MarsagliaTsangWangDiscreteSamplerTest {
     @Test
-    public void testCreateDiscreteDistributionThrowsWithNullProbabilites() {
+    void testCreateDiscreteDistributionThrowsWithNullProbabilites() {
         assertEnumeratedSamplerConstructorThrows(null);
     }
 
     @Test
-    public void testCreateDiscreteDistributionThrowsWithZeroLengthProbabilites() {
+    void testCreateDiscreteDistributionThrowsWithZeroLengthProbabilites() {
         assertEnumeratedSamplerConstructorThrows(new double[0]);
     }
 
     @Test
-    public void testCreateDiscreteDistributionThrowsWithNegativeProbabilites() {
+    void testCreateDiscreteDistributionThrowsWithNegativeProbabilites() {
         assertEnumeratedSamplerConstructorThrows(new double[] {-1, 0.1, 0.2});
     }
 
     @Test
-    public void testCreateDiscreteDistributionThrowsWithNaNProbabilites() {
+    void testCreateDiscreteDistributionThrowsWithNaNProbabilites() {
         assertEnumeratedSamplerConstructorThrows(new double[] {0.1, Double.NaN, 0.2});
     }
 
     @Test
-    public void testCreateDiscreteDistributionThrowsWithInfiniteProbabilites() {
+    void testCreateDiscreteDistributionThrowsWithInfiniteProbabilites() {
         assertEnumeratedSamplerConstructorThrows(new double[] {0.1, Double.POSITIVE_INFINITY, 0.2});
     }
 
     @Test
-    public void testCreateDiscreteDistributionThrowsWithInfiniteSumProbabilites() {
+    void testCreateDiscreteDistributionThrowsWithInfiniteSumProbabilites() {
         assertEnumeratedSamplerConstructorThrows(new double[] {Double.MAX_VALUE, Double.MAX_VALUE});
     }
 
     @Test
-    public void testCreateDiscreteDistributionThrowsWithZeroSumProbabilites() {
+    void testCreateDiscreteDistributionThrowsWithZeroSumProbabilites() {
         assertEnumeratedSamplerConstructorThrows(new double[4]);
     }
 
@@ -82,7 +82,7 @@ public class MarsagliaTsangWangDiscreteSamplerTest {
      * Test the {@link Object#toString()} method contains the algorithm author names.
      */
     @Test
-    public void testToString() {
+    void testToString() {
         final UniformRandomProvider rng = new SplitMix64(0L);
         final DiscreteSampler sampler = MarsagliaTsangWangDiscreteSampler.Enumerated.of(rng, new double[] {0.5, 0.5});
         String text = sampler.toString();
@@ -98,7 +98,7 @@ public class MarsagliaTsangWangDiscreteSamplerTest {
      * storage using different offsets to control the maximum sample value.
      */
     @Test
-    public void testOffsetSamples() {
+    void testOffsetSamples() {
         // This is filled with probabilities to hit all edge cases in the fill procedure.
         // The probabilities must have a digit from each of the 5 possible.
         final int[] prob = new int[6];
@@ -180,7 +180,7 @@ public class MarsagliaTsangWangDiscreteSamplerTest {
      * Test samples from a distribution expressed using {@code double} probabilities.
      */
     @Test
-    public void testRealProbabilityDistributionSamples() {
+    void testRealProbabilityDistributionSamples() {
         // These do not have to sum to 1
         final double[] probabilities = new double[11];
         final UniformRandomProvider rng = RandomSource.SPLIT_MIX_64.create();
@@ -213,7 +213,7 @@ public class MarsagliaTsangWangDiscreteSamplerTest {
      * limits described in the class Javadoc is correct.
      */
     @Test
-    public void testStorageRequirements8() {
+    void testStorageRequirements8() {
         // Max digits from 2^22:
         // (2^4 + 2^6 + 2^6 + 2^6)
         // Storage in bytes
@@ -228,7 +228,7 @@ public class MarsagliaTsangWangDiscreteSamplerTest {
      * limits described in the class Javadoc is correct.
      */
     @Test
-    public void testStorageRequirements16() {
+    void testStorageRequirements16() {
         // Max digits from 2^14:
         // (2^2 + 2^6 + 2^6)
         // Storage in bytes
@@ -297,7 +297,7 @@ public class MarsagliaTsangWangDiscreteSamplerTest {
      * Test the Poisson distribution with a bad mean that is above the supported range.
      */
     @Test
-    public void testCreatePoissonDistributionThrowsWithMeanLargerThanUpperBound() {
+    void testCreatePoissonDistributionThrowsWithMeanLargerThanUpperBound() {
         final UniformRandomProvider rng = new FixedRNG();
         final double mean = 1025;
         Assertions.assertThrows(IllegalArgumentException.class,
@@ -308,7 +308,7 @@ public class MarsagliaTsangWangDiscreteSamplerTest {
      * Test the Poisson distribution with a bad mean that is below the supported range.
      */
     @Test
-    public void testCreatePoissonDistributionThrowsWithZeroMean() {
+    void testCreatePoissonDistributionThrowsWithZeroMean() {
         final UniformRandomProvider rng = new FixedRNG();
         final double mean = 0;
         Assertions.assertThrows(IllegalArgumentException.class,
@@ -319,7 +319,7 @@ public class MarsagliaTsangWangDiscreteSamplerTest {
      * Test the Poisson distribution with the maximum mean.
      */
     @Test
-    public void testCreatePoissonDistributionWithMaximumMean() {
+    void testCreatePoissonDistributionWithMaximumMean() {
         final UniformRandomProvider rng = new FixedRNG();
         final double mean = 1024;
         final DiscreteSampler sampler = MarsagliaTsangWangDiscreteSampler.Poisson.of(rng, mean);
@@ -333,7 +333,7 @@ public class MarsagliaTsangWangDiscreteSamplerTest {
      * probability sum is not 2^30.
      */
     @Test
-    public void testCreatePoissonDistributionWithSmallMean() {
+    void testCreatePoissonDistributionWithSmallMean() {
         final UniformRandomProvider rng = new FixedRNG();
         final double mean = 0.25;
         final DiscreteSampler sampler = MarsagliaTsangWangDiscreteSampler.Poisson.of(rng, mean);
@@ -348,7 +348,7 @@ public class MarsagliaTsangWangDiscreteSamplerTest {
      * where the loop from the mean decrements to reach zero.
      */
     @Test
-    public void testCreatePoissonDistributionWithMediumMean() {
+    void testCreatePoissonDistributionWithMediumMean() {
         final UniformRandomProvider rng = new FixedRNG();
         final double mean = 21.4;
         final DiscreteSampler sampler = MarsagliaTsangWangDiscreteSampler.Poisson.of(rng, mean);
@@ -361,7 +361,7 @@ public class MarsagliaTsangWangDiscreteSamplerTest {
      * Test the Binomial distribution with a bad number of trials.
      */
     @Test
-    public void testCreateBinomialDistributionThrowsWithTrialsBelow0() {
+    void testCreateBinomialDistributionThrowsWithTrialsBelow0() {
         final UniformRandomProvider rng = new FixedRNG();
         final int trials = -1;
         final double p = 0.5;
@@ -373,7 +373,7 @@ public class MarsagliaTsangWangDiscreteSamplerTest {
      * Test the Binomial distribution with an unsupported number of trials.
      */
     @Test
-    public void testCreateBinomialDistributionThrowsWithTrialsAboveMax() {
+    void testCreateBinomialDistributionThrowsWithTrialsAboveMax() {
         final UniformRandomProvider rng = new FixedRNG();
         final int trials = 1 << 16; // 2^16
         final double p = 0.5;
@@ -385,7 +385,7 @@ public class MarsagliaTsangWangDiscreteSamplerTest {
      * Test the Binomial distribution with probability {@code < 0}.
      */
     @Test
-    public void testCreateBinomialDistributionThrowsWithProbabilityBelow0() {
+    void testCreateBinomialDistributionThrowsWithProbabilityBelow0() {
         final UniformRandomProvider rng = new FixedRNG();
         final int trials = 1;
         final double p = -0.5;
@@ -397,7 +397,7 @@ public class MarsagliaTsangWangDiscreteSamplerTest {
      * Test the Binomial distribution with probability {@code > 1}.
      */
     @Test
-    public void testCreateBinomialDistributionThrowsWithProbabilityAbove1() {
+    void testCreateBinomialDistributionThrowsWithProbabilityAbove1() {
         final UniformRandomProvider rng = new FixedRNG();
         final int trials = 1;
         final double p = 1.5;
@@ -410,7 +410,7 @@ public class MarsagliaTsangWangDiscreteSamplerTest {
      * with a high probability of success.
      */
     @Test
-    public void testCreateBinomialDistributionWithSmallestP0ValueAndHighestProbabilityOfSuccess() {
+    void testCreateBinomialDistributionWithSmallestP0ValueAndHighestProbabilityOfSuccess() {
         final UniformRandomProvider rng = new FixedRNG();
         // p(0) = Math.exp(trials * Math.log(1-p))
         // p(0) will be smaller as Math.log(1-p) is more negative, which occurs when p is
@@ -436,7 +436,7 @@ public class MarsagliaTsangWangDiscreteSamplerTest {
      * that is zero (thus the distribution cannot be computed).
      */
     @Test
-    public void testCreateBinomialDistributionThrowsWhenP0IsZero() {
+    void testCreateBinomialDistributionThrowsWhenP0IsZero() {
         final UniformRandomProvider rng = new FixedRNG();
         // As above but increase the trials so p(0) should be zero
         final int trials = 1 + (int) Math.floor(Math.log(Double.MIN_VALUE) / Math.log(0.5));
@@ -452,7 +452,7 @@ public class MarsagliaTsangWangDiscreteSamplerTest {
      * with a high number of trials.
      */
     @Test
-    public void testCreateBinomialDistributionWithLargestTrialsAndSmallestProbabilityOfSuccess() {
+    void testCreateBinomialDistributionWithLargestTrialsAndSmallestProbabilityOfSuccess() {
         final UniformRandomProvider rng = new FixedRNG();
         // p(0) = Math.exp(trials * Math.log(1-p))
         // p(0) will be smaller as Math.log(1-p) is more negative, which occurs when p is
@@ -507,7 +507,7 @@ public class MarsagliaTsangWangDiscreteSamplerTest {
      * Test the Binomial distribution with a probability of 0 where the sampler should equal 0.
      */
     @Test
-    public void testCreateBinomialDistributionWithProbability0() {
+    void testCreateBinomialDistributionWithProbability0() {
         final UniformRandomProvider rng = new FixedRNG();
         final int trials = 1000000;
         final double p = 0;
@@ -524,7 +524,7 @@ public class MarsagliaTsangWangDiscreteSamplerTest {
      * the number of trials.
      */
     @Test
-    public void testCreateBinomialDistributionWithProbability1() {
+    void testCreateBinomialDistributionWithProbability1() {
         final UniformRandomProvider rng = new FixedRNG();
         final int trials = 1000000;
         final double p = 1;
@@ -542,7 +542,7 @@ public class MarsagliaTsangWangDiscreteSamplerTest {
      * could be used instead.
      */
     @Test
-    public void testCreateBinomialDistributionWithLargeNumberOfTrials() {
+    void testCreateBinomialDistributionWithLargeNumberOfTrials() {
         final UniformRandomProvider rng = new FixedRNG();
         final int trials = 65000;
         final double p = 0.01;
@@ -557,7 +557,7 @@ public class MarsagliaTsangWangDiscreteSamplerTest {
      * search for the last probability of the Binomial distribution.
      */
     @Test
-    public void testCreateBinomialDistributionWithProbability50Percent() {
+    void testCreateBinomialDistributionWithProbability50Percent() {
         final UniformRandomProvider rng = new FixedRNG();
         final int trials = 10;
         final double p = 0.5;
@@ -572,7 +572,7 @@ public class MarsagliaTsangWangDiscreteSamplerTest {
      * {@link Object#toString()}.
      */
     @Test
-    public void testBinomialSamplerToString() {
+    void testBinomialSamplerToString() {
         final UniformRandomProvider rng = new FixedRNG();
         final int trials = 10;
         final double p1 = 0.4;
@@ -586,7 +586,7 @@ public class MarsagliaTsangWangDiscreteSamplerTest {
      * Test the SharedStateSampler implementation with the 8-bit storage implementation.
      */
     @Test
-    public void testSharedStateSamplerWith8bitStorage() {
+    void testSharedStateSamplerWith8bitStorage() {
         testSharedStateSampler(0, new int[] {1, 2, 3, 4, 5});
     }
 
@@ -594,7 +594,7 @@ public class MarsagliaTsangWangDiscreteSamplerTest {
      * Test the SharedStateSampler implementation with the 16-bit storage implementation.
      */
     @Test
-    public void testSharedStateSamplerWith16bitStorage() {
+    void testSharedStateSamplerWith16bitStorage() {
         testSharedStateSampler(1 << 8, new int[] {1, 2, 3, 4, 5});
     }
 
@@ -602,7 +602,7 @@ public class MarsagliaTsangWangDiscreteSamplerTest {
      * Test the SharedStateSampler implementation with the 32-bit storage implementation.
      */
     @Test
-    public void testSharedStateSamplerWith32bitStorage() {
+    void testSharedStateSamplerWith32bitStorage() {
         testSharedStateSampler(1 << 16, new int[] {1, 2, 3, 4, 5});
     }
 
@@ -627,7 +627,7 @@ public class MarsagliaTsangWangDiscreteSamplerTest {
      * Test the SharedStateSampler implementation with a Binomial distribution with a fixed result.
      */
     @Test
-    public void testSharedStateSamplerWithFixedBinomialDistribution() {
+    void testSharedStateSamplerWithFixedBinomialDistribution() {
         testSharedStateSampler(10, 1.0);
     }
 
@@ -636,7 +636,7 @@ public class MarsagliaTsangWangDiscreteSamplerTest {
      * inversion (probability of success > 0.5).
      */
     @Test
-    public void testSharedStateSamplerWithInvertedBinomialDistribution() {
+    void testSharedStateSamplerWithInvertedBinomialDistribution() {
         testSharedStateSampler(10, 0.999);
     }
 
diff --git a/commons-rng-sampling/src/test/java/org/apache/commons/rng/sampling/distribution/PoissonSamplerCacheTest.java b/commons-rng-sampling/src/test/java/org/apache/commons/rng/sampling/distribution/PoissonSamplerCacheTest.java
index c605968..47a6f48 100644
--- a/commons-rng-sampling/src/test/java/org/apache/commons/rng/sampling/distribution/PoissonSamplerCacheTest.java
+++ b/commons-rng-sampling/src/test/java/org/apache/commons/rng/sampling/distribution/PoissonSamplerCacheTest.java
@@ -26,7 +26,7 @@ import org.junit.jupiter.api.Test;
  * constructor of the {@link PoissonSampler}, irrespective of the range
  * covered by the cache.
  */
-public class PoissonSamplerCacheTest {
+class PoissonSamplerCacheTest {
 
     // Set a range so that the SmallMeanPoissonSampler is also required.
 
@@ -42,7 +42,7 @@ public class PoissonSamplerCacheTest {
      * This mean is the same level as the algorithm switch point in the PoissonSampler.
      */
     @Test
-    public void testMinimumCachedMean() {
+    void testMinimumCachedMean() {
         Assertions.assertEquals(PoissonSampler.PIVOT, PoissonSamplerCache.getMinimumCachedMean());
     }
 
@@ -54,7 +54,7 @@ public class PoissonSamplerCacheTest {
      * of the SmallMeanPoissonSampler.
      */
     @Test
-    public void testConstructorWithNoCache() {
+    void testConstructorWithNoCache() {
         final double min = 0;
         final double max = PoissonSampler.PIVOT - 2;
         final PoissonSamplerCache cache = createPoissonSamplerCache(min, max);
@@ -69,7 +69,7 @@ public class PoissonSamplerCacheTest {
      * in the range {@code n <= mean < n+1}.
      */
     @Test
-    public void testConstructorWhenMaxEqualsMin() {
+    void testConstructorWhenMaxEqualsMin() {
         final double min = PoissonSampler.PIVOT + 2;
         final double max = min;
         final PoissonSamplerCache cache = createPoissonSamplerCache(min, max);
@@ -85,7 +85,7 @@ public class PoissonSamplerCacheTest {
      * in the range {@code n <= mean < n+1}.
      */
     @Test
-    public void testConstructorWhenMaxAboveMin() {
+    void testConstructorWhenMaxAboveMin() {
         final double min = PoissonSampler.PIVOT + 2;
         final double max = min + 10;
         final PoissonSamplerCache cache = createPoissonSamplerCache(min, max);
@@ -99,7 +99,7 @@ public class PoissonSamplerCacheTest {
      * Test the cache requires a range with {@code max >= min}.
      */
     @Test
-    public void testConstructorThrowsWhenMaxIsLessThanMin() {
+    void testConstructorThrowsWhenMaxIsLessThanMin() {
         final double min = PoissonSampler.PIVOT;
         final double max = Math.nextDown(min);
         Assertions.assertThrows(IllegalArgumentException.class,
@@ -111,7 +111,7 @@ public class PoissonSamplerCacheTest {
      * In this case the range is truncated to 0.
      */
     @Test
-    public void testConstructorWhenMinBelow0() {
+    void testConstructorWhenMinBelow0() {
         final double min = -1;
         final double max = PoissonSampler.PIVOT + 2;
         final PoissonSamplerCache cache = createPoissonSamplerCache(min, max);
@@ -126,7 +126,7 @@ public class PoissonSamplerCacheTest {
      * In this case the range is truncated to 0, i.e. no cache.
      */
     @Test
-    public void testConstructorWhenMaxBelow0() {
+    void testConstructorWhenMaxBelow0() {
         final double min = -10;
         final double max = -1;
         final PoissonSamplerCache cache = createPoissonSamplerCache(min, max);
@@ -141,7 +141,7 @@ public class PoissonSamplerCacheTest {
      * of the SmallMeanPoissonSampler.
      */
     @Test
-    public void testWithRangeConstructorWithNoCache() {
+    void testWithRangeConstructorWithNoCache() {
         final double min = 0;
         final double max = PoissonSampler.PIVOT - 2;
         final PoissonSamplerCache cache = createPoissonSamplerCache().withRange(min, max);
@@ -156,7 +156,7 @@ public class PoissonSamplerCacheTest {
      * in the range {@code n <= mean < n+1}.
      */
     @Test
-    public void testWithRangeConstructorWhenMaxEqualsMin() {
+    void testWithRangeConstructorWhenMaxEqualsMin() {
         final double min = PoissonSampler.PIVOT + 2;
         final double max = min;
         final PoissonSamplerCache cache = createPoissonSamplerCache().withRange(min, max);
@@ -172,7 +172,7 @@ public class PoissonSamplerCacheTest {
      * in the range {@code n <= mean < n+1}.
      */
     @Test
-    public void testWithRangeConstructorWhenMaxAboveMin() {
+    void testWithRangeConstructorWhenMaxAboveMin() {
         final double min = PoissonSampler.PIVOT + 2;
         final double max = min + 10;
         final PoissonSamplerCache cache = createPoissonSamplerCache().withRange(min, max);
@@ -186,7 +186,7 @@ public class PoissonSamplerCacheTest {
      * Test the cache requires a range with {@code max >= min}.
      */
     @Test
-    public void testWithRangeConstructorThrowsWhenMaxIsLessThanMin() {
+    void testWithRangeConstructorThrowsWhenMaxIsLessThanMin() {
         final double min = PoissonSampler.PIVOT;
         final double max = Math.nextDown(min);
         Assertions.assertThrows(IllegalArgumentException.class,
@@ -198,7 +198,7 @@ public class PoissonSamplerCacheTest {
      * In this case the range is truncated to 0.
      */
     @Test
-    public void testWithRangeConstructorWhenMinBelow0() {
+    void testWithRangeConstructorWhenMinBelow0() {
         final double min = -1;
         final double max = PoissonSampler.PIVOT + 2;
         final PoissonSamplerCache cache = createPoissonSamplerCache().withRange(min, max);
@@ -212,7 +212,7 @@ public class PoissonSamplerCacheTest {
      * Test the cache can be created from a cache with no capacity.
      */
     @Test
-    public void testWithRangeConstructorWhenCacheHasNoCapcity() {
+    void testWithRangeConstructorWhenCacheHasNoCapcity() {
         final double min = PoissonSampler.PIVOT + 2;
         final double max = min + 10;
         final PoissonSamplerCache cache = createPoissonSamplerCache(0, 0).withRange(min, max);
@@ -227,7 +227,7 @@ public class PoissonSamplerCacheTest {
      * cost is minimal.
      */
     @Test
-    public void testWithinRange() {
+    void testWithinRange() {
         final double min = PoissonSampler.PIVOT + 10;
         final double max = PoissonSampler.PIVOT + 20;
         final PoissonSamplerCache cache = createPoissonSamplerCache(min, max);
@@ -247,7 +247,7 @@ public class PoissonSamplerCacheTest {
      * <p>Note this test actually tests the SmallMeanPoissonSampler throws.
      */
     @Test
-    public void testCreateSharedStateSamplerThrowsWithZeroMean() {
+    void testCreateSharedStateSamplerThrowsWithZeroMean() {
         final RestorableUniformRandomProvider rng =
                 RandomSource.SPLIT_MIX_64.create(0L);
         final PoissonSamplerCache cache = createPoissonSamplerCache();
@@ -259,7 +259,7 @@ public class PoissonSamplerCacheTest {
      * Test createSharedStateSampler() with a mean that is too large.
      */
     @Test
-    public void testCreateSharedStateSamplerThrowsWithNonIntegerMean() {
+    void testCreateSharedStateSamplerThrowsWithNonIntegerMean() {
         final RestorableUniformRandomProvider rng =
                 RandomSource.SPLIT_MIX_64.create(0L);
         final PoissonSamplerCache cache = createPoissonSamplerCache();
@@ -275,7 +275,7 @@ public class PoissonSamplerCacheTest {
      * covers the entire range.
      */
     @Test
-    public void testCanComputeSameSamplesAsPoissonSamplerWithFullRangeCache() {
+    void testCanComputeSameSamplesAsPoissonSamplerWithFullRangeCache() {
         checkComputeSameSamplesAsPoissonSampler(minRange,
                                                 maxRange);
     }
@@ -285,7 +285,7 @@ public class PoissonSamplerCacheTest {
      * with no cache.
      */
     @Test
-    public void testCanComputeSameSamplesAsPoissonSamplerWithNoCache() {
+    void testCanComputeSameSamplesAsPoissonSamplerWithNoCache() {
         checkComputeSameSamplesAsPoissonSampler(0,
                                                 minRange - 2);
     }
@@ -295,7 +295,7 @@ public class PoissonSamplerCacheTest {
      * partial cache covering the lower range.
      */
     @Test
-    public void testCanComputeSameSamplesAsPoissonSamplerWithPartialCacheCoveringLowerRange() {
+    void testCanComputeSameSamplesAsPoissonSamplerWithPartialCacheCoveringLowerRange() {
         checkComputeSameSamplesAsPoissonSampler(minRange,
                                                 midRange);
     }
@@ -305,7 +305,7 @@ public class PoissonSamplerCacheTest {
      * partial cache covering the upper range.
      */
     @Test
-    public void testCanComputeSameSamplesAsPoissonSamplerWithPartialCacheCoveringUpperRange() {
+    void testCanComputeSameSamplesAsPoissonSamplerWithPartialCacheCoveringUpperRange() {
         checkComputeSameSamplesAsPoissonSampler(midRange,
                                                 maxRange);
     }
@@ -315,7 +315,7 @@ public class PoissonSamplerCacheTest {
      * cache above the upper range.
      */
     @Test
-    public void testCanComputeSameSamplesAsPoissonSamplerWithCacheAboveTheUpperRange() {
+    void testCanComputeSameSamplesAsPoissonSamplerWithCacheAboveTheUpperRange() {
         checkComputeSameSamplesAsPoissonSampler(maxRange + 10,
                                                 maxRange + 20);
     }
@@ -397,7 +397,7 @@ public class PoissonSamplerCacheTest {
      * a new cache reusing the entire range.
      */
     @Test
-    public void testCanComputeSameSamplesAsPoissonSamplerReusingCacheEntireRange() {
+    void testCanComputeSameSamplesAsPoissonSamplerReusingCacheEntireRange() {
         checkComputeSameSamplesAsPoissonSamplerReusingCache(midRange,
                                                             maxRange,
                                                             midRange,
@@ -409,7 +409,7 @@ public class PoissonSamplerCacheTest {
      * a new cache reusing none of the range.
      */
     @Test
-    public void testCanComputeSameSamplesAsPoissonSamplerReusingCacheNoRange() {
+    void testCanComputeSameSamplesAsPoissonSamplerReusingCacheNoRange() {
         checkComputeSameSamplesAsPoissonSamplerReusingCache(midRange,
                                                             maxRange,
                                                             maxRange + 10,
@@ -421,7 +421,7 @@ public class PoissonSamplerCacheTest {
      * a new cache reusing some of the lower range.
      */
     @Test
-    public void testCanComputeSameSamplesAsPoissonSamplerReusingCacheLowerRange() {
+    void testCanComputeSameSamplesAsPoissonSamplerReusingCacheLowerRange() {
         checkComputeSameSamplesAsPoissonSamplerReusingCache(midRange,
                                                             maxRange,
                                                             minRange,
@@ -433,7 +433,7 @@ public class PoissonSamplerCacheTest {
      * a new cache reusing some of the upper range.
      */
     @Test
-    public void testCanComputeSameSamplesAsPoissonSamplerReusingCacheUpperRange() {
+    void testCanComputeSameSamplesAsPoissonSamplerReusingCacheUpperRange() {
         checkComputeSameSamplesAsPoissonSamplerReusingCache(midRange,
                                                             maxRange,
                                                             maxRange - 1,
@@ -490,7 +490,7 @@ public class PoissonSamplerCacheTest {
      */
     @SuppressWarnings("deprecation")
     @Test
-    public void testCreatePoissonSampler() {
+    void testCreatePoissonSampler() {
         final PoissonSamplerCache cache = createPoissonSamplerCache(0, 100);
         final DiscreteSampler s2 = cache.createPoissonSampler(null, 42);
         Assertions.assertTrue(s2 instanceof LargeMeanPoissonSampler);
diff --git a/commons-rng-sampling/src/test/java/org/apache/commons/rng/sampling/distribution/PoissonSamplerTest.java b/commons-rng-sampling/src/test/java/org/apache/commons/rng/sampling/distribution/PoissonSamplerTest.java
index 0def459..e7d4bc6 100644
--- a/commons-rng-sampling/src/test/java/org/apache/commons/rng/sampling/distribution/PoissonSamplerTest.java
+++ b/commons-rng-sampling/src/test/java/org/apache/commons/rng/sampling/distribution/PoissonSamplerTest.java
@@ -27,12 +27,12 @@ import org.junit.jupiter.api.Test;
  * This test checks the {@link PoissonSampler} can be created
  * from a saved state.
  */
-public class PoissonSamplerTest {
+class PoissonSamplerTest {
     /**
      * Test the SharedStateSampler implementation with a mean below 40.
      */
     @Test
-    public void testSharedStateSamplerWithSmallMean() {
+    void testSharedStateSamplerWithSmallMean() {
         testSharedStateSampler(34.5);
     }
 
@@ -40,7 +40,7 @@ public class PoissonSamplerTest {
      * Test the SharedStateSampler implementation with a mean above 40.
      */
     @Test
-    public void testSharedStateSamplerWithLargeMean() {
+    void testSharedStateSamplerWithLargeMean() {
         testSharedStateSampler(67.8);
     }
 
@@ -64,7 +64,7 @@ public class PoissonSamplerTest {
      * used in other tests does not create an instance of the wrapper class.
      */
     @Test
-    public void testToString() {
+    void testToString() {
         final UniformRandomProvider rng = RandomSource.SPLIT_MIX_64.create(0L);
         Assertions.assertTrue(new PoissonSampler(rng, 1.23).toString().toLowerCase().contains("poisson"));
     }
diff --git a/commons-rng-sampling/src/test/java/org/apache/commons/rng/sampling/distribution/RejectionInversionZipfSamplerTest.java b/commons-rng-sampling/src/test/java/org/apache/commons/rng/sampling/distribution/RejectionInversionZipfSamplerTest.java
index 9e640af..32bb835 100644
--- a/commons-rng-sampling/src/test/java/org/apache/commons/rng/sampling/distribution/RejectionInversionZipfSamplerTest.java
+++ b/commons-rng-sampling/src/test/java/org/apache/commons/rng/sampling/distribution/RejectionInversionZipfSamplerTest.java
@@ -26,12 +26,12 @@ import org.junit.jupiter.api.Assertions;
 /**
  * Test for the {@link RejectionInversionZipfSampler}. The tests hit edge cases for the sampler.
  */
-public class RejectionInversionZipfSamplerTest {
+class RejectionInversionZipfSamplerTest {
     /**
      * Test the constructor with a bad number of elements.
      */
     @Test
-    public void testConstructorThrowsWithZeroNumberOfElements() {
+    void testConstructorThrowsWithZeroNumberOfElements() {
         final RestorableUniformRandomProvider rng =
             RandomSource.SPLIT_MIX_64.create(0L);
         final int numberOfElements = 0;
@@ -44,7 +44,7 @@ public class RejectionInversionZipfSamplerTest {
      * Test the constructor with a bad exponent.
      */
     @Test
-    public void testConstructorThrowsWithZeroExponent() {
+    void testConstructorThrowsWithZeroExponent() {
         final RestorableUniformRandomProvider rng =
             RandomSource.SPLIT_MIX_64.create(0L);
         final int numberOfElements = 1;
@@ -57,7 +57,7 @@ public class RejectionInversionZipfSamplerTest {
      * Test the SharedStateSampler implementation.
      */
     @Test
-    public void testSharedStateSampler() {
+    void testSharedStateSampler() {
         final UniformRandomProvider rng1 = RandomSource.SPLIT_MIX_64.create(0L);
         final UniformRandomProvider rng2 = RandomSource.SPLIT_MIX_64.create(0L);
         final int numberOfElements = 7;
diff --git a/commons-rng-sampling/src/test/java/org/apache/commons/rng/sampling/distribution/SamplerBaseTest.java b/commons-rng-sampling/src/test/java/org/apache/commons/rng/sampling/distribution/SamplerBaseTest.java
index 52018e4..b5e64e5 100644
--- a/commons-rng-sampling/src/test/java/org/apache/commons/rng/sampling/distribution/SamplerBaseTest.java
+++ b/commons-rng-sampling/src/test/java/org/apache/commons/rng/sampling/distribution/SamplerBaseTest.java
@@ -25,7 +25,7 @@ import org.junit.jupiter.api.Test;
  * Test for the {@link SamplerBase}. The class is deprecated but is public. The methods
  * should be tested to ensure correct functionality.
  */
-public class SamplerBaseTest {
+class SamplerBaseTest {
     /**
      * Extends the {@link SamplerBase} to allow access to methods.
      */
@@ -57,7 +57,7 @@ public class SamplerBaseTest {
     }
 
     @Test
-    public void testNextMethods() {
+    void testNextMethods() {
         final UniformRandomProvider rng1 = RandomSource.SPLIT_MIX_64.create(0L);
         final UniformRandomProvider rng2 = RandomSource.SPLIT_MIX_64.create(0L);
         final SimpleSampler sampler = new SimpleSampler(rng2);
@@ -71,7 +71,7 @@ public class SamplerBaseTest {
     }
 
     @Test
-    public void testToString() {
+    void testToString() {
         final UniformRandomProvider rng = RandomSource.SPLIT_MIX_64.create(0L);
         final SimpleSampler sampler = new SimpleSampler(rng);
         Assertions.assertTrue(sampler.toString().contains("rng"));
diff --git a/commons-rng-sampling/src/test/java/org/apache/commons/rng/sampling/distribution/SmallMeanPoissonSamplerTest.java b/commons-rng-sampling/src/test/java/org/apache/commons/rng/sampling/distribution/SmallMeanPoissonSamplerTest.java
index 37de4ea..0667047 100644
--- a/commons-rng-sampling/src/test/java/org/apache/commons/rng/sampling/distribution/SmallMeanPoissonSamplerTest.java
+++ b/commons-rng-sampling/src/test/java/org/apache/commons/rng/sampling/distribution/SmallMeanPoissonSamplerTest.java
@@ -25,12 +25,12 @@ import org.junit.jupiter.api.Test;
 /**
  * Test for the {@link SmallMeanPoissonSampler}. The tests hit edge cases for the sampler.
  */
-public class SmallMeanPoissonSamplerTest {
+class SmallMeanPoissonSamplerTest {
     /**
      * Test the constructor with a bad mean.
      */
     @Test
-    public void testConstructorThrowsWithMeanThatSetsProbabilityP0ToZero() {
+    void testConstructorThrowsWithMeanThatSetsProbabilityP0ToZero() {
         final UniformRandomProvider rng =
             RandomSource.SPLIT_MIX_64.create(0L);
         final double p0 = Double.MIN_VALUE;
@@ -45,7 +45,7 @@ public class SmallMeanPoissonSamplerTest {
      * Test the constructor with a bad mean.
      */
     @Test
-    public void testConstructorThrowsWithZeroMean() {
+    void testConstructorThrowsWithZeroMean() {
         final UniformRandomProvider rng =
             RandomSource.SPLIT_MIX_64.create(0L);
         final double mean = 0;
@@ -57,7 +57,7 @@ public class SmallMeanPoissonSamplerTest {
      * Test the sample is bounded to 1000 * mean.
      */
     @Test
-    public void testSampleUpperBounds() {
+    void testSampleUpperBounds() {
         // If the nextDouble() is always 1 then the sample will hit the upper bounds
         final UniformRandomProvider rng = new UniformRandomProvider() {
             // CHECKSTYLE: stop all
@@ -83,7 +83,7 @@ public class SmallMeanPoissonSamplerTest {
      * Test the SharedStateSampler implementation.
      */
     @Test
-    public void testSharedStateSampler() {
+    void testSharedStateSampler() {
         final UniformRandomProvider rng1 = RandomSource.SPLIT_MIX_64.create(0L);
         final UniformRandomProvider rng2 = RandomSource.SPLIT_MIX_64.create(0L);
         final double mean = 1.23;
diff --git a/commons-rng-sampling/src/test/java/org/apache/commons/rng/sampling/distribution/StableSamplerTest.java b/commons-rng-sampling/src/test/java/org/apache/commons/rng/sampling/distribution/StableSamplerTest.java
index b5c2399..fffe119 100644
--- a/commons-rng-sampling/src/test/java/org/apache/commons/rng/sampling/distribution/StableSamplerTest.java
+++ b/commons-rng-sampling/src/test/java/org/apache/commons/rng/sampling/distribution/StableSamplerTest.java
@@ -49,7 +49,7 @@ import org.apache.commons.rng.simple.RandomSource;
  * extreme values for the random deviates. This hits edges cases where the computation has
  * to be corrected.
  */
-public class StableSamplerTest {
+class StableSamplerTest {
     /** pi / 2. */
     private static final double PI_2 = Math.PI / 2;
     /** pi / 4. */
@@ -74,17 +74,17 @@ public class StableSamplerTest {
     private static final double VALID_DELTA = 3.45;
 
     @Test
-    public void testAlphaZeroThrows() {
+    void testAlphaZeroThrows() {
         assertConstructorThrows(0.0, VALID_BETA, VALID_GAMMA, VALID_DELTA);
     }
 
     @Test
-    public void testAlphaBelowZeroThrows() {
+    void testAlphaBelowZeroThrows() {
         assertConstructorThrows(Math.nextDown(0.0), VALID_BETA, VALID_GAMMA, VALID_DELTA);
     }
 
     @Test
-    public void testAlphaTooCloseToZeroThrows() {
+    void testAlphaTooCloseToZeroThrows() {
         // The realistic range for alpha is not Double.MIN_VALUE.
         // The number 1 - alpha must not be 1.
         // This is valid
@@ -102,57 +102,57 @@ public class StableSamplerTest {
     }
 
     @Test
-    public void testAlphaAboveTwoThrows() {
+    void testAlphaAboveTwoThrows() {
         assertConstructorThrows(Math.nextUp(2.0), VALID_BETA, VALID_GAMMA, VALID_DELTA);
     }
 
     @Test
-    public void testAlphaNaNThrows() {
+    void testAlphaNaNThrows() {
         assertConstructorThrows(Double.NaN, VALID_BETA, VALID_GAMMA, VALID_DELTA);
     }
 
     @Test
-    public void testBetaBelowMinusOneThrows() {
+    void testBetaBelowMinusOneThrows() {
         assertConstructorThrows(VALID_ALPHA, Math.nextDown(-1.0), VALID_GAMMA, VALID_DELTA);
     }
 
     @Test
-    public void testBetaAboveOneThrows() {
+    void testBetaAboveOneThrows() {
         assertConstructorThrows(VALID_ALPHA, Math.nextUp(1.0), VALID_GAMMA, VALID_DELTA);
     }
 
     @Test
-    public void testBetaNaNThrows() {
+    void testBetaNaNThrows() {
         assertConstructorThrows(VALID_ALPHA, Double.NaN, VALID_GAMMA, VALID_DELTA);
     }
 
     @Test
-    public void testGammaNotStrictlyPositiveThrows() {
+    void testGammaNotStrictlyPositiveThrows() {
         assertConstructorThrows(VALID_ALPHA, VALID_BETA, 0.0, VALID_DELTA);
     }
 
     @Test
-    public void testGammaInfThrows() {
+    void testGammaInfThrows() {
         assertConstructorThrows(VALID_ALPHA, VALID_BETA, Double.POSITIVE_INFINITY, VALID_DELTA);
     }
 
     @Test
-    public void testGammaNaNThrows() {
+    void testGammaNaNThrows() {
         assertConstructorThrows(VALID_ALPHA, VALID_BETA, Double.NaN, VALID_DELTA);
     }
 
     @Test
-    public void testDeltaInfThrows() {
+    void testDeltaInfThrows() {
         assertConstructorThrows(VALID_ALPHA, VALID_BETA, VALID_GAMMA, Double.POSITIVE_INFINITY);
     }
 
     @Test
-    public void testDeltaNegInfThrows() {
+    void testDeltaNegInfThrows() {
         assertConstructorThrows(VALID_ALPHA, VALID_BETA, VALID_GAMMA, Double.NEGATIVE_INFINITY);
     }
 
     @Test
-    public void testDeltaNaNThrows() {
+    void testDeltaNaNThrows() {
         assertConstructorThrows(VALID_ALPHA, VALID_BETA, VALID_GAMMA, Double.NaN);
     }
 
@@ -180,7 +180,7 @@ public class StableSamplerTest {
      * the choice of a beta=0 sampler must check tau and not beta.
      */
     @Test
-    public void testTauLimits() {
+    void testTauLimits() {
         // At the limit of beta, tau ranges from 2/pi to 0 as alpha moves away from 1.
         final double beta = 1;
 
@@ -276,7 +276,7 @@ public class StableSamplerTest {
      * correction of non-finite results from the CMS algorithm.
      */
     @Test
-    public void testA2IsNotZero() {
+    void testA2IsNotZero() {
         // The extreme limit of the angle phiby2. This is ignored by the sampler
         // as it can result in cancellation of terms and invalid results.
         final double p0 = getU(Long.MIN_VALUE);
@@ -315,7 +315,7 @@ public class StableSamplerTest {
      * is in the open interval {@code (0, 1)}.
      */
     @Test
-    public void testZIsNotAlwaysAboveZero() {
+    void testZIsNotAlwaysAboveZero() {
         // A long is used to create phi/2:
         // The next to limit values for the phi/2
         final long x00 = Long.MIN_VALUE;
@@ -443,7 +443,7 @@ public class StableSamplerTest {
      * the computation may multiply infinity by zero and create NaN.
      */
     @Test
-    public void testComputeDWhenZIsFiniteNonZero() {
+    void testComputeDWhenZIsFiniteNonZero() {
         final double[] zs = {Double.MIN_VALUE, Double.MAX_VALUE};
 
         final double[] alphas = {2, 1.5, 1 + 1e-6, 1, 1 - 1e-6, 0.5, 0.01, 1e-10, SMALLEST_ALPHA};
@@ -507,7 +507,7 @@ public class StableSamplerTest {
      * This applies to the Weron formula.
      */
     @Test
-    public void testSinAlphaPhiMinusAtanZeta() {
+    void testSinAlphaPhiMinusAtanZeta() {
         // Note sin(alpha * phi + atan(-zeta)) is zero when:
         // alpha * phi = -atan(-zeta)
         // tan(-alpha * phi) = -zeta
@@ -530,7 +530,7 @@ public class StableSamplerTest {
      * This applies to the Weron formula.
      */
     @Test
-    public void testCosPhiMinusAlphaPhiXi() {
+    void testCosPhiMinusAlphaPhiXi() {
         // This is the extreme of cos(x) that should be used
         final double cosPi2 = Math.cos(PI_2);
         // The function is symmetric
@@ -648,7 +648,7 @@ public class StableSamplerTest {
      * This applies to the Weron formula when {@code beta = 0}.
      */
     @Test
-    public void testSinAlphaPhi() {
+    void testSinAlphaPhi() {
         // Smallest non-zero phi.
         // getU creates in the domain (-pi/4, pi/4) so double the angle.
         for (final double phi : new double[] {getU(-1) * 2, getU(1 << 10) * 2}) {
@@ -666,7 +666,7 @@ public class StableSamplerTest {
      * point to the high precision version is monotonic.
      */
     @Test
-    public void testExpM1() {
+    void testExpM1() {
         // Test monotonic at the switch point
         Assertions.assertEquals(d2(0.5), d2b(0.5));
         // When positive x -> 0 the value smaller bigger.
@@ -688,7 +688,7 @@ public class StableSamplerTest {
      * expensive expm1 function.
      */
     //@Test
-    public void expm1ULPReport() {
+    void expm1ULPReport() {
         // Create random doubles with a given exponent. Compute the mean and max ULP difference.
         final UniformRandomProvider rng = RandomSource.XO_RO_SHI_RO_128_PP.create();
         // For a quicker report set to <= 2^20.
@@ -806,7 +806,7 @@ public class StableSamplerTest {
      * The limits of the function are {@code [0, inf]} and it should return 1 when x=0.
      */
     @Test
-    public void testD2() {
+    void testD2() {
         for (final double x : new double[] {Double.MAX_VALUE, Math.log(Double.MAX_VALUE), 10, 5, 1, 0.5, 0.1, 0.05, 0.01}) {
             Assertions.assertEquals(Math.expm1(x) / x, SpecialMath.d2(x), 1e-15);
             Assertions.assertEquals(Math.expm1(-x) / -x, SpecialMath.d2(-x), 1e-15);
@@ -831,7 +831,7 @@ public class StableSamplerTest {
      * Test the tan2 function returns {@code tan(x) / x}.
      */
     @Test
-    public void testTan2() {
+    void testTan2() {
         // Test the value of tan(x) when the angle is generated in the open interval (-pi/4, pi/4)
         for (final long x : new long[] {Long.MIN_VALUE + (1 << 10), Long.MAX_VALUE}) {
             final double phiby2 = getU(x);
@@ -912,7 +912,7 @@ public class StableSamplerTest {
      * This shows the two are equivalent; they should match as the formulas are rearrangements.
      */
     @Test
-    public void testSamplesWithAlphaNot1() {
+    void testSamplesWithAlphaNot1() {
         // Use non-extreme parameters. beta and u are negated so use non-redundant values
         final double[] alphas = {0.3, 0.9, 1.1, 1.5};
         final double[] betas = {-1, -0.5, -0.3, 0};
@@ -943,7 +943,7 @@ public class StableSamplerTest {
      * This shows the two are equivalent; they should match as the formulas are rearrangements.
      */
     @Test
-    public void testSamplesWithAlpha1() {
+    void testSamplesWithAlpha1() {
         // Use non-extreme parameters. beta and u are negated so use non-redundant values
         final double[] betas = {-1, -0.5, -0.3, 0};
         final double[] ws = {0.1, 1, 3};
@@ -972,7 +972,7 @@ public class StableSamplerTest {
      * Demonstrate the Weron formula is not continuous as {@code alpha -> 1}.
      */
     @Test
-    public void testConvergenceWithAlphaCloseTo1() {
+    void testConvergenceWithAlphaCloseTo1() {
         final double[] betas = {-1, -0.5, 0, 0.3, 1};
         final double[] ws = {0.1, 1, 10};
         final double[] us = {0.1, 0.25, 0.5, 0.8};
@@ -1041,7 +1041,7 @@ public class StableSamplerTest {
      * formula can create an appropriate sample for all cases where the CMS formula fails.
      */
     @Test
-    public void testExtremeInputsToSample() {
+    void testExtremeInputsToSample() {
         // Demonstrate instability when w = 0
         Assertions.assertEquals(Double.NaN, sampleCMS(1.3, 0.7, 0, 0.25));
         Assertions.assertTrue(Double.isFinite(sampleCMS(1.3, 0.7, SMALL_W, 0.25)));
@@ -1341,7 +1341,7 @@ public class StableSamplerTest {
      * deviates that cause the value {@code z} to be negative.
      */
     @Test
-    public void testSamplesWithZBelow0() {
+    void testSamplesWithZBelow0() {
         // Call the CMS algorithm with u->1; phi/2 -> pi/4.
         // The value with all bits set generates phi/2 -> pi/4.
         // Add a long to create a big value for w of 5.
@@ -1386,7 +1386,7 @@ public class StableSamplerTest {
      * deviates that cause the value {@code z} to be infinite.
      */
     @Test
-    public void testSamplesWithZInfinite() {
+    void testSamplesWithZInfinite() {
         // Call the CMS algorithm with w=0 (and phi/2 is not extreme).
         final long[] longs = {Long.MIN_VALUE >>> 1, 0};
 
@@ -1426,7 +1426,7 @@ public class StableSamplerTest {
      * deviates that cause the value {@code d} to be infinite.
      */
     @Test
-    public void testSamplesWithDInfinite() {
+    void testSamplesWithDInfinite() {
         // beta != 0 but with low skew to allow the direction switch in
         // phi/2 to create opposite directions.
         testSamplesWithDInfinite(0.01);
@@ -1438,7 +1438,7 @@ public class StableSamplerTest {
      * deviates that cause the value {@code d} to be infinite.
      */
     @Test
-    public void testBeta0SamplesWithDInfinite() {
+    void testBeta0SamplesWithDInfinite() {
         testSamplesWithDInfinite(0.0);
     }
 
@@ -1497,7 +1497,7 @@ public class StableSamplerTest {
      * deviates that cause the value {@code phi/2} to be at the extreme limits.
      */
     @Test
-    public void testAlpha1SamplesWithExtremePhi() {
+    void testAlpha1SamplesWithExtremePhi() {
         // The numerator is:
         // 1 + 2 * phiby2 * tau
         // tau = beta / pi/2 when alpha=1
@@ -1534,7 +1534,7 @@ public class StableSamplerTest {
      * {@code |beta| = 1}.
      */
     @Test
-    public void testSupport() {
+    void testSupport() {
         testSupport(1.0, 0.0);
     }
 
@@ -1544,7 +1544,7 @@ public class StableSamplerTest {
      * {@code |beta| = 1}.
      */
     @Test
-    public void testSupportWithTransformation() {
+    void testSupportWithTransformation() {
         // This tests extreme values which should not create NaN results
         for (final double gamma : new double[] {0.78, 1.23, Double.MAX_VALUE, Double.MIN_VALUE}) {
             for (final double delta : new double[] {0.43, 12.34, Double.MAX_VALUE}) {
@@ -1721,7 +1721,7 @@ public class StableSamplerTest {
      * Test the random deviates u and w can be generated by manipulating the RNG.
      */
     @Test
-    public void testRandomDeviatesUandW() {
+    void testRandomDeviatesUandW() {
         // Extremes of the uniform deviate generated using the same method as the sampler
         final double d = DU * PI_4;
         // Test in (-pi/4, pi/4)
@@ -1910,7 +1910,7 @@ public class StableSamplerTest {
      * samplers computes a continuous function of the parameters.
      */
     @Test
-    public void testSamplerOutputIsContinuousFunction() {
+    void testSamplerOutputIsContinuousFunction() {
         // Test alpha passing through 1 when beta!=0 (switch to an alpha=1 sampler)
         for (final double beta : new double[] {0.5, 0.2, 0.1, 0.001}) {
             testSamplerOutputIsContinuousFunction(1 + 8096 * DU, beta, 1.0, beta, 1 - 8096 * DU, beta, 0);
@@ -1993,7 +1993,7 @@ public class StableSamplerTest {
      * Test the SharedStateSampler implementation for each case using a different implementation.
      */
     @Test
-    public void testSharedStateSampler() {
+    void testSharedStateSampler() {
         // Gaussian case
         testSharedStateSampler(2.0, 0.0);
         // Cauchy case
@@ -2041,7 +2041,7 @@ public class StableSamplerTest {
      * Test the implementation of the transformed sampler (scaled and translated).
      */
     @Test
-    public void testTransformedSampler() {
+    void testTransformedSampler() {
         // Gaussian case
         // The Gaussian case has its own scaling where the StdDev is gamma * sqrt(2).
         // (N(x) * sqrt(2)) * gamma != N(x) * (sqrt(2) * gamma)
@@ -2130,7 +2130,7 @@ public class StableSamplerTest {
      * Test symmetry when when u and beta are mirrored around 0.5 and 0 respectively.
      */
     @Test
-    public void testSymmetry() {
+    void testSymmetry() {
         final byte[] seed = RandomSource.KISS.createSeed();
         for (final double alpha : new double[] {1e-4, 0.78, 1, 1.23}) {
             for (final double beta : new double[] {-0.43, 0.23}) {
@@ -2208,7 +2208,7 @@ public class StableSamplerTest {
      * Test symmetry for the Levy case ({@code alpha = 0.5} and {@code beta = 1}.
      */
     @Test
-    public void testSymmetryLevy() {
+    void testSymmetryLevy() {
         final double alpha = 0.5;
         final double beta = 1.0;
         final byte[] seed = RandomSource.KISS.createSeed();
@@ -2232,7 +2232,7 @@ public class StableSamplerTest {
      * even for parameters that create the Gaussian, Cauchy or Levy cases.
      */
     @Test
-    public void testToString() {
+    void testToString() {
         final UniformRandomProvider rng = RandomSource.SPLIT_MIX_64.create(0L);
         for (final double[] p : new double[][] {
             {1.3, 0.1},
@@ -2265,7 +2265,7 @@ public class StableSamplerTest {
      * parameters are not validated.
      */
     @Test
-    public void testImplementationsMatch() {
+    void testImplementationsMatch() {
         // Avoid extreme samples. Do this by manipulating the output of nextLong.
         // Generation of the random deviate u uses the top 54-bits of the long.
         // Unset a high bit to ensure getU cannot approach pi/4.
@@ -2345,7 +2345,7 @@ public class StableSamplerTest {
      * parameters are not validated.
      */
     @Test
-    public void testSpecializedBeta0CMSImplementation() {
+    void testSpecializedBeta0CMSImplementation() {
         final RandomSource source = RandomSource.XO_RO_SHI_RO_128_SS;
         // Should be robust to any seed
         final byte[] seed = source.createSeed();
@@ -2372,7 +2372,7 @@ public class StableSamplerTest {
      * parameters are not validated.
      */
     @Test
-    public void testSpecializedBeta0WeronImplementation() {
+    void testSpecializedBeta0WeronImplementation() {
         final RandomSource source = RandomSource.XO_RO_SHI_RO_128_SS;
         // Should be robust to any seed
         final byte[] seed = source.createSeed();
@@ -2397,7 +2397,7 @@ public class StableSamplerTest {
      * @see #testSinAlphaPhiMinusAtanZeta()
      */
     @Test
-    public void testWeronImplementationEdgeCase() {
+    void testWeronImplementationEdgeCase() {
         double alpha = 0.25;
         // Solved in testSinAlphaPhiMinusAtanZeta()
         double beta = -0.48021693505171;
diff --git a/commons-rng-sampling/src/test/java/org/apache/commons/rng/sampling/distribution/UniformLongSamplerTest.java b/commons-rng-sampling/src/test/java/org/apache/commons/rng/sampling/distribution/UniformLongSamplerTest.java
index 5f8c10b..3fb6216 100644
--- a/commons-rng-sampling/src/test/java/org/apache/commons/rng/sampling/distribution/UniformLongSamplerTest.java
+++ b/commons-rng-sampling/src/test/java/org/apache/commons/rng/sampling/distribution/UniformLongSamplerTest.java
@@ -38,12 +38,12 @@ import java.util.Locale;
  * is within the range limits. Power of two ranges are tested against a bit shift
  * of a random long.
  */
-public class UniformLongSamplerTest {
+class UniformLongSamplerTest {
     /**
      * Test the constructor with a bad range.
      */
     @Test
-    public void testConstructorThrowsWithLowerAboveUpper() {
+    void testConstructorThrowsWithLowerAboveUpper() {
         final long upper = 55;
         final long lower = upper + 1;
         final UniformRandomProvider rng = RandomSource.SPLIT_MIX_64.create(0L);
@@ -52,7 +52,7 @@ public class UniformLongSamplerTest {
     }
 
     @Test
-    public void testSamplesWithRangeOf1() {
+    void testSamplesWithRangeOf1() {
         final long upper = 99;
         final long lower = upper;
         final UniformRandomProvider rng = RandomSource.SPLIT_MIX_64.create();
@@ -67,7 +67,7 @@ public class UniformLongSamplerTest {
      * The output should be the same as the long values produced from a RNG.
      */
     @Test
-    public void testSamplesWithFullRange() {
+    void testSamplesWithFullRange() {
         final long upper = Long.MAX_VALUE;
         final long lower = Long.MIN_VALUE;
         final UniformRandomProvider rng1 = RandomSource.SPLIT_MIX_64.create(0L);
@@ -85,7 +85,7 @@ public class UniformLongSamplerTest {
      * the same.
      */
     @Test
-    public void testSamplesWithSmallNonPowerOf2Range() {
+    void testSamplesWithSmallNonPowerOf2Range() {
         final long upper = 234293789329234L;
         for (final long lower : new long[] {-13, 0, 13}) {
             final long n = upper - lower + 1;
@@ -119,7 +119,7 @@ public class UniformLongSamplerTest {
      * This tests the minimum and maximum output should be the range limits.
      */
     @Test
-    public void testSamplesWithPowerOf2Range() {
+    void testSamplesWithPowerOf2Range() {
         final UniformRandomProvider rngZeroBits = new LongProvider() {
             @Override
             public long next() {
@@ -155,7 +155,7 @@ public class UniformLongSamplerTest {
      * This tests the output is created using a bit shift.
      */
     @Test
-    public void testSamplesWithPowerOf2RangeIsBitShift() {
+    void testSamplesWithPowerOf2RangeIsBitShift() {
         final long lower = 0;
         UniformLongSampler sampler;
         // Power of 2 sampler used for a bit shift of 1 to 63.
@@ -177,7 +177,7 @@ public class UniformLongSamplerTest {
      * This tests the large range algorithm uses a rejection method.
      */
     @Test
-    public void testSamplesWithLargeNonPowerOf2RangeIsRejectionMethod() {
+    void testSamplesWithLargeNonPowerOf2RangeIsRejectionMethod() {
         // Create a range bigger than 2^63
         final long upper = Long.MAX_VALUE / 2 + 1;
         final long lower = Long.MIN_VALUE / 2 - 1;
@@ -195,17 +195,17 @@ public class UniformLongSamplerTest {
     }
 
     @Test
-    public void testOffsetSamplesWithNonPowerOf2Range() {
+    void testOffsetSamplesWithNonPowerOf2Range() {
         assertOffsetSamples(257);
     }
 
     @Test
-    public void testOffsetSamplesWithPowerOf2Range() {
+    void testOffsetSamplesWithPowerOf2Range() {
         assertOffsetSamples(256);
     }
 
     @Test
-    public void testOffsetSamplesWithRangeOf1() {
+    void testOffsetSamplesWithRangeOf1() {
         assertOffsetSamples(1);
     }
 
@@ -235,7 +235,7 @@ public class UniformLongSamplerTest {
      * Test the sample uniformity when using a small range that is a power of 2.
      */
     @Test
-    public void testSampleUniformityWithPowerOf2Range() {
+    void testSampleUniformityWithPowerOf2Range() {
         // Test using a RNG that outputs a counter of integers.
         // The n most significant bits will be represented uniformly over a
         // sequence that is a 2^n long.
@@ -270,24 +270,24 @@ public class UniformLongSamplerTest {
     }
 
     @Test
-    public void testSharedStateSamplerWithSmallRange() {
+    void testSharedStateSamplerWithSmallRange() {
         assertSharedStateSampler(5, 67);
     }
 
     @Test
-    public void testSharedStateSamplerWithLargeRange() {
+    void testSharedStateSamplerWithLargeRange() {
         // Set the range so rejection below or above the threshold occurs with approximately
         // p=0.25 for each bound.
         assertSharedStateSampler(Long.MIN_VALUE / 2 - 1, Long.MAX_VALUE / 2 + 1);
     }
 
     @Test
-    public void testSharedStateSamplerWithPowerOf2Range() {
+    void testSharedStateSamplerWithPowerOf2Range() {
         assertSharedStateSampler(0, (1L << 45) - 1);
     }
 
     @Test
-    public void testSharedStateSamplerWithRangeOf1() {
+    void testSharedStateSamplerWithRangeOf1() {
         assertSharedStateSampler(968757657572323L, 968757657572323L);
     }
 
@@ -307,23 +307,23 @@ public class UniformLongSamplerTest {
     }
 
     @Test
-    public void testToStringWithSmallRange() {
+    void testToStringWithSmallRange() {
         assertToString(5, 67);
     }
 
     @Test
-    public void testToStringWithLargeRange() {
+    void testToStringWithLargeRange() {
         assertToString(-99999999, Long.MAX_VALUE);
     }
 
     @Test
-    public void testToStringWithPowerOf2Range() {
+    void testToStringWithPowerOf2Range() {
         // Note the range is upper - lower + 1
         assertToString(0, 31);
     }
 
     @Test
-    public void testToStringWithRangeOf1() {
+    void testToStringWithRangeOf1() {
         assertToString(9, 9);
     }
 
diff --git a/commons-rng-sampling/src/test/java/org/apache/commons/rng/sampling/distribution/ZigguratNormalizedGaussianSamplerTest.java b/commons-rng-sampling/src/test/java/org/apache/commons/rng/sampling/distribution/ZigguratNormalizedGaussianSamplerTest.java
index dbb03a6..7954f97 100644
--- a/commons-rng-sampling/src/test/java/org/apache/commons/rng/sampling/distribution/ZigguratNormalizedGaussianSamplerTest.java
+++ b/commons-rng-sampling/src/test/java/org/apache/commons/rng/sampling/distribution/ZigguratNormalizedGaussianSamplerTest.java
@@ -25,10 +25,10 @@ import org.apache.commons.rng.simple.RandomSource;
 /**
  * Test for {@link ZigguratNormalizedGaussianSampler}.
  */
-public class ZigguratNormalizedGaussianSamplerTest {
+class ZigguratNormalizedGaussianSamplerTest {
     // Cf. RNG-56
     @Test
-    public void testInfiniteLoop() {
+    void testInfiniteLoop() {
         // A bad implementation whose only purpose is to force access
         // to the rarest branch.
         final UniformRandomProvider bad = new UniformRandomProvider() {
@@ -54,7 +54,7 @@ public class ZigguratNormalizedGaussianSamplerTest {
      * Test the SharedStateSampler implementation.
      */
     @Test
-    public void testSharedStateSampler() {
+    void testSharedStateSampler() {
         final UniformRandomProvider rng1 = RandomSource.SPLIT_MIX_64.create(0L);
         final UniformRandomProvider rng2 = RandomSource.SPLIT_MIX_64.create(0L);
         final SharedStateContinuousSampler sampler1 =
diff --git a/commons-rng-sampling/src/test/java/org/apache/commons/rng/sampling/distribution/ZigguratSamplerTest.java b/commons-rng-sampling/src/test/java/org/apache/commons/rng/sampling/distribution/ZigguratSamplerTest.java
index 59e2bc3..1955211 100644
--- a/commons-rng-sampling/src/test/java/org/apache/commons/rng/sampling/distribution/ZigguratSamplerTest.java
+++ b/commons-rng-sampling/src/test/java/org/apache/commons/rng/sampling/distribution/ZigguratSamplerTest.java
@@ -32,12 +32,12 @@ import org.apache.commons.rng.simple.RandomSource;
 /**
  * Test for {@link ZigguratSampler}.
  */
-public class ZigguratSamplerTest {
+class ZigguratSamplerTest {
     /**
      * Test the exponential constructor with a bad mean.
      */
     @Test
-    public void testExponentialConstructorThrowsWithZeroMean() {
+    void testExponentialConstructorThrowsWithZeroMean() {
         final RestorableUniformRandomProvider rng = RandomSource.SPLIT_MIX_64.create(0L);
         final double mean = 0;
         Assertions.assertThrows(IllegalArgumentException.class,
@@ -48,7 +48,7 @@ public class ZigguratSamplerTest {
      * Test the exponential SharedStateSampler implementation.
      */
     @Test
-    public void testExponentialSharedStateSampler() {
+    void testExponentialSharedStateSampler() {
         final UniformRandomProvider rng1 = RandomSource.SPLIT_MIX_64.create(0L);
         final UniformRandomProvider rng2 = RandomSource.SPLIT_MIX_64.create(0L);
         final ZigguratSampler.Exponential sampler1 = ZigguratSampler.Exponential.of(rng1);
@@ -60,7 +60,7 @@ public class ZigguratSamplerTest {
      * Test the exponential SharedStateSampler implementation with a mean.
      */
     @Test
-    public void testExponentialSharedStateSamplerWithMean() {
+    void testExponentialSharedStateSamplerWithMean() {
         final UniformRandomProvider rng1 = RandomSource.SPLIT_MIX_64.create(0L);
         final UniformRandomProvider rng2 = RandomSource.SPLIT_MIX_64.create(0L);
         final double mean = 1.23;
@@ -73,7 +73,7 @@ public class ZigguratSamplerTest {
      * Test the Gaussian SharedStateSampler implementation.
      */
     @Test
-    public void testGaussianSharedStateSampler() {
+    void testGaussianSharedStateSampler() {
         final UniformRandomProvider rng1 = RandomSource.SPLIT_MIX_64.create(0L);
         final UniformRandomProvider rng2 = RandomSource.SPLIT_MIX_64.create(0L);
         final ZigguratSampler.NormalizedGaussian sampler1 = ZigguratSampler.NormalizedGaussian.of(rng1);
@@ -85,7 +85,7 @@ public class ZigguratSamplerTest {
      * Test the recursion in the exponential distribution.
      */
     @Test
-    public void testExponentialRecursion() {
+    void testExponentialRecursion() {
         // The exponential distribution will enter the edge of the ziggurat if the RNG
         // outputs -1 (all bits). This performs alias sampling using a long value.
         // The tail will be selected if the next output is -1.
@@ -145,7 +145,7 @@ public class ZigguratSamplerTest {
      * Added for RNG-159.
      */
     @Test
-    public void testGaussianSamplesWithQuantiles() {
+    void testGaussianSamplesWithQuantiles() {
         final int bins = 2000;
         final NormalDistribution dist = new NormalDistribution(null, 0.0, 1.0);
         final double[] quantiles = new double[bins];
@@ -160,7 +160,7 @@ public class ZigguratSamplerTest {
      * Added for RNG-159.
      */
     @Test
-    public void testGaussianSamplesWithUniformValues() {
+    void testGaussianSamplesWithUniformValues() {
         final int bins = 2000;
         final double[] values = new double[bins];
         final double minx = -8;
@@ -177,7 +177,7 @@ public class ZigguratSamplerTest {
      * Test exponential samples using a large number of bins based on uniformly spaced quantiles.
      */
     @Test
-    public void testExponentialSamplesWithQuantiles() {
+    void testExponentialSamplesWithQuantiles() {
         final int bins = 2000;
         final ExponentialDistribution dist = new ExponentialDistribution(null, 1.0);
         final double[] quantiles = new double[bins];
@@ -191,7 +191,7 @@ public class ZigguratSamplerTest {
      * Test exponential samples using a large number of bins uniformly spaced in a range.
      */
     @Test
-    public void testExponentialSamplesWithUniformValues() {
+    void testExponentialSamplesWithUniformValues() {
         final int bins = 2000;
         final double[] values = new double[bins];
         final double minx = 0;
diff --git a/commons-rng-sampling/src/test/java/org/apache/commons/rng/sampling/shape/BoxSamplerTest.java b/commons-rng-sampling/src/test/java/org/apache/commons/rng/sampling/shape/BoxSamplerTest.java
index 623b002..319be8d 100644
--- a/commons-rng-sampling/src/test/java/org/apache/commons/rng/sampling/shape/BoxSamplerTest.java
+++ b/commons-rng-sampling/src/test/java/org/apache/commons/rng/sampling/shape/BoxSamplerTest.java
@@ -31,12 +31,12 @@ import org.apache.commons.rng.simple.RandomSource;
 /**
  * Test for {@link BoxSampler}.
  */
-public class BoxSamplerTest {
+class BoxSamplerTest {
     /**
      * Test an unsupported dimension.
      */
     @Test
-    public void testInvalidDimensionThrows() {
+    void testInvalidDimensionThrows() {
         final UniformRandomProvider rng = RandomSource.SPLIT_MIX_64.create(0L);
         Assertions.assertThrows(IllegalArgumentException.class,
             () -> BoxSampler.of(rng, new double[1], new double[1]));
@@ -46,7 +46,7 @@ public class BoxSamplerTest {
      * Test a dimension mismatch between vertices.
      */
     @Test
-    public void testDimensionMismatchThrows() {
+    void testDimensionMismatchThrows() {
         final UniformRandomProvider rng = RandomSource.SPLIT_MIX_64.create(0L);
         final double[] c2 = new double[2];
         final double[] c3 = new double[3];
@@ -65,7 +65,7 @@ public class BoxSamplerTest {
      * Test non-finite vertices.
      */
     @Test
-    public void testNonFiniteVertexCoordinates() {
+    void testNonFiniteVertexCoordinates() {
         final UniformRandomProvider rng = RandomSource.SPLIT_MIX_64.create(0L);
         // A valid box
         final double[][] c = new double[][] {
@@ -94,7 +94,7 @@ public class BoxSamplerTest {
      * {@link Double#MAX_VALUE} in 2D.
      */
     @Test
-    public void testExtremeValueCoordinates2D() {
+    void testExtremeValueCoordinates2D() {
         testExtremeValueCoordinates(2);
     }
 
@@ -103,7 +103,7 @@ public class BoxSamplerTest {
      * {@link Double#MAX_VALUE} in 3D.
      */
     @Test
-    public void testExtremeValueCoordinates3D() {
+    void testExtremeValueCoordinates3D() {
         testExtremeValueCoordinates(3);
     }
 
@@ -112,7 +112,7 @@ public class BoxSamplerTest {
      * {@link Double#MAX_VALUE} in 4D.
      */
     @Test
-    public void testExtremeValueCoordinates4D() {
+    void testExtremeValueCoordinates4D() {
         testExtremeValueCoordinates(4);
     }
 
@@ -161,7 +161,7 @@ public class BoxSamplerTest {
      * Test the distribution of points in 2D.
      */
     @Test
-    public void testDistribution2D() {
+    void testDistribution2D() {
         testDistributionND(2);
     }
 
@@ -169,7 +169,7 @@ public class BoxSamplerTest {
      * Test the distribution of points in 3D.
      */
     @Test
-    public void testDistribution3D() {
+    void testDistribution3D() {
         testDistributionND(3);
     }
 
@@ -177,7 +177,7 @@ public class BoxSamplerTest {
      * Test the distribution of points in 4D.
      */
     @Test
-    public void testDistribution4D() {
+    void testDistribution4D() {
         testDistributionND(4);
     }
 
@@ -246,7 +246,7 @@ public class BoxSamplerTest {
      * Test the SharedStateSampler implementation for 2D.
      */
     @Test
-    public void testSharedStateSampler2D() {
+    void testSharedStateSampler2D() {
         testSharedStateSampler(2);
     }
 
@@ -254,7 +254,7 @@ public class BoxSamplerTest {
      * Test the SharedStateSampler implementation for 3D.
      */
     @Test
-    public void testSharedStateSampler3D() {
+    void testSharedStateSampler3D() {
         testSharedStateSampler(3);
     }
 
@@ -262,7 +262,7 @@ public class BoxSamplerTest {
      * Test the SharedStateSampler implementation for 4D.
      */
     @Test
-    public void testSharedStateSampler4D() {
+    void testSharedStateSampler4D() {
         testSharedStateSampler(4);
     }
 
@@ -283,7 +283,7 @@ public class BoxSamplerTest {
      * Test the input vectors are copied and not used by reference for 2D.
      */
     @Test
-    public void testChangedInputCoordinates2D() {
+    void testChangedInputCoordinates2D() {
         testChangedInputCoordinates(2);
     }
 
@@ -291,7 +291,7 @@ public class BoxSamplerTest {
      * Test the input vectors are copied and not used by reference for 3D.
      */
     @Test
-    public void testChangedInputCoordinates3D() {
+    void testChangedInputCoordinates3D() {
         testChangedInputCoordinates(3);
     }
 
@@ -299,7 +299,7 @@ public class BoxSamplerTest {
      * Test the input vectors are copied and not used by reference for 4D.
      */
     @Test
-    public void testChangedInputCoordinates4D() {
+    void testChangedInputCoordinates4D() {
         testChangedInputCoordinates(4);
     }
 
diff --git a/commons-rng-sampling/src/test/java/org/apache/commons/rng/sampling/shape/CoordinatesTest.java b/commons-rng-sampling/src/test/java/org/apache/commons/rng/sampling/shape/CoordinatesTest.java
index 2e08d19..684cc7b 100644
--- a/commons-rng-sampling/src/test/java/org/apache/commons/rng/sampling/shape/CoordinatesTest.java
+++ b/commons-rng-sampling/src/test/java/org/apache/commons/rng/sampling/shape/CoordinatesTest.java
@@ -22,12 +22,12 @@ import org.junit.jupiter.api.Test;
 /**
  * Test for {@link Coordinates} utility class.
  */
-public class CoordinatesTest {
+class CoordinatesTest {
     /**
      * Test {@link Coordinates#requireFinite(double[], String)} detects infinite and NaN.
      */
     @Test
-    public void testRequireFiniteWithMessageThrows() {
+    void testRequireFiniteWithMessageThrows() {
         final double[] c = {0, 1, 2};
         final String message = "This should be prepended";
         Assertions.assertSame(c, Coordinates.requireFinite(c, message));
@@ -50,7 +50,7 @@ public class CoordinatesTest {
      * Test {@link Coordinates#requireLength(double[], int, String)} detects invalid lengths.
      */
     @Test
-    public void testRequireLengthWithMessageThrows() {
+    void testRequireLengthWithMessageThrows() {
         final String message = "This should be prepended";
         for (final double[] c : new double[][] {{0, 1}, {0, 1, 2}}) {
             final int length = c.length;
diff --git a/commons-rng-sampling/src/test/java/org/apache/commons/rng/sampling/shape/LineSamplerTest.java b/commons-rng-sampling/src/test/java/org/apache/commons/rng/sampling/shape/LineSamplerTest.java
index f90f2e0..4afd472 100644
--- a/commons-rng-sampling/src/test/java/org/apache/commons/rng/sampling/shape/LineSamplerTest.java
+++ b/commons-rng-sampling/src/test/java/org/apache/commons/rng/sampling/shape/LineSamplerTest.java
@@ -31,12 +31,12 @@ import org.apache.commons.rng.simple.RandomSource;
 /**
  * Test for {@link LineSampler}.
  */
-public class LineSamplerTest {
+class LineSamplerTest {
     /**
      * Test an unsupported dimension.
      */
     @Test
-    public void testInvalidDimensionThrows() {
+    void testInvalidDimensionThrows() {
         final UniformRandomProvider rng = RandomSource.SPLIT_MIX_64.create(0L);
         Assertions.assertThrows(IllegalArgumentException.class,
             () -> LineSampler.of(rng, new double[0], new double[0]));
@@ -46,7 +46,7 @@ public class LineSamplerTest {
      * Test a dimension mismatch between vertices.
      */
     @Test
-    public void testDimensionMismatchThrows() {
+    void testDimensionMismatchThrows() {
         final UniformRandomProvider rng = RandomSource.SPLIT_MIX_64.create(0L);
         final double[] c2 = new double[2];
         final double[] c3 = new double[3];
@@ -65,7 +65,7 @@ public class LineSamplerTest {
      * Test non-finite vertices.
      */
     @Test
-    public void testNonFiniteVertexCoordinates() {
+    void testNonFiniteVertexCoordinates() {
         final UniformRandomProvider rng = RandomSource.SPLIT_MIX_64.create(0L);
         // A valid line
         final double[][] c = new double[][] {
@@ -95,7 +95,7 @@ public class LineSamplerTest {
      * {@link Double#MAX_VALUE} in 1D.
      */
     @Test
-    public void testExtremeValueCoordinates1D() {
+    void testExtremeValueCoordinates1D() {
         testExtremeValueCoordinates(1);
     }
 
@@ -104,7 +104,7 @@ public class LineSamplerTest {
      * {@link Double#MAX_VALUE} in 2D.
      */
     @Test
-    public void testExtremeValueCoordinates2D() {
+    void testExtremeValueCoordinates2D() {
         testExtremeValueCoordinates(2);
     }
 
@@ -113,7 +113,7 @@ public class LineSamplerTest {
      * {@link Double#MAX_VALUE} in 3D.
      */
     @Test
-    public void testExtremeValueCoordinates3D() {
+    void testExtremeValueCoordinates3D() {
         testExtremeValueCoordinates(3);
     }
 
@@ -122,7 +122,7 @@ public class LineSamplerTest {
      * {@link Double#MAX_VALUE} in 4D.
      */
     @Test
-    public void testExtremeValueCoordinates4D() {
+    void testExtremeValueCoordinates4D() {
         testExtremeValueCoordinates(4);
     }
 
@@ -171,7 +171,7 @@ public class LineSamplerTest {
      * Test the distribution of points in 1D.
      */
     @Test
-    public void testDistribution1D() {
+    void testDistribution1D() {
         testDistributionND(1);
     }
 
@@ -179,7 +179,7 @@ public class LineSamplerTest {
      * Test the distribution of points in 2D.
      */
     @Test
-    public void testDistribution2D() {
+    void testDistribution2D() {
         testDistributionND(2);
     }
 
@@ -187,7 +187,7 @@ public class LineSamplerTest {
      * Test the distribution of points in 3D.
      */
     @Test
-    public void testDistribution3D() {
+    void testDistribution3D() {
         testDistributionND(3);
     }
 
@@ -195,7 +195,7 @@ public class LineSamplerTest {
      * Test the distribution of points in 4D.
      */
     @Test
-    public void testDistribution4D() {
+    void testDistribution4D() {
         testDistributionND(4);
     }
 
@@ -265,7 +265,7 @@ public class LineSamplerTest {
      * Test the SharedStateSampler implementation for 1D.
      */
     @Test
-    public void testSharedStateSampler1D() {
+    void testSharedStateSampler1D() {
         testSharedStateSampler(1);
     }
 
@@ -273,7 +273,7 @@ public class LineSamplerTest {
      * Test the SharedStateSampler implementation for 2D.
      */
     @Test
-    public void testSharedStateSampler2D() {
+    void testSharedStateSampler2D() {
         testSharedStateSampler(2);
     }
 
@@ -281,7 +281,7 @@ public class LineSamplerTest {
      * Test the SharedStateSampler implementation for 3D.
      */
     @Test
-    public void testSharedStateSampler3D() {
+    void testSharedStateSampler3D() {
         testSharedStateSampler(3);
     }
 
@@ -289,7 +289,7 @@ public class LineSamplerTest {
      * Test the SharedStateSampler implementation for 4D.
      */
     @Test
-    public void testSharedStateSampler4D() {
+    void testSharedStateSampler4D() {
         testSharedStateSampler(4);
     }
 
@@ -310,7 +310,7 @@ public class LineSamplerTest {
      * Test the input vectors are copied and not used by reference for 1D.
      */
     @Test
-    public void testChangedInputCoordinates1D() {
+    void testChangedInputCoordinates1D() {
         testChangedInputCoordinates(1);
     }
 
@@ -318,7 +318,7 @@ public class LineSamplerTest {
      * Test the input vectors are copied and not used by reference for 2D.
      */
     @Test
-    public void testChangedInputCoordinates2D() {
+    void testChangedInputCoordinates2D() {
         testChangedInputCoordinates(2);
     }
 
@@ -326,7 +326,7 @@ public class LineSamplerTest {
      * Test the input vectors are copied and not used by reference for 3D.
      */
     @Test
-    public void testChangedInputCoordinates3D() {
+    void testChangedInputCoordinates3D() {
         testChangedInputCoordinates(3);
     }
 
@@ -334,7 +334,7 @@ public class LineSamplerTest {
      * Test the input vectors are copied and not used by reference for 4D.
      */
     @Test
-    public void testChangedInputCoordinates4D() {
+    void testChangedInputCoordinates4D() {
         testChangedInputCoordinates(4);
     }
 
diff --git a/commons-rng-sampling/src/test/java/org/apache/commons/rng/sampling/shape/TetrahedronSamplerTest.java b/commons-rng-sampling/src/test/java/org/apache/commons/rng/sampling/shape/TetrahedronSamplerTest.java
index 8ec8484..525e187 100644
--- a/commons-rng-sampling/src/test/java/org/apache/commons/rng/sampling/shape/TetrahedronSamplerTest.java
+++ b/commons-rng-sampling/src/test/java/org/apache/commons/rng/sampling/shape/TetrahedronSamplerTest.java
@@ -30,12 +30,12 @@ import org.apache.commons.rng.simple.RandomSource;
 /**
  * Test for {@link TetrahedronSampler}.
  */
-public class TetrahedronSamplerTest {
+class TetrahedronSamplerTest {
     /**
      * Test invalid vertex dimensions (i.e. not 3D coordinates).
      */
     @Test
-    public void testInvalidDimensionThrows() {
+    void testInvalidDimensionThrows() {
         final UniformRandomProvider rng = RandomSource.SPLIT_MIX_64.create(0L);
         final double[] ok = new double[3];
         final double[] bad = new double[2];
@@ -54,7 +54,7 @@ public class TetrahedronSamplerTest {
      * Test non-finite vertices.
      */
     @Test
-    public void testNonFiniteVertexCoordinates() {
+    void testNonFiniteVertexCoordinates() {
         final UniformRandomProvider rng = RandomSource.SPLIT_MIX_64.create(0L);
         // A valid tetrahedron
         final double[][] c = new double[][] {
@@ -83,7 +83,7 @@ public class TetrahedronSamplerTest {
      * {@link Double#MAX_VALUE}.
      */
     @Test
-    public void testExtremeValueCoordinates() {
+    void testExtremeValueCoordinates() {
         // Object seed so use Long not long
         final Long seed = 876543L;
         // Create a valid tetrahedron that can be scaled
@@ -127,7 +127,7 @@ public class TetrahedronSamplerTest {
      * a box. The distribution should be uniform inside the box.
      */
     @Test
-    public void testDistribution() {
+    void testDistribution() {
         // Create the lower and upper limits of the box
         final double lx = -1;
         final double ly = -2;
@@ -247,7 +247,7 @@ public class TetrahedronSamplerTest {
      * Test the SharedStateSampler implementation.
      */
     @Test
-    public void testSharedStateSampler() {
+    void testSharedStateSampler() {
         final UniformRandomProvider rng1 = RandomSource.SPLIT_MIX_64.create(0L);
         final UniformRandomProvider rng2 = RandomSource.SPLIT_MIX_64.create(0L);
         final double[] c1 = createCoordinate(-1);
@@ -263,7 +263,7 @@ public class TetrahedronSamplerTest {
      * Test the input vectors are copied and not used by reference.
      */
     @Test
-    public void testChangedInputCoordinates() {
+    void testChangedInputCoordinates() {
         final UniformRandomProvider rng1 = RandomSource.SPLIT_MIX_64.create(0L);
         final UniformRandomProvider rng2 = RandomSource.SPLIT_MIX_64.create(0L);
         final double[] c1 = createCoordinate(1);
@@ -297,7 +297,7 @@ public class TetrahedronSamplerTest {
      * Test the tetrahedron contains predicate.
      */
     @Test
-    public void testTetrahedronContains() {
+    void testTetrahedronContains() {
         final double[][] c1 = new double[][] {
             {1, 1, 1}, {1, -1, -1}, {-1, -1, 1}, {-1, 1, -1}
         };
diff --git a/commons-rng-sampling/src/test/java/org/apache/commons/rng/sampling/shape/TriangleSamplerTest.java b/commons-rng-sampling/src/test/java/org/apache/commons/rng/sampling/shape/TriangleSamplerTest.java
index 9d2900d..9f22507 100644
--- a/commons-rng-sampling/src/test/java/org/apache/commons/rng/sampling/shape/TriangleSamplerTest.java
+++ b/commons-rng-sampling/src/test/java/org/apache/commons/rng/sampling/shape/TriangleSamplerTest.java
@@ -30,7 +30,7 @@ import org.apache.commons.rng.simple.RandomSource;
 /**
  * Test for {@link TriangleSampler}.
  */
-public class TriangleSamplerTest {
+class TriangleSamplerTest {
     // Precomputed 3D and 4D rotation matrices for forward and backward transforms
     // created using the matlab function by jodag:
     // https://stackoverflow.com/questions/50337642/how-to-calculate-a-rotation-matrix-in-n-dimensions-given-the-point-to-rotate-an
@@ -63,7 +63,7 @@ public class TriangleSamplerTest {
      * back inside the triangle.
      */
     @Test
-    public void testSamplingAssumptions() {
+    void testSamplingAssumptions() {
         // The separation between the 2^53 dyadic rationals in the interval [0, 1)
         final double delta = 0x1.0p-53;
         double s = 0.5;
@@ -94,7 +94,7 @@ public class TriangleSamplerTest {
      * Test an unsupported dimension.
      */
     @Test
-    public void testInvalidDimensionThrows() {
+    void testInvalidDimensionThrows() {
         final UniformRandomProvider rng = RandomSource.SPLIT_MIX_64.create(0L);
         Assertions.assertThrows(IllegalArgumentException.class,
             () -> TriangleSampler.of(rng, new double[1], new double[1], new double[1]));
@@ -104,7 +104,7 @@ public class TriangleSamplerTest {
      * Test a dimension mismatch between vertices.
      */
     @Test
-    public void testDimensionMismatchThrows() {
+    void testDimensionMismatchThrows() {
         final UniformRandomProvider rng = RandomSource.SPLIT_MIX_64.create(0L);
         final double[] c2 = new double[2];
         final double[] c3 = new double[3];
@@ -127,7 +127,7 @@ public class TriangleSamplerTest {
      * Test non-finite vertices.
      */
     @Test
-    public void testNonFiniteVertexCoordinates() {
+    void testNonFiniteVertexCoordinates() {
         final UniformRandomProvider rng = RandomSource.SPLIT_MIX_64.create(0L);
         // A valid triangle
         final double[][] c = new double[][] {
@@ -156,7 +156,7 @@ public class TriangleSamplerTest {
      * {@link Double#MAX_VALUE} in two dimensions.
      */
     @Test
-    public void testExtremeValueCoordinates2D() {
+    void testExtremeValueCoordinates2D() {
         testExtremeValueCoordinates(2);
     }
 
@@ -165,7 +165,7 @@ public class TriangleSamplerTest {
      * {@link Double#MAX_VALUE} in three dimensions.
      */
     @Test
-    public void testExtremeValueCoordinates3D() {
+    void testExtremeValueCoordinates3D() {
         testExtremeValueCoordinates(3);
     }
 
@@ -174,7 +174,7 @@ public class TriangleSamplerTest {
      * {@link Double#MAX_VALUE} in four dimensions.
      */
     @Test
-    public void testExtremeValueCoordinates4D() {
+    void testExtremeValueCoordinates4D() {
         testExtremeValueCoordinates(4);
     }
 
@@ -233,7 +233,7 @@ public class TriangleSamplerTest {
      * Test the distribution of points in two dimensions.
      */
     @Test
-    public void testDistribution2D() {
+    void testDistribution2D() {
         testDistributionND(2);
     }
 
@@ -241,7 +241,7 @@ public class TriangleSamplerTest {
      * Test the distribution of points in three dimensions.
      */
     @Test
-    public void testDistribution3D() {
+    void testDistribution3D() {
         testDistributionND(3);
     }
 
@@ -249,7 +249,7 @@ public class TriangleSamplerTest {
      * Test the distribution of points in four dimensions.
      */
     @Test
-    public void testDistribution4D() {
+    void testDistribution4D() {
         testDistributionND(4);
     }
 
@@ -366,7 +366,7 @@ public class TriangleSamplerTest {
      * Test the SharedStateSampler implementation for 2D.
      */
     @Test
-    public void testSharedStateSampler2D() {
+    void testSharedStateSampler2D() {
         testSharedStateSampler(2);
     }
 
@@ -374,7 +374,7 @@ public class TriangleSamplerTest {
      * Test the SharedStateSampler implementation for 3D.
      */
     @Test
-    public void testSharedStateSampler3D() {
+    void testSharedStateSampler3D() {
         testSharedStateSampler(3);
     }
 
@@ -382,7 +382,7 @@ public class TriangleSamplerTest {
      * Test the SharedStateSampler implementation for 4D.
      */
     @Test
-    public void testSharedStateSampler4D() {
+    void testSharedStateSampler4D() {
         testSharedStateSampler(4);
     }
 
@@ -404,7 +404,7 @@ public class TriangleSamplerTest {
      * Test the input vectors are copied and not used by reference for 2D.
      */
     @Test
-    public void testChangedInputCoordinates2D() {
+    void testChangedInputCoordinates2D() {
         testChangedInputCoordinates(2);
     }
 
@@ -412,7 +412,7 @@ public class TriangleSamplerTest {
      * Test the input vectors are copied and not used by reference for 3D.
      */
     @Test
-    public void testChangedInputCoordinates3D() {
+    void testChangedInputCoordinates3D() {
         testChangedInputCoordinates(3);
     }
 
@@ -420,7 +420,7 @@ public class TriangleSamplerTest {
      * Test the input vectors are copied and not used by reference for 4D.
      */
     @Test
-    public void testChangedInputCoordinates4D() {
+    void testChangedInputCoordinates4D() {
         testChangedInputCoordinates(4);
     }
 
@@ -479,7 +479,7 @@ public class TriangleSamplerTest {
      * Test the transform generates 3D coordinates and can reverse them.
      */
     @Test
-    public void testTransform3D() {
+    void testTransform3D() {
         testTransformND(3);
     }
 
@@ -487,7 +487,7 @@ public class TriangleSamplerTest {
      * Test the transform generates 4D coordinates and can reverse them.
      */
     @Test
-    public void testTransform4D() {
+    void testTransform4D() {
         testTransformND(4);
     }
 
@@ -531,7 +531,7 @@ public class TriangleSamplerTest {
      * Test 3D rotations forward and reverse.
      */
     @Test
-    public void testRotations3D() {
+    void testRotations3D() {
         final double[] x = {1, 0.5, 0};
         final double[] y = multiply(F3, x);
         Assertions.assertArrayEquals(new double[] {0.465475314831549, 1.004183876910958, -0.157947689551155}, y, 1e-10);
@@ -544,7 +544,7 @@ public class TriangleSamplerTest {
      * Test 4D rotations forward and reverse.
      */
     @Test
-    public void testRotations4D() {
+    void testRotations4D() {
         final double[] x = {1, 0.5, 0, 0};
         final double[] y = multiply(F4, x);
         Assertions.assertArrayEquals(
@@ -591,7 +591,7 @@ public class TriangleSamplerTest {
      * Test the triangle contains predicate.
      */
     @Test
-    public void testTriangleContains() {
+    void testTriangleContains() {
         final Triangle triangle = new Triangle(1, 2, 3, 1, 0.5, 6);
         // Vertices
         Assertions.assertTrue(triangle.contains(1, 2));
diff --git a/commons-rng-sampling/src/test/java/org/apache/commons/rng/sampling/shape/UnitBallSamplerTest.java b/commons-rng-sampling/src/test/java/org/apache/commons/rng/sampling/shape/UnitBallSamplerTest.java
index b7d242d..08748a5 100644
--- a/commons-rng-sampling/src/test/java/org/apache/commons/rng/sampling/shape/UnitBallSamplerTest.java
+++ b/commons-rng-sampling/src/test/java/org/apache/commons/rng/sampling/shape/UnitBallSamplerTest.java
@@ -31,12 +31,12 @@ import org.apache.commons.rng.simple.RandomSource;
 /**
  * Test for {@link UnitBallSampler}.
  */
-public class UnitBallSamplerTest {
+class UnitBallSamplerTest {
     /**
      * Test a non-positive dimension.
      */
     @Test
-    public void testInvalidDimensionThrows() {
+    void testInvalidDimensionThrows() {
         final UniformRandomProvider rng = RandomSource.SPLIT_MIX_64.create(0L);
         Assertions.assertThrows(IllegalArgumentException.class,
             () -> UnitBallSampler.of(rng, 0));
@@ -46,7 +46,7 @@ public class UnitBallSamplerTest {
      * Test the distribution of points in one dimension.
      */
     @Test
-    public void testDistribution1D() {
+    void testDistribution1D() {
         testDistributionND(1);
     }
 
@@ -54,7 +54,7 @@ public class UnitBallSamplerTest {
      * Test the distribution of points in two dimensions.
      */
     @Test
-    public void testDistribution2D() {
+    void testDistribution2D() {
         testDistributionND(2);
     }
 
@@ -62,7 +62,7 @@ public class UnitBallSamplerTest {
      * Test the distribution of points in three dimensions.
      */
     @Test
-    public void testDistribution3D() {
+    void testDistribution3D() {
         testDistributionND(3);
     }
 
@@ -70,7 +70,7 @@ public class UnitBallSamplerTest {
      * Test the distribution of points in four dimensions.
      */
     @Test
-    public void testDistribution4D() {
+    void testDistribution4D() {
         testDistributionND(4);
     }
 
@@ -78,7 +78,7 @@ public class UnitBallSamplerTest {
      * Test the distribution of points in five dimensions.
      */
     @Test
-    public void testDistribution5D() {
+    void testDistribution5D() {
         testDistributionND(5);
     }
 
@@ -86,7 +86,7 @@ public class UnitBallSamplerTest {
      * Test the distribution of points in six dimensions.
      */
     @Test
-    public void testDistribution6D() {
+    void testDistribution6D() {
         testDistributionND(6);
     }
 
@@ -155,7 +155,7 @@ public class UnitBallSamplerTest {
      * Test the edge case where the normalisation sum to divide by is zero for 3D.
      */
     @Test
-    public void testInvalidInverseNormalisation3D() {
+    void testInvalidInverseNormalisation3D() {
         testInvalidInverseNormalisationND(3);
     }
 
@@ -163,7 +163,7 @@ public class UnitBallSamplerTest {
      * Test the edge case where the normalisation sum to divide by is zero for 4D.
      */
     @Test
-    public void testInvalidInverseNormalisation4D() {
+    void testInvalidInverseNormalisation4D() {
         testInvalidInverseNormalisationND(4);
     }
 
@@ -194,7 +194,7 @@ public class UnitBallSamplerTest {
      * Test the SharedStateSampler implementation for 1D.
      */
     @Test
-    public void testSharedStateSampler1D() {
+    void testSharedStateSampler1D() {
         testSharedStateSampler(1);
     }
 
@@ -202,7 +202,7 @@ public class UnitBallSamplerTest {
      * Test the SharedStateSampler implementation for 2D.
      */
     @Test
-    public void testSharedStateSampler2D() {
+    void testSharedStateSampler2D() {
         testSharedStateSampler(2);
     }
 
@@ -210,7 +210,7 @@ public class UnitBallSamplerTest {
      * Test the SharedStateSampler implementation for 3D.
      */
     @Test
-    public void testSharedStateSampler3D() {
+    void testSharedStateSampler3D() {
         testSharedStateSampler(3);
     }
 
@@ -218,7 +218,7 @@ public class UnitBallSamplerTest {
      * Test the SharedStateSampler implementation for 4D.
      */
     @Test
-    public void testSharedStateSampler4D() {
+    void testSharedStateSampler4D() {
         testSharedStateSampler(4);
     }
 
@@ -268,7 +268,7 @@ public class UnitBallSamplerTest {
      * within the n-ball.
      */
     @Test
-    public void checkVolumeFunctions() {
+    void checkVolumeFunctions() {
         final double[] radii = {0, 0.1, 0.25, 0.5, 0.75, 1.0};
         for (int n = 1; n <= 6; n++) {
             final DoubleUnaryOperator volume = createVolumeFunction(n);
diff --git a/commons-rng-simple/src/test/java/org/apache/commons/rng/simple/JDKRandomBridgeTest.java b/commons-rng-simple/src/test/java/org/apache/commons/rng/simple/JDKRandomBridgeTest.java
index d470b6c..76bab16 100644
--- a/commons-rng-simple/src/test/java/org/apache/commons/rng/simple/JDKRandomBridgeTest.java
+++ b/commons-rng-simple/src/test/java/org/apache/commons/rng/simple/JDKRandomBridgeTest.java
@@ -28,9 +28,9 @@ import org.junit.jupiter.api.Test;
 /**
  * Tests for the {@link JDKRandomBridge} adaptor class.
  */
-public class JDKRandomBridgeTest {
+class JDKRandomBridgeTest {
     @Test
-    public void testJDKRandomEquivalence() {
+    void testJDKRandomEquivalence() {
         // Initialize.
         final long seed = RandomSource.createLong();
         final Random rng1 = new Random(seed);
@@ -46,7 +46,7 @@ public class JDKRandomBridgeTest {
     }
 
     @Test
-    public void testSerialization()
+    void testSerialization()
         throws IOException,
                ClassNotFoundException {
         // Initialize.
diff --git a/commons-rng-simple/src/test/java/org/apache/commons/rng/simple/JDKRandomWrapperTest.java b/commons-rng-simple/src/test/java/org/apache/commons/rng/simple/JDKRandomWrapperTest.java
index 0cdd20b..54b057b 100644
--- a/commons-rng-simple/src/test/java/org/apache/commons/rng/simple/JDKRandomWrapperTest.java
+++ b/commons-rng-simple/src/test/java/org/apache/commons/rng/simple/JDKRandomWrapperTest.java
@@ -26,12 +26,12 @@ import org.junit.jupiter.api.Test;
 /**
  * Tests for the {@link JDKRandomWrapper} class.
  */
-public class JDKRandomWrapperTest {
+class JDKRandomWrapperTest {
     /**
      * Test all the methods shared by Random and UniformRandomProvider are equivalent.
      */
     @Test
-    public void testJDKRandomEquivalence() {
+    void testJDKRandomEquivalence() {
         // Initialize.
         final long seed = RandomSource.createLong();
         final Random rng1 = new Random(seed);
@@ -89,7 +89,7 @@ public class JDKRandomWrapperTest {
      * BaseProvider implementation.
      */
     @Test
-    public void testNextLongInRange() {
+    void testNextLongInRange() {
         final long seed = RandomSource.createLong();
         // This will use the RNG core BaseProvider implementation.
         // Use a LongProvider to directly use the Random::nextLong method
@@ -121,7 +121,7 @@ public class JDKRandomWrapperTest {
     }
 
     @Test
-    public void testNextLongInRangeThrows() {
+    void testNextLongInRangeThrows() {
         final UniformRandomProvider rng1 = new JDKRandomWrapper(new Random(5675767L));
         Assertions.assertThrows(IllegalArgumentException.class, () -> rng1.nextLong(0));
     }
@@ -131,7 +131,7 @@ public class JDKRandomWrapperTest {
      * {@link Random#nextBytes(byte[])}.
      */
     @Test
-    public void testNextByteInRange() {
+    void testNextByteInRange() {
         final long seed = RandomSource.createLong();
         final Random rng1 = new Random(seed);
         final UniformRandomProvider rng2 = new JDKRandomWrapper(new Random(seed));
diff --git a/commons-rng-simple/src/test/java/org/apache/commons/rng/simple/ProvidersCommonParametricTest.java b/commons-rng-simple/src/test/java/org/apache/commons/rng/simple/ProvidersCommonParametricTest.java
index 80b2405..c4d95cc 100644
--- a/commons-rng-simple/src/test/java/org/apache/commons/rng/simple/ProvidersCommonParametricTest.java
+++ b/commons-rng-simple/src/test/java/org/apache/commons/rng/simple/ProvidersCommonParametricTest.java
@@ -42,7 +42,7 @@ import org.apache.commons.rng.core.source64.SplitMix64;
 /**
  * Tests which all generators must pass.
  */
-public class ProvidersCommonParametricTest {
+class ProvidersCommonParametricTest {
     private static Iterable<ProvidersList.Data> getProvidersTestData() {
         return ProvidersList.list();
     }
@@ -51,7 +51,7 @@ public class ProvidersCommonParametricTest {
 
     @ParameterizedTest
     @MethodSource("getProvidersTestData")
-    public void testUnsupportedSeedType(ProvidersList.Data data) {
+    void testUnsupportedSeedType(ProvidersList.Data data) {
         final byte seed = 123;
         Assertions.assertThrows(UnsupportedOperationException.class,
             () -> data.getSource().create(seed, data.getArgs()));
@@ -62,7 +62,7 @@ public class ProvidersCommonParametricTest {
      */
     @ParameterizedTest
     @MethodSource("getProvidersTestData")
-    public void testFactoryCreateMethod(ProvidersList.Data data) {
+    void testFactoryCreateMethod(ProvidersList.Data data) {
         final RandomSource originalSource = data.getSource();
         final Object originalSeed = data.getSeed();
         final Object[] originalArgs = data.getArgs();
@@ -80,7 +80,7 @@ public class ProvidersCommonParametricTest {
      */
     @ParameterizedTest
     @MethodSource("getProvidersTestData")
-    public void testFactoryCreateMethodWithSeed(ProvidersList.Data data) {
+    void testFactoryCreateMethodWithSeed(ProvidersList.Data data) {
         final RandomSource originalSource = data.getSource();
         final Object originalSeed = data.getSeed();
         final Object[] originalArgs = data.getArgs();
@@ -101,7 +101,7 @@ public class ProvidersCommonParametricTest {
      */
     @ParameterizedTest
     @MethodSource("getProvidersTestData")
-    public void testCreateMethodThrowsWithIncorrectArguments(ProvidersList.Data data) {
+    void testCreateMethodThrowsWithIncorrectArguments(ProvidersList.Data data) {
         final RandomSource originalSource = data.getSource();
         final Object[] originalArgs = data.getArgs();
         if (originalArgs == null) {
@@ -121,7 +121,7 @@ public class ProvidersCommonParametricTest {
 
     @ParameterizedTest
     @MethodSource("getProvidersTestData")
-    public void testAllSeedTypes(ProvidersList.Data data) {
+    void testAllSeedTypes(ProvidersList.Data data) {
         final RandomSource originalSource = data.getSource();
         final Object originalSeed = data.getSeed();
         final Object[] originalArgs = data.getArgs();
@@ -159,7 +159,7 @@ public class ProvidersCommonParametricTest {
 
     @ParameterizedTest
     @MethodSource("getProvidersTestData")
-    public void testNullSeed(ProvidersList.Data data) {
+    void testNullSeed(ProvidersList.Data data) {
         final RandomSource originalSource = data.getSource();
         final Object[] originalArgs = data.getArgs();
         // Note: This is the only test that explicitly calls RandomSource.create() with no other arguments.
@@ -171,7 +171,7 @@ public class ProvidersCommonParametricTest {
 
     @ParameterizedTest
     @MethodSource("getProvidersTestData")
-    public void testEmptyIntArraySeed(ProvidersList.Data data) {
+    void testEmptyIntArraySeed(ProvidersList.Data data) {
         final RandomSource originalSource = data.getSource();
         final Object[] originalArgs = data.getArgs();
         final int[] empty = new int[0];
@@ -184,7 +184,7 @@ public class ProvidersCommonParametricTest {
 
     @ParameterizedTest
     @MethodSource("getProvidersTestData")
-    public void testEmptyLongArraySeed(ProvidersList.Data data) {
+    void testEmptyLongArraySeed(ProvidersList.Data data) {
         final RandomSource originalSource = data.getSource();
         final Object[] originalArgs = data.getArgs();
         final long[] empty = new long[0];
@@ -199,7 +199,7 @@ public class ProvidersCommonParametricTest {
 
     @ParameterizedTest
     @MethodSource("getProvidersTestData")
-    public void testZeroIntArraySeed(ProvidersList.Data data) {
+    void testZeroIntArraySeed(ProvidersList.Data data) {
         final RandomSource originalSource = data.getSource();
         final Object[] originalArgs = data.getArgs();
         // Exercise capacity to escape all "zero" state.
@@ -212,7 +212,7 @@ public class ProvidersCommonParametricTest {
 
     @ParameterizedTest
     @MethodSource("getProvidersTestData")
-    public void testZeroLongArraySeed(ProvidersList.Data data) {
+    void testZeroLongArraySeed(ProvidersList.Data data) {
         final RandomSource originalSource = data.getSource();
         final Object[] originalArgs = data.getArgs();
         // Exercise capacity to escape all "zero" state.
@@ -225,7 +225,7 @@ public class ProvidersCommonParametricTest {
 
     @ParameterizedTest
     @MethodSource("getProvidersTestData")
-    public void testRandomSourceCreateSeed(ProvidersList.Data data) {
+    void testRandomSourceCreateSeed(ProvidersList.Data data) {
         final RandomSource originalSource = data.getSource();
         final Object[] originalArgs = data.getArgs();
         final byte[] seed = originalSource.createSeed();
@@ -235,7 +235,7 @@ public class ProvidersCommonParametricTest {
 
     @ParameterizedTest
     @MethodSource("getProvidersTestData")
-    public void testRandomSourceCreateSeedFromRNG(ProvidersList.Data data) {
+    void testRandomSourceCreateSeedFromRNG(ProvidersList.Data data) {
         final RandomSource originalSource = data.getSource();
         final Object[] originalArgs = data.getArgs();
         final byte[] seed = originalSource.createSeed(new SplitMix64(RandomSource.createLong()));
@@ -248,7 +248,7 @@ public class ProvidersCommonParametricTest {
     @SuppressWarnings("unused")
     @ParameterizedTest
     @MethodSource("getProvidersTestData")
-    public void testUnrestorable(ProvidersList.Data data) {
+    void testUnrestorable(ProvidersList.Data data) {
         final RandomSource originalSource = data.getSource();
         final Object originalSeed = data.getSeed();
         final Object[] originalArgs = data.getArgs();
@@ -269,7 +269,7 @@ public class ProvidersCommonParametricTest {
 
     @ParameterizedTest
     @MethodSource("getProvidersTestData")
-    public void testSerializingState(ProvidersList.Data data)
+    void testSerializingState(ProvidersList.Data data)
         throws IOException,
                ClassNotFoundException {
         final UniformRandomProvider generator = data.getSource().create(data.getSeed(), data.getArgs());
@@ -315,7 +315,7 @@ public class ProvidersCommonParametricTest {
 
     @ParameterizedTest
     @MethodSource("getProvidersTestData")
-    public void testUnrestorableToString(ProvidersList.Data data) {
+    void testUnrestorableToString(ProvidersList.Data data) {
         final UniformRandomProvider generator = data.getSource().create(data.getSeed(), data.getArgs());
         Assertions.assertEquals(generator.toString(),
                                 RandomSource.unrestorable(generator).toString());
@@ -323,7 +323,7 @@ public class ProvidersCommonParametricTest {
 
     @ParameterizedTest
     @MethodSource("getProvidersTestData")
-    public void testSupportedInterfaces(ProvidersList.Data data) {
+    void testSupportedInterfaces(ProvidersList.Data data) {
         final RandomSource originalSource = data.getSource();
         final Object[] originalArgs = data.getArgs();
         final UniformRandomProvider rng = originalSource.create(null, originalArgs);
diff --git a/commons-rng-simple/src/test/java/org/apache/commons/rng/simple/RandomSourceTest.java b/commons-rng-simple/src/test/java/org/apache/commons/rng/simple/RandomSourceTest.java
index 1b884e6..e5e7ea7 100644
--- a/commons-rng-simple/src/test/java/org/apache/commons/rng/simple/RandomSourceTest.java
+++ b/commons-rng-simple/src/test/java/org/apache/commons/rng/simple/RandomSourceTest.java
@@ -22,9 +22,9 @@ import org.junit.jupiter.api.Test;
 /**
  * Tests for {@link RandomSource}.
  */
-public class RandomSourceTest {
+class RandomSourceTest {
     @Test
-    public void testCreateInt() {
+    void testCreateInt() {
         final int n = 4;
         for (int i = 0; i < n; i++) {
             // Can fail, but unlikely given the range.
@@ -34,7 +34,7 @@ public class RandomSourceTest {
     }
 
     @Test
-    public void testCreateLong() {
+    void testCreateLong() {
         final int n = 6;
         for (int i = 0; i < n; i++) {
             // Can fail, but unlikely given the range.
@@ -44,7 +44,7 @@ public class RandomSourceTest {
     }
 
     @Test
-    public void testCreateIntArray() {
+    void testCreateIntArray() {
         final int n = 13;
         final int[] seed = RandomSource.createIntArray(n);
         Assertions.assertEquals(n, seed.length);
@@ -56,7 +56,7 @@ public class RandomSourceTest {
     }
 
     @Test
-    public void testCreateLongArray() {
+    void testCreateLongArray() {
         final int n = 9;
         final long[] seed = RandomSource.createLongArray(n);
         Assertions.assertEquals(n, seed.length);
@@ -68,14 +68,14 @@ public class RandomSourceTest {
     }
 
     @Test
-    public void testIsJumpable() {
+    void testIsJumpable() {
         Assertions.assertFalse(RandomSource.JDK.isJumpable(), "JDK is not Jumpable");
         Assertions.assertTrue(RandomSource.XOR_SHIFT_1024_S_PHI.isJumpable(), "XOR_SHIFT_1024_S_PHI is Jumpable");
         Assertions.assertTrue(RandomSource.XO_SHI_RO_256_SS.isJumpable(), "XO_SHI_RO_256_SS is Jumpable");
     }
 
     @Test
-    public void testIsLongJumpable() {
+    void testIsLongJumpable() {
         Assertions.assertFalse(RandomSource.JDK.isLongJumpable(), "JDK is not LongJumpable");
         Assertions.assertFalse(RandomSource.XOR_SHIFT_1024_S_PHI.isLongJumpable(), "XOR_SHIFT_1024_S_PHI is not LongJumpable");
         Assertions.assertTrue(RandomSource.XO_SHI_RO_256_SS.isLongJumpable(), "XO_SHI_RO_256_SS is LongJumpable");
diff --git a/commons-rng-simple/src/test/java/org/apache/commons/rng/simple/ThreadLocalRandomSourceTest.java b/commons-rng-simple/src/test/java/org/apache/commons/rng/simple/ThreadLocalRandomSourceTest.java
index 78fb31b..394452e 100644
--- a/commons-rng-simple/src/test/java/org/apache/commons/rng/simple/ThreadLocalRandomSourceTest.java
+++ b/commons-rng-simple/src/test/java/org/apache/commons/rng/simple/ThreadLocalRandomSourceTest.java
@@ -32,7 +32,7 @@ import java.util.concurrent.TimeoutException;
 /**
  * Tests for {@link ThreadLocalRandomSource}.
  */
-public class ThreadLocalRandomSourceTest {
+class ThreadLocalRandomSourceTest {
     /**
      * A set of all the RandomSource options that requires arguments. This should be
      * ignored in certain tests since they are not supported.
@@ -45,18 +45,18 @@ public class ThreadLocalRandomSourceTest {
     }
 
     @Test
-    public void testCurrentThrowsForNullRandomSource() {
+    void testCurrentThrowsForNullRandomSource() {
         Assertions.assertThrows(IllegalArgumentException.class, () -> ThreadLocalRandomSource.current(null));
     }
 
     @Test
-    public void testCurrentThrowsForRandomSourceWithDataArguments() {
+    void testCurrentThrowsForRandomSourceWithDataArguments() {
         Assertions.assertThrows(IllegalArgumentException.class,
             () -> ThreadLocalRandomSource.current(RandomSource.TWO_CMRES_SELECT));
     }
 
     @Test
-    public void testCurrentForAllRandomSources()
+    void testCurrentForAllRandomSources()
             throws InterruptedException, ExecutionException, TimeoutException {
         final RandomSource[] sources = RandomSource.values();
         final UniformRandomProvider[] rngs = new UniformRandomProvider[sources.length];
diff --git a/commons-rng-simple/src/test/java/org/apache/commons/rng/simple/internal/ByteArray2IntArrayTest.java b/commons-rng-simple/src/test/java/org/apache/commons/rng/simple/internal/ByteArray2IntArrayTest.java
index d9f0ccc..0b21364 100644
--- a/commons-rng-simple/src/test/java/org/apache/commons/rng/simple/internal/ByteArray2IntArrayTest.java
+++ b/commons-rng-simple/src/test/java/org/apache/commons/rng/simple/internal/ByteArray2IntArrayTest.java
@@ -22,16 +22,16 @@ import org.junit.jupiter.api.Test;
 /**
  * Tests for the {@link ByteArray2IntArray} converter.
  */
-public class ByteArray2IntArrayTest {
+class ByteArray2IntArrayTest {
     @Test
-    public void testSeedSizeIsMultipleOfIntSize() {
+    void testSeedSizeIsMultipleOfIntSize() {
         final byte[] seed = new byte[128];
         final int[] out = new ByteArray2IntArray().convert(seed);
         Assertions.assertEquals(32, out.length);
     }
 
     @Test
-    public void testSeedSizeIsNotMultipleOfIntSize() {
+    void testSeedSizeIsNotMultipleOfIntSize() {
         final int len = 16;
         final ByteArray2IntArray conv = new ByteArray2IntArray();
         for (int i = 1; i < 4; i++) {
diff --git a/commons-rng-simple/src/test/java/org/apache/commons/rng/simple/internal/ByteArray2LongArrayTest.java b/commons-rng-simple/src/test/java/org/apache/commons/rng/simple/internal/ByteArray2LongArrayTest.java
index 135343e..6678014 100644
--- a/commons-rng-simple/src/test/java/org/apache/commons/rng/simple/internal/ByteArray2LongArrayTest.java
+++ b/commons-rng-simple/src/test/java/org/apache/commons/rng/simple/internal/ByteArray2LongArrayTest.java
@@ -22,16 +22,16 @@ import org.junit.jupiter.api.Test;
 /**
  * Tests for the {@link ByteArray2LongArray} converter.
  */
-public class ByteArray2LongArrayTest {
+class ByteArray2LongArrayTest {
     @Test
-    public void testSeedSizeIsMultipleOfLongSize() {
+    void testSeedSizeIsMultipleOfLongSize() {
         final byte[] seed = new byte[128];
         final long[] out = new ByteArray2LongArray().convert(seed);
         Assertions.assertEquals(16, out.length);
     }
 
     @Test
-    public void testSeedSizeIsNotMultipleOfLongSize() {
+    void testSeedSizeIsNotMultipleOfLongSize() {
         final int len = 16;
         final ByteArray2LongArray conv = new ByteArray2LongArray();
         for (int i = 1; i < 8; i++) {
diff --git a/commons-rng-simple/src/test/java/org/apache/commons/rng/simple/internal/IntArray2LongArrayTest.java b/commons-rng-simple/src/test/java/org/apache/commons/rng/simple/internal/IntArray2LongArrayTest.java
index dacc593..e1c66e2 100644
--- a/commons-rng-simple/src/test/java/org/apache/commons/rng/simple/internal/IntArray2LongArrayTest.java
+++ b/commons-rng-simple/src/test/java/org/apache/commons/rng/simple/internal/IntArray2LongArrayTest.java
@@ -22,16 +22,16 @@ import org.junit.jupiter.api.Test;
 /**
  * Tests for the {@link IntArray2LongArray} converter.
  */
-public class IntArray2LongArrayTest {
+class IntArray2LongArrayTest {
     @Test
-    public void testSeedSizeIsMultipleOfLongSize() {
+    void testSeedSizeIsMultipleOfLongSize() {
         final int[] seed = new int[12];
         final long[] out = new IntArray2LongArray().convert(seed);
         Assertions.assertEquals(6, out.length);
     }
 
     @Test
-    public void testSeedSizeIsNotMultipleOfLongSize() {
+    void testSeedSizeIsNotMultipleOfLongSize() {
         final int[] seed = new int[13];
         final long[] out = new IntArray2LongArray().convert(seed);
         Assertions.assertEquals(7, out.length);
diff --git a/commons-rng-simple/src/test/java/org/apache/commons/rng/simple/internal/Long2IntArrayTest.java b/commons-rng-simple/src/test/java/org/apache/commons/rng/simple/internal/Long2IntArrayTest.java
index 8d49ceb..75ede0b 100644
--- a/commons-rng-simple/src/test/java/org/apache/commons/rng/simple/internal/Long2IntArrayTest.java
+++ b/commons-rng-simple/src/test/java/org/apache/commons/rng/simple/internal/Long2IntArrayTest.java
@@ -22,9 +22,9 @@ import org.junit.jupiter.api.Test;
 /**
  * Tests for the {@link Long2IntArray} converter.
  */
-public class Long2IntArrayTest {
+class Long2IntArrayTest {
     @Test
-    public void testFixedLengthConversion() {
+    void testFixedLengthConversion() {
         for (int length = 0; length < 10; length++) {
             testFixedLengthConversion(length);
         }
diff --git a/commons-rng-simple/src/test/java/org/apache/commons/rng/simple/internal/Long2LongArrayTest.java b/commons-rng-simple/src/test/java/org/apache/commons/rng/simple/internal/Long2LongArrayTest.java
index 20920fa..9416482 100644
--- a/commons-rng-simple/src/test/java/org/apache/commons/rng/simple/internal/Long2LongArrayTest.java
+++ b/commons-rng-simple/src/test/java/org/apache/commons/rng/simple/internal/Long2LongArrayTest.java
@@ -22,9 +22,9 @@ import org.junit.jupiter.api.Test;
 /**
  * Tests for the {@link Long2LongArray} converter.
  */
-public class Long2LongArrayTest {
+class Long2LongArrayTest {
     @Test
-    public void testFixedLengthConversion() {
+    void testFixedLengthConversion() {
         final Long seed = 567L;
         final int length = 3;
         final long[] out = new Long2LongArray(length).convert(seed);
diff --git a/commons-rng-simple/src/test/java/org/apache/commons/rng/simple/internal/NativeSeedTypeParametricTest.java b/commons-rng-simple/src/test/java/org/apache/commons/rng/simple/internal/NativeSeedTypeParametricTest.java
index 67522d1..1022d3c 100644
--- a/commons-rng-simple/src/test/java/org/apache/commons/rng/simple/internal/NativeSeedTypeParametricTest.java
+++ b/commons-rng-simple/src/test/java/org/apache/commons/rng/simple/internal/NativeSeedTypeParametricTest.java
@@ -32,7 +32,7 @@ import java.util.stream.Collectors;
  * ensures that a seed can be created or converted from any supported input seed to each
  * supported native seed type.
  */
-public class NativeSeedTypeParametricTest {
+class NativeSeedTypeParametricTest {
     /** This is a list of the class types that are supported native seeds. */
     private static final Object[] SUPPORTED_NATIVE_TYPES = {
         Integer.class,
@@ -59,7 +59,7 @@ public class NativeSeedTypeParametricTest {
      * This ensures the test is maintained to correspond to the enum.
      */
     @Test
-    public void testNativeSeedTypeEnum() {
+    void testNativeSeedTypeEnum() {
         Set<Class<?>> supported = Arrays.stream(SUPPORTED_NATIVE_TYPES)
             .map(o -> (Class<?>) o)
             .collect(Collectors.toSet());
@@ -82,7 +82,7 @@ public class NativeSeedTypeParametricTest {
      */
     @ParameterizedTest
     @EnumSource
-    public void testCreateSeed(NativeSeedType nativeSeedType) {
+    void testCreateSeed(NativeSeedType nativeSeedType) {
         final int size = 3;
         final Object seed = nativeSeedType.createSeed(size);
         Assertions.assertNotNull(seed);
@@ -100,7 +100,7 @@ public class NativeSeedTypeParametricTest {
      */
     @ParameterizedTest
     @EnumSource
-    public void testConvertSeedToBytes(NativeSeedType nativeSeedType) {
+    void testConvertSeedToBytes(NativeSeedType nativeSeedType) {
         final int size = 3;
         final Object seed = nativeSeedType.createSeed(size);
         Assertions.assertNotNull(seed, "Null seed");
@@ -125,7 +125,7 @@ public class NativeSeedTypeParametricTest {
      */
     @ParameterizedTest
     @EnumSource
-    public void testConvertSupportedSeed(NativeSeedType nativeSeedType) {
+    void testConvertSupportedSeed(NativeSeedType nativeSeedType) {
         // Size can be ignored during conversion and so it not asserted
         final int size = 3;
         for (final Object input : SUPPORTED_SEEDS) {
@@ -143,7 +143,7 @@ public class NativeSeedTypeParametricTest {
      */
     @ParameterizedTest
     @EnumSource
-    public void testCannotConvertUnsupportedSeed(NativeSeedType nativeSeedType) {
+    void testCannotConvertUnsupportedSeed(NativeSeedType nativeSeedType) {
         final int size = 3;
         for (final Object input : UNSUPPORTED_SEEDS) {
             Assertions.assertThrows(UnsupportedOperationException.class,
diff --git a/commons-rng-simple/src/test/java/org/apache/commons/rng/simple/internal/NativeSeedTypeTest.java b/commons-rng-simple/src/test/java/org/apache/commons/rng/simple/internal/NativeSeedTypeTest.java
index 6b9b3d6..54ded36 100644
--- a/commons-rng-simple/src/test/java/org/apache/commons/rng/simple/internal/NativeSeedTypeTest.java
+++ b/commons-rng-simple/src/test/java/org/apache/commons/rng/simple/internal/NativeSeedTypeTest.java
@@ -22,13 +22,13 @@ import org.junit.jupiter.api.Test;
 /**
  * Tests for the {@link NativeSeedType} factory seed conversions.
  */
-public class NativeSeedTypeTest {
+class NativeSeedTypeTest {
     /**
      * Test the conversion throws for an unsupported type. All supported types are
      * tested in the {@link NativeSeedTypeParametricTest}.
      */
     @Test
-    public void testConvertSeedToBytesUsingNullThrows() {
+    void testConvertSeedToBytesUsingNullThrows() {
         Assertions.assertThrows(UnsupportedOperationException.class, () -> NativeSeedType.convertSeedToBytes(null));
     }
 
@@ -37,7 +37,7 @@ public class NativeSeedTypeTest {
      * that can be converted that is not a native type.
      */
     @Test
-    public void testConvertSeedToBytesUsingByteArray() {
+    void testConvertSeedToBytesUsingByteArray() {
         final byte[] seed = {42, 78, 99};
         Assertions.assertSame(seed, NativeSeedType.convertSeedToBytes(seed));
     }
diff --git a/commons-rng-simple/src/test/java/org/apache/commons/rng/simple/internal/NoOpConverterTest.java b/commons-rng-simple/src/test/java/org/apache/commons/rng/simple/internal/NoOpConverterTest.java
index d74bbc6..523059c 100644
--- a/commons-rng-simple/src/test/java/org/apache/commons/rng/simple/internal/NoOpConverterTest.java
+++ b/commons-rng-simple/src/test/java/org/apache/commons/rng/simple/internal/NoOpConverterTest.java
@@ -22,16 +22,16 @@ import org.junit.jupiter.api.Test;
 /**
  * Tests for the {@link NoOpConverter}.
  */
-public class NoOpConverterTest {
+class NoOpConverterTest {
     @Test
-    public void testNoOpIntegerCoversion() {
+    void testNoOpIntegerCoversion() {
         final NoOpConverter<Integer> converter = new NoOpConverter<Integer>();
         final Integer in = 123;
         Assertions.assertSame(in, converter.convert(in));
     }
 
     @Test
-    public void testNoOpLongArrayCoversion() {
+    void testNoOpLongArrayCoversion() {
         final NoOpConverter<long[]> converter = new NoOpConverter<long[]>();
         final long[] in = {123L, 456L, Long.MAX_VALUE};
         Assertions.assertSame(in, converter.convert(in));
diff --git a/commons-rng-simple/src/test/java/org/apache/commons/rng/simple/internal/RandomSourceInternalParametricTest.java b/commons-rng-simple/src/test/java/org/apache/commons/rng/simple/internal/RandomSourceInternalParametricTest.java
index a1f1b53..9b1d332 100644
--- a/commons-rng-simple/src/test/java/org/apache/commons/rng/simple/internal/RandomSourceInternalParametricTest.java
+++ b/commons-rng-simple/src/test/java/org/apache/commons/rng/simple/internal/RandomSourceInternalParametricTest.java
@@ -30,7 +30,7 @@ import java.util.function.Supplier;
  * ensures that all random sources can create a seed or convert any supported seed to the
  * correct type for the constructor.
  */
-public class RandomSourceInternalParametricTest {
+class RandomSourceInternalParametricTest {
     /** The supported seeds for conversion to a native seed type. */
     private static final Object[] SUPPORTED_SEEDS = {
         Integer.valueOf(1),
@@ -119,7 +119,7 @@ public class RandomSourceInternalParametricTest {
      */
     @ParameterizedTest
     @EnumSource
-    public void testCreateSeed(RandomSourceInternal randomSourceInternal) {
+    void testCreateSeed(RandomSourceInternal randomSourceInternal) {
         final Class<?> type = getType(randomSourceInternal);
         final Object seed = randomSourceInternal.createSeed();
         Assertions.assertNotNull(seed);
@@ -134,7 +134,7 @@ public class RandomSourceInternalParametricTest {
      */
     @ParameterizedTest
     @EnumSource
-    public void testConvertSupportedSeed(RandomSourceInternal randomSourceInternal) {
+    void testConvertSupportedSeed(RandomSourceInternal randomSourceInternal) {
         final Class<?> type = getType(randomSourceInternal);
         for (final Object input : SUPPORTED_SEEDS) {
             final Object seed = randomSourceInternal.convertSeed(input);
@@ -152,7 +152,7 @@ public class RandomSourceInternalParametricTest {
      */
     @ParameterizedTest
     @EnumSource
-    public void testCannotConvertUnsupportedSeed(RandomSourceInternal randomSourceInternal) {
+    void testCannotConvertUnsupportedSeed(RandomSourceInternal randomSourceInternal) {
         for (final Object input : UNSUPPORTED_SEEDS) {
             Assertions.assertThrows(UnsupportedOperationException.class,
                 () -> randomSourceInternal.convertSeed(input),
@@ -168,7 +168,7 @@ public class RandomSourceInternalParametricTest {
      */
     @ParameterizedTest
     @EnumSource
-    public void testCreateSeedBytesSizeIsPositiveAndMultipleOf4Or8(RandomSourceInternal randomSourceInternal) {
+    void testCreateSeedBytesSizeIsPositiveAndMultipleOf4Or8(RandomSourceInternal randomSourceInternal) {
         // This should be the full length seed
         final byte[] seed = randomSourceInternal.createSeedBytes(new SplitMix64(12345L));
 
@@ -200,7 +200,7 @@ public class RandomSourceInternalParametricTest {
      */
     @ParameterizedTest
     @EnumSource
-    public void testCreateSeedBytes(RandomSourceInternal randomSourceInternal) {
+    void testCreateSeedBytes(RandomSourceInternal randomSourceInternal) {
         // This should be the full length seed
         final byte[] seed = randomSourceInternal.createSeedBytes(new SplitMix64(12345L));
         final int size = seed.length;
diff --git a/commons-rng-simple/src/test/java/org/apache/commons/rng/simple/internal/SeedConverterComposerTest.java b/commons-rng-simple/src/test/java/org/apache/commons/rng/simple/internal/SeedConverterComposerTest.java
index 610cab9..5f91543 100644
--- a/commons-rng-simple/src/test/java/org/apache/commons/rng/simple/internal/SeedConverterComposerTest.java
+++ b/commons-rng-simple/src/test/java/org/apache/commons/rng/simple/internal/SeedConverterComposerTest.java
@@ -22,9 +22,9 @@ import org.junit.jupiter.api.Test;
 /**
  * Tests for the {@link SeedConverterComposer}.
  */
-public class SeedConverterComposerTest {
+class SeedConverterComposerTest {
     @Test
-    public void testComposedCoversion() {
+    void testComposedCoversion() {
         final Int2Long int2Long = new Int2Long();
         final Long2LongArray long2LongArray = new Long2LongArray(3);
         final SeedConverterComposer<Integer, Long, long[]> composer =
diff --git a/commons-rng-simple/src/test/java/org/apache/commons/rng/simple/internal/SeedFactoryTest.java b/commons-rng-simple/src/test/java/org/apache/commons/rng/simple/internal/SeedFactoryTest.java
index 6e60026..6c51b71 100644
--- a/commons-rng-simple/src/test/java/org/apache/commons/rng/simple/internal/SeedFactoryTest.java
+++ b/commons-rng-simple/src/test/java/org/apache/commons/rng/simple/internal/SeedFactoryTest.java
@@ -28,9 +28,9 @@ import org.apache.commons.rng.core.util.NumberFactory;
 /**
  * Tests for {@link SeedFactory}.
  */
-public class SeedFactoryTest {
+class SeedFactoryTest {
     @Test
-    public void testCreateLong() {
+    void testCreateLong() {
         final Map<Long, Integer> values = new HashMap<Long, Integer>();
 
         final int n = 100000;
@@ -49,7 +49,7 @@ public class SeedFactoryTest {
     }
 
     @Test
-    public void testCreateLongArray() {
+    void testCreateLongArray() {
         final Map<Long, Integer> values = new HashMap<Long, Integer>();
 
         final int n = 100000;
@@ -69,7 +69,7 @@ public class SeedFactoryTest {
     }
 
     @Test
-    public void testCreateIntArray() {
+    void testCreateIntArray() {
         final Map<Long, Integer> values = new HashMap<Long, Integer>();
 
         for (int i = 0; i < 50000; i++) {
@@ -114,13 +114,13 @@ public class SeedFactoryTest {
     }
 
     @Test
-    public void testCreateIntArrayWithCompleteBlockSize() {
+    void testCreateIntArrayWithCompleteBlockSize() {
         // Block size is 8 for int
         assertCreateIntArray(8);
     }
 
     @Test
-    public void testCreateIntArrayWithIncompleteBlockSize() {
+    void testCreateIntArrayWithIncompleteBlockSize() {
         // Block size is 8 for int
         assertCreateIntArray(8 + 1);
     }
@@ -145,13 +145,13 @@ public class SeedFactoryTest {
     }
 
     @Test
-    public void testCreateLongArrayWithCompleteBlockSize() {
+    void testCreateLongArrayWithCompleteBlockSize() {
         // Block size is 4 for long
         assertCreateLongArray(4);
     }
 
     @Test
-    public void testCreateLongArrayWithIncompleteBlockSize() {
+    void testCreateLongArrayWithIncompleteBlockSize() {
         // Block size is 4 for long
         assertCreateLongArray(4 + 1);
     }
@@ -208,12 +208,12 @@ public class SeedFactoryTest {
     }
 
     @Test
-    public void testCreateByteArrayWithSizeZero() {
+    void testCreateByteArrayWithSizeZero() {
         assertCreateByteArray(new byte[0]);
     }
 
     @Test
-    public void testCreateByteArrayIgnoresNonZeroPositions() {
+    void testCreateByteArrayIgnoresNonZeroPositions() {
         final byte position = 123;
         int n = 3;
         for (int i = 0; i < n; i++) {
@@ -248,7 +248,7 @@ public class SeedFactoryTest {
     }
 
     @Test
-    public void testCreateByteArrayWithAllZeroBytesUpdatesPosition0() {
+    void testCreateByteArrayWithAllZeroBytesUpdatesPosition0() {
         final UniformRandomProvider rng = new IntProvider() {
             @Override
             public int next() {
@@ -265,7 +265,7 @@ public class SeedFactoryTest {
     }
 
     @Test
-    public void testEnsureNonZeroIntArrayIgnoresEmptySeed() {
+    void testEnsureNonZeroIntArrayIgnoresEmptySeed() {
         final int[] seed = new int[0];
         SeedFactory.ensureNonZero(seed);
         // Note: Nothing to assert.
@@ -273,7 +273,7 @@ public class SeedFactoryTest {
     }
 
     @Test
-    public void testEnsureNonZeroIntArrayIgnoresNonZeroPosition0() {
+    void testEnsureNonZeroIntArrayIgnoresNonZeroPosition0() {
         final int position0 = 123;
         final int[] seed = new int[] {position0, 0, 0, 0};
         final int[] before = seed.clone();
@@ -285,7 +285,7 @@ public class SeedFactoryTest {
     }
 
     @Test
-    public void testEnsureNonZeroIntArrayUpdatesZeroPosition0() {
+    void testEnsureNonZeroIntArrayUpdatesZeroPosition0() {
         // Test the method replaces position 0 even if the rest of the array is non-zero
         final int[] seed = new int[] {0, 123, 456, 789};
         final int[] before = seed.clone();
@@ -297,7 +297,7 @@ public class SeedFactoryTest {
     }
 
     @Test
-    public void testEnsureNonZeroLongArrayIgnoresEmptySeed() {
+    void testEnsureNonZeroLongArrayIgnoresEmptySeed() {
         final long[] seed = new long[0];
         SeedFactory.ensureNonZero(seed);
         // Note: Nothing to assert.
@@ -305,7 +305,7 @@ public class SeedFactoryTest {
     }
 
     @Test
-    public void testEnsureNonZeroLongArrayIgnoresNonZeroPosition0() {
+    void testEnsureNonZeroLongArrayIgnoresNonZeroPosition0() {
         final long position0 = 123;
         final long[] seed = new long[] {position0, 0, 0, 0};
         final long[] before = seed.clone();
@@ -317,7 +317,7 @@ public class SeedFactoryTest {
     }
 
     @Test
-    public void testEnsureNonZeroLongArrayUpdatesZeroPosition0() {
+    void testEnsureNonZeroLongArrayUpdatesZeroPosition0() {
         // Test the method replaces position 0 even if the rest of the array is non-zero
         final long[] seed = new long[] {0, 123, 456, 789};
         final long[] before = seed.clone();
@@ -329,7 +329,7 @@ public class SeedFactoryTest {
     }
 
     @Test
-    public void testEnsureNonZeroValue() {
+    void testEnsureNonZeroValue() {
         final long expected = 345;
         RandomLongSource source = new RandomLongSource() {
             @Override
diff --git a/commons-rng-simple/src/test/java/org/apache/commons/rng/simple/internal/SeedUtilsTest.java b/commons-rng-simple/src/test/java/org/apache/commons/rng/simple/internal/SeedUtilsTest.java
index 625329e..d87d941 100644
--- a/commons-rng-simple/src/test/java/org/apache/commons/rng/simple/internal/SeedUtilsTest.java
+++ b/commons-rng-simple/src/test/java/org/apache/commons/rng/simple/internal/SeedUtilsTest.java
@@ -28,14 +28,14 @@ import java.util.Arrays;
 /**
  * Tests for the {@link SeedUtils}.
  */
-public class SeedUtilsTest {
+class SeedUtilsTest {
     /**
      * Test the int hex permutation has 8 unique hex digits per permutation.
      * A uniformity test is performed on to check each hex digits is used evenly at each
      * character position.
      */
     @Test
-    public void testCreateIntHexPermutation() {
+    void testCreateIntHexPermutation() {
         final UniformRandomProvider rng = new SplitMix64(-567435247L);
         final long[][] samples = new long[8][16];
         for (int i = 0; i < 1000; i++) {
@@ -67,7 +67,7 @@ public class SeedUtilsTest {
      * character position.
      */
     @Test
-    public void testCreateLongHexPermutation() {
+    void testCreateLongHexPermutation() {
         final UniformRandomProvider rng = new SplitMix64(34645768L);
         final long[][] samples = new long[16][16];
         for (int i = 0; i < 1000; i++) {

[commons-rng] 04/13: RNG-163: Replace expected thrown exception with assertThrows

Posted by ah...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

aherbert pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/commons-rng.git

commit 5d4eb724fc174e9a7750d7730a3630fe6926e734
Author: Alex Herbert <ah...@apache.org>
AuthorDate: Sun Aug 15 16:11:53 2021 +0100

    RNG-163: Replace expected thrown exception with assertThrows
    
    Some multiple methods, one per exception, have been merged into a common
    method.
---
 .../apache/commons/rng/core/BaseProviderTest.java  | 10 ++-
 .../rng/core/ProvidersCommonParametricTest.java    | 61 ++++----------
 .../commons/rng/core/source32/JDKRandomTest.java   |  5 +-
 .../commons/rng/core/source64/TwoCmresTest.java    |  4 +-
 .../core/source64/XoRoShiRo128PlusPlusTest.java    |  5 +-
 .../commons/rng/examples/stress/HexTest.java       |  8 +-
 .../rng/sampling/CollectionSamplerTest.java        |  7 +-
 .../rng/sampling/CombinationSamplerTest.java       | 25 +++---
 .../rng/sampling/CompositeSamplersTest.java        | 10 ++-
 .../DiscreteProbabilityCollectionSamplerTest.java  | 91 ++++++++++++---------
 .../commons/rng/sampling/ListSamplerTest.java      | 10 ++-
 .../rng/sampling/PermutationSamplerTest.java       | 20 +++--
 .../rng/sampling/UnitSphereSamplerTest.java        | 25 +++---
 .../AhrensDieterExponentialSamplerTest.java        |  4 +-
 ...AhrensDieterMarsagliaTsangGammaSamplerTest.java | 10 ++-
 .../AliasMethodDiscreteSamplerTest.java            | 32 ++++----
 .../distribution/BoxMullerGaussianSamplerTest.java |  9 +-
 .../BoxMullerLogNormalSamplerTest.java             | 17 ++--
 .../distribution/ChengBetaSamplerTest.java         | 10 ++-
 .../distribution/DirichletSamplerTest.java         | 40 +++++----
 .../distribution/DiscreteUniformSamplerTest.java   |  5 +-
 .../sampling/distribution/GaussianSamplerTest.java | 36 ++++----
 .../distribution/GeometricSamplerTest.java         | 10 ++-
 .../GuideTableDiscreteSamplerTest.java             | 61 +++++++-------
 .../sampling/distribution/InternalUtilsTest.java   | 20 +++--
 .../InverseTransformParetoSamplerTest.java         | 11 ++-
 .../KempSmallMeanPoissonSamplerTest.java           | 24 +++---
 .../distribution/LargeMeanPoissonSamplerTest.java  | 28 ++++---
 .../rng/sampling/distribution/LevySamplerTest.java | 10 ++-
 .../distribution/LogNormalSamplerTest.java         | 21 +++--
 .../MarsagliaTsangWangDiscreteSamplerTest.java     | 95 +++++++++++-----------
 .../distribution/PoissonSamplerCacheTest.java      | 20 +++--
 .../RejectionInversionZipfSamplerTest.java         | 11 ++-
 .../distribution/SmallMeanPoissonSamplerTest.java  | 10 ++-
 .../sampling/distribution/StableSamplerTest.java   | 67 +++++++--------
 .../distribution/UniformLongSamplerTest.java       |  5 +-
 .../ZigguratNormalizedGaussianSamplerTest.java     |  6 +-
 .../sampling/distribution/ZigguratSamplerTest.java |  5 +-
 .../commons/rng/sampling/shape/BoxSamplerTest.java |  5 +-
 .../rng/sampling/shape/LineSamplerTest.java        |  5 +-
 .../rng/sampling/shape/TriangleSamplerTest.java    |  5 +-
 .../rng/sampling/shape/UnitBallSamplerTest.java    |  5 +-
 .../commons/rng/simple/JDKRandomWrapperTest.java   |  4 +-
 .../rng/simple/ProvidersCommonParametricTest.java  |  4 +-
 .../rng/simple/ThreadLocalRandomSourceTest.java    |  9 +-
 .../rng/simple/internal/NativeSeedTypeTest.java    |  4 +-
 46 files changed, 483 insertions(+), 406 deletions(-)

diff --git a/commons-rng-core/src/test/java/org/apache/commons/rng/core/BaseProviderTest.java b/commons-rng-core/src/test/java/org/apache/commons/rng/core/BaseProviderTest.java
index 070f4dc..1731bd8 100644
--- a/commons-rng-core/src/test/java/org/apache/commons/rng/core/BaseProviderTest.java
+++ b/commons-rng-core/src/test/java/org/apache/commons/rng/core/BaseProviderTest.java
@@ -29,19 +29,21 @@ import org.junit.jupiter.api.Assumptions;
  * tests too).
  */
 public class BaseProviderTest {
-    @Test(expected = IllegalStateException.class)
+    @Test
     public void testStateSizeTooSmall() {
         final DummyGenerator dummy = new DummyGenerator();
         final int size = dummy.getStateSize();
         Assumptions.assumeTrue(size > 0);
-        dummy.restoreState(new RandomProviderDefaultState(new byte[size - 1]));
+        final RandomProviderDefaultState state = new RandomProviderDefaultState(new byte[size - 1]);
+        Assertions.assertThrows(IllegalStateException.class, () -> dummy.restoreState(state));
     }
 
-    @Test(expected = IllegalStateException.class)
+    @Test
     public void testStateSizeTooLarge() {
         final DummyGenerator dummy = new DummyGenerator();
         final int size = dummy.getStateSize();
-        dummy.restoreState(new RandomProviderDefaultState(new byte[size + 1]));
+        final RandomProviderDefaultState state = new RandomProviderDefaultState(new byte[size + 1]);
+        Assertions.assertThrows(IllegalStateException.class, () -> dummy.restoreState(state));
     }
 
     @Test
diff --git a/commons-rng-core/src/test/java/org/apache/commons/rng/core/ProvidersCommonParametricTest.java b/commons-rng-core/src/test/java/org/apache/commons/rng/core/ProvidersCommonParametricTest.java
index 8e07603..696b765 100644
--- a/commons-rng-core/src/test/java/org/apache/commons/rng/core/ProvidersCommonParametricTest.java
+++ b/commons-rng-core/src/test/java/org/apache/commons/rng/core/ProvidersCommonParametricTest.java
@@ -56,52 +56,28 @@ public class ProvidersCommonParametricTest {
 
     // Precondition tests
 
-    @Test(expected = IllegalArgumentException.class)
-    public void testPreconditionNextInt1() {
-        generator.nextInt(-1);
-    }
-
-    @Test(expected = IllegalArgumentException.class)
-    public void testPreconditionNextInt2() {
-        generator.nextInt(0);
-    }
-
-    @Test(expected = IllegalArgumentException.class)
-    public void testPreconditionNextLong1() {
-        generator.nextLong(-1);
+    @Test
+    public void testPreconditionNextInt() {
+        Assertions.assertThrows(IllegalArgumentException.class, () -> generator.nextInt(-1));
+        Assertions.assertThrows(IllegalArgumentException.class, () -> generator.nextInt(0));
     }
 
-    @Test(expected = IllegalArgumentException.class)
-    public void testPreconditionNextLong2() {
-        generator.nextLong(0);
+    @Test
+    public void testPreconditionNextLong() {
+        Assertions.assertThrows(IllegalArgumentException.class, () -> generator.nextLong(-1));
+        Assertions.assertThrows(IllegalArgumentException.class, () -> generator.nextLong(0));
     }
 
-    @Test(expected = IndexOutOfBoundsException.class)
-    public void testPreconditionNextBytes1() {
+    @Test
+    public void testPreconditionNextBytes() {
         final int size = 10;
         final int num = 1;
         final byte[] buf = new byte[size];
-        generator.nextBytes(buf, -1, num);
-    }
-    @Test(expected = IndexOutOfBoundsException.class)
-    public void testPreconditionNextBytes2() {
-        final int size = 10;
-        final byte[] buf = new byte[size];
-        generator.nextBytes(buf, size, 0);
-    }
-    @Test(expected = IndexOutOfBoundsException.class)
-    public void testPreconditionNextBytes3() {
-        final int size = 10;
+        Assertions.assertThrows(IndexOutOfBoundsException.class, () -> generator.nextBytes(buf, -1, num));
+        Assertions.assertThrows(IndexOutOfBoundsException.class, () -> generator.nextBytes(buf, size, 0));
         final int offset = 2;
-        final byte[] buf = new byte[size];
-        generator.nextBytes(buf, offset, size - offset + 1);
-    }
-    @Test(expected = IndexOutOfBoundsException.class)
-    public void testPreconditionNextBytes4() {
-        final int size = 10;
-        final int offset = 1;
-        final byte[] buf = new byte[size];
-        generator.nextBytes(buf, offset, -1);
+        Assertions.assertThrows(IndexOutOfBoundsException.class, () -> generator.nextBytes(buf, offset, size - offset + 1));
+        Assertions.assertThrows(IndexOutOfBoundsException.class, () -> generator.nextBytes(buf, offset, -1));
     }
 
 
@@ -245,19 +221,18 @@ public class ProvidersCommonParametricTest {
         Assertions.assertEquals(listOrig, listReplay);
     }
 
-    @Test(expected = IllegalStateException.class)
+    @Test
     public void testStateWrongSize() {
         final RandomProviderState state = new DummyGenerator().saveState();
         // Try to restore with an invalid state (wrong size).
-        generator.restoreState(state);
+        Assertions.assertThrows(IllegalStateException.class, () -> generator.restoreState(state));
     }
 
-    @Test(expected = IllegalArgumentException.class)
+    @Test
     public void testRestoreForeignState() {
-        generator.restoreState(new RandomProviderState() {});
+        Assertions.assertThrows(IllegalArgumentException.class, () -> generator.restoreState(new RandomProviderState() {}));
     }
 
-
     ///// Support methods below.
 
     /**
diff --git a/commons-rng-core/src/test/java/org/apache/commons/rng/core/source32/JDKRandomTest.java b/commons-rng-core/src/test/java/org/apache/commons/rng/core/source32/JDKRandomTest.java
index 5ba63dd..8eeeb1f 100644
--- a/commons-rng-core/src/test/java/org/apache/commons/rng/core/source32/JDKRandomTest.java
+++ b/commons-rng-core/src/test/java/org/apache/commons/rng/core/source32/JDKRandomTest.java
@@ -104,7 +104,7 @@ public class JDKRandomTest {
      *
      * @throws IOException Signals that an I/O exception has occurred.
      */
-    @Test(expected = IllegalStateException.class)
+    @Test
     public void testRestoreWithInvalidClass() throws IOException  {
         // Serialize something
         final ByteArrayOutputStream bos = new ByteArrayOutputStream();
@@ -123,7 +123,6 @@ public class JDKRandomTest {
         final RandomProviderDefaultState dummyState = new RandomProviderDefaultState(sizeAndState);
 
         final JDKRandom rng = new JDKRandom(13L);
-        // This should throw
-        rng.restoreState(dummyState);
+        Assertions.assertThrows(IllegalStateException.class, () -> rng.restoreState(dummyState));
     }
 }
diff --git a/commons-rng-core/src/test/java/org/apache/commons/rng/core/source64/TwoCmresTest.java b/commons-rng-core/src/test/java/org/apache/commons/rng/core/source64/TwoCmresTest.java
index 19dd1f5..c7e738c 100644
--- a/commons-rng-core/src/test/java/org/apache/commons/rng/core/source64/TwoCmresTest.java
+++ b/commons-rng-core/src/test/java/org/apache/commons/rng/core/source64/TwoCmresTest.java
@@ -110,7 +110,7 @@ public class TwoCmresTest {
         }
     }
 
-    @Test(expected = IllegalStateException.class)
+    @Test
     public void testCmresFactoryThrowsWithDuplicateMultiplier() {
         ArrayList<Cmres> list = new ArrayList<Cmres>();
         final long multiply = 0;
@@ -128,6 +128,6 @@ public class TwoCmresTest {
 
         list.add(new Cmres(nextMultiply, rotate, start));
         // This should throw as the list now contains the multiply value
-        Cmres.Factory.checkUnique(list, nextMultiply);
+        Assertions.assertThrows(IllegalStateException.class, () -> Cmres.Factory.checkUnique(list, nextMultiply));
     }
 }
diff --git a/commons-rng-core/src/test/java/org/apache/commons/rng/core/source64/XoRoShiRo128PlusPlusTest.java b/commons-rng-core/src/test/java/org/apache/commons/rng/core/source64/XoRoShiRo128PlusPlusTest.java
index b75b5c6..42f871a 100644
--- a/commons-rng-core/src/test/java/org/apache/commons/rng/core/source64/XoRoShiRo128PlusPlusTest.java
+++ b/commons-rng-core/src/test/java/org/apache/commons/rng/core/source64/XoRoShiRo128PlusPlusTest.java
@@ -18,6 +18,7 @@ package org.apache.commons.rng.core.source64;
 
 import org.apache.commons.rng.core.RandomAssert;
 import org.junit.Test;
+import org.junit.jupiter.api.Assertions;
 
 public class XoRoShiRo128PlusPlusTest {
     /** The size of the array SEED. */
@@ -115,8 +116,8 @@ public class XoRoShiRo128PlusPlusTest {
      * and the abstract nextOutput() method should not be used. This test checks the method
      * throws an exception if used.
      */
-    @Test(expected = UnsupportedOperationException.class)
+    @Test
     public void testNextOutputThrows() {
-        new XoRoShiRo128PlusPlus(SEED).nextOutput();
+        Assertions.assertThrows(UnsupportedOperationException.class, () -> new XoRoShiRo128PlusPlus(SEED).nextOutput());
     }
 }
diff --git a/commons-rng-examples/examples-stress/src/test/java/org/apache/commons/rng/examples/stress/HexTest.java b/commons-rng-examples/examples-stress/src/test/java/org/apache/commons/rng/examples/stress/HexTest.java
index 24b118f..5b9f948 100644
--- a/commons-rng-examples/examples-stress/src/test/java/org/apache/commons/rng/examples/stress/HexTest.java
+++ b/commons-rng-examples/examples-stress/src/test/java/org/apache/commons/rng/examples/stress/HexTest.java
@@ -107,13 +107,13 @@ public class HexTest {
         Assertions.assertArrayEquals(text.toLowerCase(Locale.US).toCharArray(), Hex.encodeHex(decoded));
     }
 
-    @Test(expected = IllegalArgumentException.class)
+    @Test
     public void testHexThrowsWithOddNumberOfCharacters() {
-        Hex.decodeHex("0");
+        Assertions.assertThrows(IllegalArgumentException.class, () -> Hex.decodeHex("0"));
     }
 
-    @Test(expected = IllegalArgumentException.class)
+    @Test
     public void testHexThrowsWithIllegalHexCharacters() {
-        Hex.decodeHex("0g");
+        Assertions.assertThrows(IllegalArgumentException.class, () -> Hex.decodeHex("0g"));
     }
 }
diff --git a/commons-rng-sampling/src/test/java/org/apache/commons/rng/sampling/CollectionSamplerTest.java b/commons-rng-sampling/src/test/java/org/apache/commons/rng/sampling/CollectionSamplerTest.java
index 90a5a3b..815ae06 100644
--- a/commons-rng-sampling/src/test/java/org/apache/commons/rng/sampling/CollectionSamplerTest.java
+++ b/commons-rng-sampling/src/test/java/org/apache/commons/rng/sampling/CollectionSamplerTest.java
@@ -49,11 +49,12 @@ public class CollectionSamplerTest {
         Assertions.fail(word + " not in list");
     }
 
-    @Test(expected = IllegalArgumentException.class)
+    @Test
     public void testSamplePrecondition() {
         // Must fail for empty collection.
-        new CollectionSampler<String>(RandomSource.SPLIT_MIX_64.create(0L),
-                                      new ArrayList<String>());
+        Assertions.assertThrows(IllegalArgumentException.class,
+            () -> new CollectionSampler<String>(RandomSource.SPLIT_MIX_64.create(0L),
+                                                new ArrayList<String>()));
     }
 
     /**
diff --git a/commons-rng-sampling/src/test/java/org/apache/commons/rng/sampling/CombinationSamplerTest.java b/commons-rng-sampling/src/test/java/org/apache/commons/rng/sampling/CombinationSamplerTest.java
index ba2f707..e5dbe86 100644
--- a/commons-rng-sampling/src/test/java/org/apache/commons/rng/sampling/CombinationSamplerTest.java
+++ b/commons-rng-sampling/src/test/java/org/apache/commons/rng/sampling/CombinationSamplerTest.java
@@ -73,44 +73,49 @@ public class CombinationSamplerTest {
         }
     }
 
-    @Test(expected = IllegalArgumentException.class)
+    @Test
     public void testKgreaterThanNThrows() {
         // Must fail for k > n.
         final int n = 2;
         final int k = 3;
-        new CombinationSampler(rng, n, k);
+        Assertions.assertThrows(IllegalArgumentException.class,
+            () -> new CombinationSampler(rng, n, k));
     }
 
-    @Test(expected = IllegalArgumentException.class)
+    @Test
     public void testNequalsZeroThrows() {
         // Must fail for n = 0.
         final int n = 0;
         final int k = 3;
-        new CombinationSampler(rng, n, k);
+        Assertions.assertThrows(IllegalArgumentException.class,
+            () -> new CombinationSampler(rng, n, k));
     }
 
-    @Test(expected = IllegalArgumentException.class)
+    @Test
     public void testKequalsZeroThrows() {
         // Must fail for k = 0.
         final int n = 2;
         final int k = 0;
-        new CombinationSampler(rng, n, k);
+        Assertions.assertThrows(IllegalArgumentException.class,
+            () -> new CombinationSampler(rng, n, k));
     }
 
-    @Test(expected = IllegalArgumentException.class)
+    @Test
     public void testNisNegativeThrows() {
         // Must fail for n <= 0.
         final int n = -1;
         final int k = 3;
-        new CombinationSampler(rng, n, k);
+        Assertions.assertThrows(IllegalArgumentException.class,
+            () -> new CombinationSampler(rng, n, k));
     }
 
-    @Test(expected = IllegalArgumentException.class)
+    @Test
     public void testKisNegativeThrows() {
         // Must fail for k <= 0.
         final int n = 0;
         final int k = -1;
-        new CombinationSampler(rng, n, k);
+        Assertions.assertThrows(IllegalArgumentException.class,
+            () -> new CombinationSampler(rng, n, k));
     }
 
     /**
diff --git a/commons-rng-sampling/src/test/java/org/apache/commons/rng/sampling/CompositeSamplersTest.java b/commons-rng-sampling/src/test/java/org/apache/commons/rng/sampling/CompositeSamplersTest.java
index 0224ee9..f733891 100644
--- a/commons-rng-sampling/src/test/java/org/apache/commons/rng/sampling/CompositeSamplersTest.java
+++ b/commons-rng-sampling/src/test/java/org/apache/commons/rng/sampling/CompositeSamplersTest.java
@@ -63,23 +63,25 @@ public class CompositeSamplersTest {
     /**
      * Test an empty builder cannot build a sampler.
      */
-    @Test(expected = IllegalStateException.class)
+    @Test
     public void testEmptyBuilderThrows() {
         final UniformRandomProvider rng = RandomSource.SPLIT_MIX_64.create(0L);
         final Builder<SharedStateObjectSampler<Integer>> builder = CompositeSamplers
                 .newSharedStateObjectSamplerBuilder();
         Assertions.assertEquals(0, builder.size());
-        builder.build(rng);
+        Assertions.assertThrows(IllegalStateException.class,
+            () -> builder.build(rng));
     }
 
     /**
      * Test adding null sampler to a builder.
      */
-    @Test(expected = NullPointerException.class)
+    @Test
     public void testNullSharedStateObjectSamplerThrows() {
         final Builder<SharedStateObjectSampler<Integer>> builder = CompositeSamplers
                 .newSharedStateObjectSamplerBuilder();
-        builder.add(null, 1.0);
+        Assertions.assertThrows(NullPointerException.class,
+            () -> builder.add(null, 1.0));
     }
 
     /**
diff --git a/commons-rng-sampling/src/test/java/org/apache/commons/rng/sampling/DiscreteProbabilityCollectionSamplerTest.java b/commons-rng-sampling/src/test/java/org/apache/commons/rng/sampling/DiscreteProbabilityCollectionSamplerTest.java
index ed72e7d..ada0146 100644
--- a/commons-rng-sampling/src/test/java/org/apache/commons/rng/sampling/DiscreteProbabilityCollectionSamplerTest.java
+++ b/commons-rng-sampling/src/test/java/org/apache/commons/rng/sampling/DiscreteProbabilityCollectionSamplerTest.java
@@ -36,61 +36,74 @@ public class DiscreteProbabilityCollectionSamplerTest {
     /** RNG. */
     private final UniformRandomProvider rng = RandomSource.XO_SHI_RO_128_PP.create();
 
-    @Test(expected = IllegalArgumentException.class)
+    @Test
     public void testPrecondition1() {
         // Size mismatch
-        new DiscreteProbabilityCollectionSampler<Double>(rng,
-                                                         Arrays.asList(new Double[] {1d, 2d}),
-                                                         new double[] {0d});
+        Assertions.assertThrows(IllegalArgumentException.class,
+            () -> new DiscreteProbabilityCollectionSampler<>(rng,
+                 Arrays.asList(new Double[] {1d, 2d}),
+                 new double[] {0d}));
     }
-    @Test(expected = IllegalArgumentException.class)
+
+    @Test
     public void testPrecondition2() {
         // Negative probability
-        new DiscreteProbabilityCollectionSampler<Double>(rng,
-                                                         Arrays.asList(new Double[] {1d, 2d}),
-                                                         new double[] {0d, -1d});
+        Assertions.assertThrows(IllegalArgumentException.class,
+            () -> new DiscreteProbabilityCollectionSampler<>(rng,
+                 Arrays.asList(new Double[] {1d, 2d}),
+                 new double[] {0d, -1d}));
     }
-    @Test(expected = IllegalArgumentException.class)
+
+    @Test
     public void testPrecondition3() {
         // Probabilities do not sum above 0
-        new DiscreteProbabilityCollectionSampler<Double>(rng,
-                                                         Arrays.asList(new Double[] {1d, 2d}),
-                                                         new double[] {0d, 0d});
+        Assertions.assertThrows(IllegalArgumentException.class,
+            () -> new DiscreteProbabilityCollectionSampler<>(rng,
+                 Arrays.asList(new Double[] {1d, 2d}),
+                 new double[] {0d, 0d}));
     }
-    @Test(expected = IllegalArgumentException.class)
+
+    @Test
     public void testPrecondition4() {
         // NaN probability
-        new DiscreteProbabilityCollectionSampler<Double>(rng,
-                                                         Arrays.asList(new Double[] {1d, 2d}),
-                                                         new double[] {0d, Double.NaN});
+        Assertions.assertThrows(IllegalArgumentException.class,
+            () -> new DiscreteProbabilityCollectionSampler<>(rng,
+                 Arrays.asList(new Double[] {1d, 2d}),
+                 new double[] {0d, Double.NaN}));
     }
-    @Test(expected = IllegalArgumentException.class)
+
+    @Test
     public void testPrecondition5() {
         // Infinite probability
-        new DiscreteProbabilityCollectionSampler<Double>(rng,
-                                                         Arrays.asList(new Double[] {1d, 2d}),
-                                                         new double[] {0d, Double.POSITIVE_INFINITY});
+        Assertions.assertThrows(IllegalArgumentException.class,
+            () -> new DiscreteProbabilityCollectionSampler<>(rng,
+                 Arrays.asList(new Double[] {1d, 2d}),
+                 new double[] {0d, Double.POSITIVE_INFINITY}));
     }
-    @Test(expected = IllegalArgumentException.class)
+
+    @Test
     public void testPrecondition6() {
         // Empty Map<T, Double> not allowed
-        new DiscreteProbabilityCollectionSampler<Double>(rng,
-                                                         new HashMap<Double, Double>());
+        Assertions.assertThrows(IllegalArgumentException.class,
+            () -> new DiscreteProbabilityCollectionSampler<>(rng,
+                 new HashMap<Double, Double>()));
     }
-    @Test(expected = IllegalArgumentException.class)
+
+    @Test
     public void testPrecondition7() {
         // Empty List<T> not allowed
-        new DiscreteProbabilityCollectionSampler<Double>(rng,
-                                                         Collections.<Double>emptyList(),
-                                                         new double[0]);
+        Assertions.assertThrows(IllegalArgumentException.class,
+            () -> new DiscreteProbabilityCollectionSampler<>(rng,
+                 Collections.<Double>emptyList(),
+                 new double[0]));
     }
 
     @Test
     public void testSample() {
         final DiscreteProbabilityCollectionSampler<Double> sampler =
-            new DiscreteProbabilityCollectionSampler<Double>(rng,
-                                                             Arrays.asList(new Double[] {3d, -1d, 3d, 7d, -2d, 8d}),
-                                                             new double[] {0.2, 0.2, 0.3, 0.3, 0, 0});
+            new DiscreteProbabilityCollectionSampler<>(rng,
+                                                       Arrays.asList(new Double[] {3d, -1d, 3d, 7d, -2d, 8d}),
+                                                       new double[] {0.2, 0.2, 0.3, 0.3, 0, 0});
         final double expectedMean = 3.4;
         final double expectedVariance = 7.84;
 
@@ -117,15 +130,15 @@ public class DiscreteProbabilityCollectionSamplerTest {
         final List<Integer> items = Arrays.asList(1, 3, 4, 6, 9);
         final double[] probabilities = {0.1, 0.2, 0.3, 0.4, 0.5};
         final DiscreteProbabilityCollectionSampler<Integer> sampler1 =
-            new DiscreteProbabilityCollectionSampler<Integer>(rng1, items, probabilities);
+            new DiscreteProbabilityCollectionSampler<>(rng1, items, probabilities);
 
         // Create a map version. The map iterator must be ordered so use a TreeMap.
-        final Map<Integer, Double> map = new TreeMap<Integer, Double>();
+        final Map<Integer, Double> map = new TreeMap<>();
         for (int i = 0; i < probabilities.length; i++) {
             map.put(items.get(i), probabilities[i]);
         }
         final DiscreteProbabilityCollectionSampler<Integer> sampler2 =
-            new DiscreteProbabilityCollectionSampler<Integer>(rng2, map);
+            new DiscreteProbabilityCollectionSampler<>(rng2, map);
 
         for (int i = 0; i < 50; i++) {
             Assertions.assertEquals(sampler1.sample(), sampler2.sample());
@@ -159,9 +172,9 @@ public class DiscreteProbabilityCollectionSamplerTest {
 
         final List<Double> items = Arrays.asList(new Double[] {1d, 2d});
         final DiscreteProbabilityCollectionSampler<Double> sampler =
-            new DiscreteProbabilityCollectionSampler<Double>(dummyRng,
-                                                             items,
-                                                             new double[] {0.5, 0.5});
+            new DiscreteProbabilityCollectionSampler<>(dummyRng,
+                                                       items,
+                                                       new double[] {0.5, 0.5});
         final Double item1 = sampler.sample();
         final Double item2 = sampler.sample();
         // Check they are in the list
@@ -180,9 +193,9 @@ public class DiscreteProbabilityCollectionSamplerTest {
         final UniformRandomProvider rng2 = RandomSource.SPLIT_MIX_64.create(0L);
         final List<Double> items = Arrays.asList(new Double[] {1d, 2d, 3d, 4d});
         final DiscreteProbabilityCollectionSampler<Double> sampler1 =
-            new DiscreteProbabilityCollectionSampler<Double>(rng1,
-                                                             items,
-                                                             new double[] {0.1, 0.2, 0.3, 0.4});
+            new DiscreteProbabilityCollectionSampler<>(rng1,
+                                                       items,
+                                                       new double[] {0.1, 0.2, 0.3, 0.4});
         final DiscreteProbabilityCollectionSampler<Double> sampler2 = sampler1.withUniformRandomProvider(rng2);
         RandomAssert.assertProduceSameSequence(sampler1, sampler2);
     }
diff --git a/commons-rng-sampling/src/test/java/org/apache/commons/rng/sampling/ListSamplerTest.java b/commons-rng-sampling/src/test/java/org/apache/commons/rng/sampling/ListSamplerTest.java
index c4788d9..156ad65 100644
--- a/commons-rng-sampling/src/test/java/org/apache/commons/rng/sampling/ListSamplerTest.java
+++ b/commons-rng-sampling/src/test/java/org/apache/commons/rng/sampling/ListSamplerTest.java
@@ -81,19 +81,21 @@ public class ListSamplerTest {
         Assertions.assertTrue(one.contains("one"));
     }
 
-    @Test(expected = IllegalArgumentException.class)
+    @Test
     public void testSamplePrecondition1() {
         // Must fail for sample size > collection size.
         final List<String> list = new ArrayList<String>();
         list.add("one");
-        ListSampler.sample(rng, list, 2);
+        Assertions.assertThrows(IllegalArgumentException.class,
+            () -> ListSampler.sample(rng, list, 2));
     }
 
-    @Test(expected = IllegalArgumentException.class)
+    @Test
     public void testSamplePrecondition2() {
         // Must fail for empty collection.
         final List<String> list = new ArrayList<String>();
-        ListSampler.sample(rng, list, 1);
+        Assertions.assertThrows(IllegalArgumentException.class,
+            () -> ListSampler.sample(rng, list, 1));
     }
 
     @Test
diff --git a/commons-rng-sampling/src/test/java/org/apache/commons/rng/sampling/PermutationSamplerTest.java b/commons-rng-sampling/src/test/java/org/apache/commons/rng/sampling/PermutationSamplerTest.java
index 06d9631..2a2fece 100644
--- a/commons-rng-sampling/src/test/java/org/apache/commons/rng/sampling/PermutationSamplerTest.java
+++ b/commons-rng-sampling/src/test/java/org/apache/commons/rng/sampling/PermutationSamplerTest.java
@@ -82,28 +82,32 @@ public class PermutationSamplerTest {
         Assertions.assertEquals(0, perm[0]);
     }
 
-    @Test(expected = IllegalArgumentException.class)
+    @Test
     public void testSamplePrecondition1() {
         // Must fail for k > n.
-        new PermutationSampler(rng, 2, 3);
+        Assertions.assertThrows(IllegalArgumentException.class,
+            () -> new PermutationSampler(rng, 2, 3));
     }
 
-    @Test(expected = IllegalArgumentException.class)
+    @Test
     public void testSamplePrecondition2() {
         // Must fail for n = 0.
-        new PermutationSampler(rng, 0, 0);
+        Assertions.assertThrows(IllegalArgumentException.class,
+            () -> new PermutationSampler(rng, 0, 0));
     }
 
-    @Test(expected = IllegalArgumentException.class)
+    @Test
     public void testSamplePrecondition3() {
         // Must fail for k < n < 0.
-        new PermutationSampler(rng, -1, 0);
+        Assertions.assertThrows(IllegalArgumentException.class,
+            () -> new PermutationSampler(rng, -1, 0));
     }
 
-    @Test(expected = IllegalArgumentException.class)
+    @Test
     public void testSamplePrecondition4() {
         // Must fail for k < n < 0.
-        new PermutationSampler(rng, 1, -1);
+        Assertions.assertThrows(IllegalArgumentException.class,
+            () -> new PermutationSampler(rng, 1, -1));
     }
 
     @Test
diff --git a/commons-rng-sampling/src/test/java/org/apache/commons/rng/sampling/UnitSphereSamplerTest.java b/commons-rng-sampling/src/test/java/org/apache/commons/rng/sampling/UnitSphereSamplerTest.java
index 8ff8679..d9ae4ee 100644
--- a/commons-rng-sampling/src/test/java/org/apache/commons/rng/sampling/UnitSphereSamplerTest.java
+++ b/commons-rng-sampling/src/test/java/org/apache/commons/rng/sampling/UnitSphereSamplerTest.java
@@ -34,18 +34,20 @@ public class UnitSphereSamplerTest {
     /**
      * Test a non-positive dimension.
      */
-    @Test(expected = IllegalArgumentException.class)
+    @Test
     public void testInvalidDimensionThrows() {
         // Use instance constructor not factory constructor to exercise 1.X public API
-        new UnitSphereSampler(0, null);
+        Assertions.assertThrows(IllegalArgumentException.class,
+            () -> new UnitSphereSampler(0, null));
     }
 
     /**
      * Test a non-positive dimension.
      */
-    @Test(expected = IllegalArgumentException.class)
+    @Test
     public void testInvalidDimensionThrowsWithFactoryConstructor() {
-        UnitSphereSampler.of(null, 0);
+        Assertions.assertThrows(IllegalArgumentException.class,
+            () -> UnitSphereSampler.of(null, 0));
     }
 
     /**
@@ -345,25 +347,28 @@ public class UnitSphereSamplerTest {
     /**
      * Test infinite recursion occurs with a bad provider in 2D.
      */
-    @Test(expected = StackOverflowError.class)
+    @Test
     public void testBadProvider2D() {
-        testBadProvider(2);
+        Assertions.assertThrows(StackOverflowError.class,
+            () -> testBadProvider(2));
     }
 
     /**
      * Test infinite recursion occurs with a bad provider in 3D.
      */
-    @Test(expected = StackOverflowError.class)
+    @Test
     public void testBadProvider3D() {
-        testBadProvider(3);
+        Assertions.assertThrows(StackOverflowError.class,
+            () -> testBadProvider(3));
     }
 
     /**
      * Test infinite recursion occurs with a bad provider in 4D.
      */
-    @Test(expected = StackOverflowError.class)
+    @Test
     public void testBadProvider4D() {
-        testBadProvider(4);
+        Assertions.assertThrows(StackOverflowError.class,
+            () -> testBadProvider(4));
     }
 
     /**
diff --git a/commons-rng-sampling/src/test/java/org/apache/commons/rng/sampling/distribution/AhrensDieterExponentialSamplerTest.java b/commons-rng-sampling/src/test/java/org/apache/commons/rng/sampling/distribution/AhrensDieterExponentialSamplerTest.java
index 24e474f..c6374fa 100644
--- a/commons-rng-sampling/src/test/java/org/apache/commons/rng/sampling/distribution/AhrensDieterExponentialSamplerTest.java
+++ b/commons-rng-sampling/src/test/java/org/apache/commons/rng/sampling/distribution/AhrensDieterExponentialSamplerTest.java
@@ -39,12 +39,12 @@ public class AhrensDieterExponentialSamplerTest {
     /**
      * Test the constructor with a bad mean.
      */
-    @Test(expected = IllegalArgumentException.class)
+    @Test
     public void testConstructorThrowsWithZeroMean() {
         final RestorableUniformRandomProvider rng =
             RandomSource.SPLIT_MIX_64.create(0L);
         final double mean = 0;
-        AhrensDieterExponentialSampler.of(rng, mean);
+        Assertions.assertThrows(IllegalArgumentException.class, () -> AhrensDieterExponentialSampler.of(rng, mean));
     }
 
     /**
diff --git a/commons-rng-sampling/src/test/java/org/apache/commons/rng/sampling/distribution/AhrensDieterMarsagliaTsangGammaSamplerTest.java b/commons-rng-sampling/src/test/java/org/apache/commons/rng/sampling/distribution/AhrensDieterMarsagliaTsangGammaSamplerTest.java
index 718ecf9..fba264d 100644
--- a/commons-rng-sampling/src/test/java/org/apache/commons/rng/sampling/distribution/AhrensDieterMarsagliaTsangGammaSamplerTest.java
+++ b/commons-rng-sampling/src/test/java/org/apache/commons/rng/sampling/distribution/AhrensDieterMarsagliaTsangGammaSamplerTest.java
@@ -30,25 +30,27 @@ public class AhrensDieterMarsagliaTsangGammaSamplerTest {
     /**
      * Test the constructor with a bad alpha.
      */
-    @Test(expected = IllegalArgumentException.class)
+    @Test
     public void testConstructorThrowsWithZeroAlpha() {
         final RestorableUniformRandomProvider rng =
             RandomSource.SPLIT_MIX_64.create(0L);
         final double alpha = 0;
         final double theta = 1;
-        AhrensDieterMarsagliaTsangGammaSampler.of(rng, alpha, theta);
+        Assertions.assertThrows(IllegalArgumentException.class,
+            () -> AhrensDieterMarsagliaTsangGammaSampler.of(rng, alpha, theta));
     }
 
     /**
      * Test the constructor with a bad theta.
      */
-    @Test(expected = IllegalArgumentException.class)
+    @Test
     public void testConstructorThrowsWithZeroTheta() {
         final RestorableUniformRandomProvider rng =
             RandomSource.SPLIT_MIX_64.create(0L);
         final double alpha = 1;
         final double theta = 0;
-        AhrensDieterMarsagliaTsangGammaSampler.of(rng, alpha, theta);
+        Assertions.assertThrows(IllegalArgumentException.class,
+            () -> AhrensDieterMarsagliaTsangGammaSampler.of(rng, alpha, theta));
     }
 
     /**
diff --git a/commons-rng-sampling/src/test/java/org/apache/commons/rng/sampling/distribution/AliasMethodDiscreteSamplerTest.java b/commons-rng-sampling/src/test/java/org/apache/commons/rng/sampling/distribution/AliasMethodDiscreteSamplerTest.java
index 6a01e74..6ce5e83 100644
--- a/commons-rng-sampling/src/test/java/org/apache/commons/rng/sampling/distribution/AliasMethodDiscreteSamplerTest.java
+++ b/commons-rng-sampling/src/test/java/org/apache/commons/rng/sampling/distribution/AliasMethodDiscreteSamplerTest.java
@@ -31,39 +31,43 @@ import java.util.Arrays;
  * Test for the {@link AliasMethodDiscreteSampler}.
  */
 public class AliasMethodDiscreteSamplerTest {
-    @Test(expected = IllegalArgumentException.class)
+    @Test
     public void testConstructorThrowsWithNullProbabilites() {
-        createSampler(null);
+        Assertions.assertThrows(IllegalArgumentException.class, () -> createSampler(null));
     }
 
-    @Test(expected = IllegalArgumentException.class)
+    @Test
     public void testConstructorThrowsWithZeroLengthProbabilites() {
-        createSampler(new double[0]);
+        Assertions.assertThrows(IllegalArgumentException.class, () -> createSampler(new double[0]));
     }
 
-    @Test(expected = IllegalArgumentException.class)
+    @Test
     public void testConstructorThrowsWithNegativeProbabilites() {
-        createSampler(new double[] {-1, 0.1, 0.2});
+        Assertions.assertThrows(IllegalArgumentException.class,
+            () -> createSampler(new double[] {-1, 0.1, 0.2}));
     }
 
-    @Test(expected = IllegalArgumentException.class)
+    @Test
     public void testConstructorThrowsWithNaNProbabilites() {
-        createSampler(new double[] {0.1, Double.NaN, 0.2});
+        Assertions.assertThrows(IllegalArgumentException.class,
+            () -> createSampler(new double[] {0.1, Double.NaN, 0.2}));
     }
 
-    @Test(expected = IllegalArgumentException.class)
+    @Test
     public void testConstructorThrowsWithInfiniteProbabilites() {
-        createSampler(new double[] {0.1, Double.POSITIVE_INFINITY, 0.2});
+        Assertions.assertThrows(IllegalArgumentException.class,
+            () -> createSampler(new double[] {0.1, Double.POSITIVE_INFINITY, 0.2}));
     }
 
-    @Test(expected = IllegalArgumentException.class)
+    @Test
     public void testConstructorThrowsWithInfiniteSumProbabilites() {
-        createSampler(new double[] {Double.MAX_VALUE, Double.MAX_VALUE});
+        Assertions.assertThrows(IllegalArgumentException.class,
+            () -> createSampler(new double[] {Double.MAX_VALUE, Double.MAX_VALUE}));
     }
 
-    @Test(expected = IllegalArgumentException.class)
+    @Test
     public void testConstructorThrowsWithZeroSumProbabilites() {
-        createSampler(new double[4]);
+        Assertions.assertThrows(IllegalArgumentException.class, () -> createSampler(new double[4]));
     }
 
     @Test
diff --git a/commons-rng-sampling/src/test/java/org/apache/commons/rng/sampling/distribution/BoxMullerGaussianSamplerTest.java b/commons-rng-sampling/src/test/java/org/apache/commons/rng/sampling/distribution/BoxMullerGaussianSamplerTest.java
index 6d0ee45..e99eff3 100644
--- a/commons-rng-sampling/src/test/java/org/apache/commons/rng/sampling/distribution/BoxMullerGaussianSamplerTest.java
+++ b/commons-rng-sampling/src/test/java/org/apache/commons/rng/sampling/distribution/BoxMullerGaussianSamplerTest.java
@@ -19,6 +19,7 @@ package org.apache.commons.rng.sampling.distribution;
 import org.apache.commons.rng.RestorableUniformRandomProvider;
 import org.apache.commons.rng.simple.RandomSource;
 import org.junit.Test;
+import org.junit.jupiter.api.Assertions;
 
 /**
  * Test for the {@link BoxMullerGaussianSampler}. The tests hit edge cases for the sampler.
@@ -27,14 +28,14 @@ public class BoxMullerGaussianSamplerTest {
     /**
      * Test the constructor with a bad standard deviation.
      */
-    @Test(expected = IllegalArgumentException.class)
+    @SuppressWarnings({"deprecation"})
+    @Test
     public void testConstructorThrowsWithZeroStandardDeviation() {
         final RestorableUniformRandomProvider rng =
             RandomSource.SPLIT_MIX_64.create(0L);
         final double mean = 1;
         final double standardDeviation = 0;
-        @SuppressWarnings({"unused", "deprecation"})
-        final BoxMullerGaussianSampler sampler =
-            new BoxMullerGaussianSampler(rng, mean, standardDeviation);
+        Assertions.assertThrows(IllegalArgumentException.class,
+            () -> new BoxMullerGaussianSampler(rng, mean, standardDeviation));
     }
 }
diff --git a/commons-rng-sampling/src/test/java/org/apache/commons/rng/sampling/distribution/BoxMullerLogNormalSamplerTest.java b/commons-rng-sampling/src/test/java/org/apache/commons/rng/sampling/distribution/BoxMullerLogNormalSamplerTest.java
index 2f90e69..138bafe 100644
--- a/commons-rng-sampling/src/test/java/org/apache/commons/rng/sampling/distribution/BoxMullerLogNormalSamplerTest.java
+++ b/commons-rng-sampling/src/test/java/org/apache/commons/rng/sampling/distribution/BoxMullerLogNormalSamplerTest.java
@@ -19,6 +19,7 @@ package org.apache.commons.rng.sampling.distribution;
 import org.apache.commons.rng.RestorableUniformRandomProvider;
 import org.apache.commons.rng.simple.RandomSource;
 import org.junit.Test;
+import org.junit.jupiter.api.Assertions;
 
 /**
  * Test for the {@link BoxMullerLogNormalSampler}. The tests hit edge cases for the sampler.
@@ -27,28 +28,28 @@ public class BoxMullerLogNormalSamplerTest {
     /**
      * Test the constructor with a bad scale.
      */
-    @Test(expected = IllegalArgumentException.class)
+    @SuppressWarnings({"deprecation"})
+    @Test
     public void testConstructorThrowsWithNegativeScale() {
         final RestorableUniformRandomProvider rng =
             RandomSource.SPLIT_MIX_64.create(0L);
         final double scale = -1e-6;
         final double shape = 1;
-        @SuppressWarnings({"unused", "deprecation"})
-        final BoxMullerLogNormalSampler sampler =
-            new BoxMullerLogNormalSampler(rng, scale, shape);
+        Assertions.assertThrows(IllegalArgumentException.class,
+            () -> new BoxMullerLogNormalSampler(rng, scale, shape));
     }
 
     /**
      * Test the constructor with a bad shape.
      */
-    @Test(expected = IllegalArgumentException.class)
+    @SuppressWarnings({"deprecation"})
+    @Test
     public void testConstructorThrowsWithZeroShape() {
         final RestorableUniformRandomProvider rng =
             RandomSource.SPLIT_MIX_64.create(0L);
         final double scale = 1;
         final double shape = 0;
-        @SuppressWarnings({"unused", "deprecation"})
-        final BoxMullerLogNormalSampler sampler =
-            new BoxMullerLogNormalSampler(rng, scale, shape);
+        Assertions.assertThrows(IllegalArgumentException.class,
+            () -> new BoxMullerLogNormalSampler(rng, scale, shape));
     }
 }
diff --git a/commons-rng-sampling/src/test/java/org/apache/commons/rng/sampling/distribution/ChengBetaSamplerTest.java b/commons-rng-sampling/src/test/java/org/apache/commons/rng/sampling/distribution/ChengBetaSamplerTest.java
index 4daa16e..c1be6d0 100644
--- a/commons-rng-sampling/src/test/java/org/apache/commons/rng/sampling/distribution/ChengBetaSamplerTest.java
+++ b/commons-rng-sampling/src/test/java/org/apache/commons/rng/sampling/distribution/ChengBetaSamplerTest.java
@@ -30,25 +30,27 @@ public class ChengBetaSamplerTest {
     /**
      * Test the constructor with a bad alpha.
      */
-    @Test(expected = IllegalArgumentException.class)
+    @Test
     public void testConstructorThrowsWithZeroAlpha() {
         final RestorableUniformRandomProvider rng =
             RandomSource.SPLIT_MIX_64.create(0L);
         final double alpha = 0;
         final double beta = 1;
-        ChengBetaSampler.of(rng, alpha, beta);
+        Assertions.assertThrows(IllegalArgumentException.class,
+            () -> ChengBetaSampler.of(rng, alpha, beta));
     }
 
     /**
      * Test the constructor with a bad beta.
      */
-    @Test(expected = IllegalArgumentException.class)
+    @Test
     public void testConstructorThrowsWithZeroBeta() {
         final RestorableUniformRandomProvider rng =
             RandomSource.SPLIT_MIX_64.create(0L);
         final double alpha = 1;
         final double beta = 0;
-        ChengBetaSampler.of(rng, alpha, beta);
+        Assertions.assertThrows(IllegalArgumentException.class,
+            () -> ChengBetaSampler.of(rng, alpha, beta));
     }
 
     /**
diff --git a/commons-rng-sampling/src/test/java/org/apache/commons/rng/sampling/distribution/DirichletSamplerTest.java b/commons-rng-sampling/src/test/java/org/apache/commons/rng/sampling/distribution/DirichletSamplerTest.java
index cc1ae0a..931c50c 100644
--- a/commons-rng-sampling/src/test/java/org/apache/commons/rng/sampling/distribution/DirichletSamplerTest.java
+++ b/commons-rng-sampling/src/test/java/org/apache/commons/rng/sampling/distribution/DirichletSamplerTest.java
@@ -31,52 +31,60 @@ import org.apache.commons.rng.simple.RandomSource;
  * Test for {@link DirichletSampler}.
  */
 public class DirichletSamplerTest {
-    @Test(expected = IllegalArgumentException.class)
+    @Test
     public void testDistributionThrowsWithInvalidNumberOfCategories() {
         final UniformRandomProvider rng = RandomSource.SPLIT_MIX_64.create(0L);
-        DirichletSampler.of(rng, 1.0);
+        Assertions.assertThrows(IllegalArgumentException.class,
+            () -> DirichletSampler.of(rng, 1.0));
     }
 
-    @Test(expected = IllegalArgumentException.class)
+    @Test
     public void testDistributionThrowsWithZeroConcentration() {
         final UniformRandomProvider rng = RandomSource.SPLIT_MIX_64.create(0L);
-        DirichletSampler.of(rng, 1.0, 0.0);
+        Assertions.assertThrows(IllegalArgumentException.class,
+            () -> DirichletSampler.of(rng, 1.0, 0.0));
     }
 
-    @Test(expected = IllegalArgumentException.class)
+    @Test
     public void testDistributionThrowsWithNaNConcentration() {
         final UniformRandomProvider rng = RandomSource.SPLIT_MIX_64.create(0L);
-        DirichletSampler.of(rng, 1.0, Double.NaN);
+        Assertions.assertThrows(IllegalArgumentException.class,
+            () -> DirichletSampler.of(rng, 1.0, Double.NaN));
     }
 
-    @Test(expected = IllegalArgumentException.class)
+    @Test
     public void testDistributionThrowsWithInfiniteConcentration() {
         final UniformRandomProvider rng = RandomSource.SPLIT_MIX_64.create(0L);
-        DirichletSampler.of(rng, 1.0, Double.POSITIVE_INFINITY);
+        Assertions.assertThrows(IllegalArgumentException.class,
+            () -> DirichletSampler.of(rng, 1.0, Double.POSITIVE_INFINITY));
     }
 
-    @Test(expected = IllegalArgumentException.class)
+    @Test
     public void testSymmetricDistributionThrowsWithInvalidNumberOfCategories() {
         final UniformRandomProvider rng = RandomSource.SPLIT_MIX_64.create(0L);
-        DirichletSampler.symmetric(rng, 1, 1.0);
+        Assertions.assertThrows(IllegalArgumentException.class,
+                () -> DirichletSampler.symmetric(rng, 1, 1.0));
     }
 
-    @Test(expected = IllegalArgumentException.class)
+    @Test
     public void testSymmetricDistributionThrowsWithZeroConcentration() {
         final UniformRandomProvider rng = RandomSource.SPLIT_MIX_64.create(0L);
-        DirichletSampler.symmetric(rng, 2, 0.0);
+        Assertions.assertThrows(IllegalArgumentException.class,
+            () -> DirichletSampler.symmetric(rng, 2, 0.0));
     }
 
-    @Test(expected = IllegalArgumentException.class)
+    @Test
     public void testSymmetricDistributionThrowsWithNaNConcentration() {
         final UniformRandomProvider rng = RandomSource.SPLIT_MIX_64.create(0L);
-        DirichletSampler.symmetric(rng, 2, Double.NaN);
+        Assertions.assertThrows(IllegalArgumentException.class,
+            () -> DirichletSampler.symmetric(rng, 2, Double.NaN));
     }
 
-    @Test(expected = IllegalArgumentException.class)
+    @Test
     public void testSymmetricDistributionThrowsWithInfiniteConcentration() {
         final UniformRandomProvider rng = RandomSource.SPLIT_MIX_64.create(0L);
-        DirichletSampler.symmetric(rng, 2, Double.POSITIVE_INFINITY);
+        Assertions.assertThrows(IllegalArgumentException.class,
+            () -> DirichletSampler.symmetric(rng, 2, Double.POSITIVE_INFINITY));
     }
 
     /**
diff --git a/commons-rng-sampling/src/test/java/org/apache/commons/rng/sampling/distribution/DiscreteUniformSamplerTest.java b/commons-rng-sampling/src/test/java/org/apache/commons/rng/sampling/distribution/DiscreteUniformSamplerTest.java
index a16bf0b..6421011 100644
--- a/commons-rng-sampling/src/test/java/org/apache/commons/rng/sampling/distribution/DiscreteUniformSamplerTest.java
+++ b/commons-rng-sampling/src/test/java/org/apache/commons/rng/sampling/distribution/DiscreteUniformSamplerTest.java
@@ -33,12 +33,13 @@ public class DiscreteUniformSamplerTest {
     /**
      * Test the constructor with a bad range.
      */
-    @Test(expected = IllegalArgumentException.class)
+    @Test
     public void testConstructorThrowsWithLowerAboveUpper() {
         final int upper = 55;
         final int lower = upper + 1;
         final UniformRandomProvider rng = RandomSource.SPLIT_MIX_64.create(0L);
-        DiscreteUniformSampler.of(rng, lower, upper);
+        Assertions.assertThrows(IllegalArgumentException.class,
+            () -> DiscreteUniformSampler.of(rng, lower, upper));
     }
 
     @Test
diff --git a/commons-rng-sampling/src/test/java/org/apache/commons/rng/sampling/distribution/GaussianSamplerTest.java b/commons-rng-sampling/src/test/java/org/apache/commons/rng/sampling/distribution/GaussianSamplerTest.java
index 9222f76..d042904 100644
--- a/commons-rng-sampling/src/test/java/org/apache/commons/rng/sampling/distribution/GaussianSamplerTest.java
+++ b/commons-rng-sampling/src/test/java/org/apache/commons/rng/sampling/distribution/GaussianSamplerTest.java
@@ -22,6 +22,7 @@ import org.apache.commons.rng.sampling.RandomAssert;
 import org.apache.commons.rng.sampling.SharedStateSampler;
 import org.apache.commons.rng.simple.RandomSource;
 import org.junit.Test;
+import org.junit.jupiter.api.Assertions;
 
 /**
  * Test for the {@link GaussianSampler}. The tests hit edge cases for the sampler.
@@ -30,66 +31,71 @@ public class GaussianSamplerTest {
     /**
      * Test the constructor with a zero standard deviation.
      */
-    @Test(expected = IllegalArgumentException.class)
+    @Test
     public void testConstructorThrowsWithZeroStandardDeviation() {
         final RestorableUniformRandomProvider rng =
             RandomSource.SPLIT_MIX_64.create(0L);
         final NormalizedGaussianSampler gauss = ZigguratSampler.NormalizedGaussian.of(rng);
         final double mean = 1;
         final double standardDeviation = 0;
-        GaussianSampler.of(gauss, mean, standardDeviation);
+        Assertions.assertThrows(IllegalArgumentException.class,
+            () -> GaussianSampler.of(gauss, mean, standardDeviation));
     }
 
     /**
      * Test the constructor with an infinite standard deviation.
      */
-    @Test(expected = IllegalArgumentException.class)
+    @Test
     public void testConstructorThrowsWithInfiniteStandardDeviation() {
         final RestorableUniformRandomProvider rng =
             RandomSource.SPLIT_MIX_64.create(0L);
         final NormalizedGaussianSampler gauss = new ZigguratNormalizedGaussianSampler(rng);
         final double mean = 1;
         final double standardDeviation = Double.POSITIVE_INFINITY;
-        GaussianSampler.of(gauss, mean, standardDeviation);
+        Assertions.assertThrows(IllegalArgumentException.class,
+            () -> GaussianSampler.of(gauss, mean, standardDeviation));
     }
 
     /**
      * Test the constructor with a NaN standard deviation.
      */
-    @Test(expected = IllegalArgumentException.class)
+    @Test
     public void testConstructorThrowsWithNaNStandardDeviation() {
         final RestorableUniformRandomProvider rng =
             RandomSource.SPLIT_MIX_64.create(0L);
         final NormalizedGaussianSampler gauss = new ZigguratNormalizedGaussianSampler(rng);
         final double mean = 1;
         final double standardDeviation = Double.NaN;
-        GaussianSampler.of(gauss, mean, standardDeviation);
+        Assertions.assertThrows(IllegalArgumentException.class,
+            () -> GaussianSampler.of(gauss, mean, standardDeviation));
     }
 
     /**
      * Test the constructor with an infinite mean.
      */
-    @Test(expected = IllegalArgumentException.class)
+    @Test
     public void testConstructorThrowsWithInfiniteMean() {
         final RestorableUniformRandomProvider rng =
             RandomSource.SPLIT_MIX_64.create(0L);
         final NormalizedGaussianSampler gauss = new ZigguratNormalizedGaussianSampler(rng);
         final double mean = Double.POSITIVE_INFINITY;
         final double standardDeviation = 1;
-        GaussianSampler.of(gauss, mean, standardDeviation);
+        Assertions.assertThrows(IllegalArgumentException.class,
+            () -> GaussianSampler.of(gauss, mean, standardDeviation));
     }
 
     /**
      * Test the constructor with a NaN mean.
      */
-    @Test(expected = IllegalArgumentException.class)
+    @Test
     public void testConstructorThrowsWithNaNMean() {
         final RestorableUniformRandomProvider rng =
             RandomSource.SPLIT_MIX_64.create(0L);
         final NormalizedGaussianSampler gauss = new ZigguratNormalizedGaussianSampler(rng);
         final double mean = Double.NaN;
         final double standardDeviation = 1;
-        GaussianSampler.of(gauss, mean, standardDeviation);
+        Assertions.assertThrows(IllegalArgumentException.class,
+            () -> GaussianSampler.of(gauss, mean, standardDeviation));
     }
 
     /**
@@ -112,7 +118,7 @@ public class GaussianSamplerTest {
      * Test the SharedStateSampler implementation throws if the underlying sampler is
      * not a SharedStateSampler.
      */
-    @Test(expected = UnsupportedOperationException.class)
+    @Test
     public void testSharedStateSamplerThrowsIfUnderlyingSamplerDoesNotShareState() {
         final UniformRandomProvider rng2 = RandomSource.SPLIT_MIX_64.create(0L);
         final NormalizedGaussianSampler gauss = new NormalizedGaussianSampler() {
@@ -125,14 +131,15 @@ public class GaussianSamplerTest {
         final double standardDeviation = 4.56;
         final SharedStateContinuousSampler sampler1 =
             GaussianSampler.of(gauss, mean, standardDeviation);
-        sampler1.withUniformRandomProvider(rng2);
+        Assertions.assertThrows(UnsupportedOperationException.class,
+            () -> sampler1.withUniformRandomProvider(rng2));
     }
 
     /**
      * Test the SharedStateSampler implementation throws if the underlying sampler is
      * a SharedStateSampler that returns an incorrect type.
      */
-    @Test(expected = UnsupportedOperationException.class)
+    @Test
     public void testSharedStateSamplerThrowsIfUnderlyingSamplerReturnsWrongSharedState() {
         final UniformRandomProvider rng2 = RandomSource.SPLIT_MIX_64.create(0L);
         final NormalizedGaussianSampler gauss = new BadSharedStateNormalizedGaussianSampler();
@@ -140,7 +147,8 @@ public class GaussianSamplerTest {
         final double standardDeviation = 4.56;
         final SharedStateContinuousSampler sampler1 =
             GaussianSampler.of(gauss, mean, standardDeviation);
-        sampler1.withUniformRandomProvider(rng2);
+        Assertions.assertThrows(UnsupportedOperationException.class,
+            () -> sampler1.withUniformRandomProvider(rng2));
     }
 
     /**
diff --git a/commons-rng-sampling/src/test/java/org/apache/commons/rng/sampling/distribution/GeometricSamplerTest.java b/commons-rng-sampling/src/test/java/org/apache/commons/rng/sampling/distribution/GeometricSamplerTest.java
index d31f25c..4f88a2f 100644
--- a/commons-rng-sampling/src/test/java/org/apache/commons/rng/sampling/distribution/GeometricSamplerTest.java
+++ b/commons-rng-sampling/src/test/java/org/apache/commons/rng/sampling/distribution/GeometricSamplerTest.java
@@ -94,21 +94,23 @@ public class GeometricSamplerTest {
     /**
      * Test probability of success {@code >1} is not allowed.
      */
-    @Test(expected = IllegalArgumentException.class)
+    @Test
     public void testProbabilityOfSuccessAboveOneThrows() {
         final UniformRandomProvider unusedRng = RandomSource.SPLIT_MIX_64.create(0L);
         final double probabilityOfSuccess = Math.nextUp(1.0);
-        GeometricSampler.of(unusedRng, probabilityOfSuccess);
+        Assertions.assertThrows(IllegalArgumentException.class,
+            () -> GeometricSampler.of(unusedRng, probabilityOfSuccess));
     }
 
     /**
      * Test probability of success {@code 0} is not allowed.
      */
-    @Test(expected = IllegalArgumentException.class)
+    @Test
     public void testProbabilityOfSuccessIsZeroThrows() {
         final UniformRandomProvider unusedRng = RandomSource.SPLIT_MIX_64.create(0L);
         final double probabilityOfSuccess = 0;
-        GeometricSampler.of(unusedRng, probabilityOfSuccess);
+        Assertions.assertThrows(IllegalArgumentException.class,
+            () -> GeometricSampler.of(unusedRng, probabilityOfSuccess));
     }
 
     /**
diff --git a/commons-rng-sampling/src/test/java/org/apache/commons/rng/sampling/distribution/GuideTableDiscreteSamplerTest.java b/commons-rng-sampling/src/test/java/org/apache/commons/rng/sampling/distribution/GuideTableDiscreteSamplerTest.java
index 9ce205f..7ae4670 100644
--- a/commons-rng-sampling/src/test/java/org/apache/commons/rng/sampling/distribution/GuideTableDiscreteSamplerTest.java
+++ b/commons-rng-sampling/src/test/java/org/apache/commons/rng/sampling/distribution/GuideTableDiscreteSamplerTest.java
@@ -29,66 +29,68 @@ import org.junit.Test;
  * Test for the {@link GuideTableDiscreteSampler}.
  */
 public class GuideTableDiscreteSamplerTest {
-    @Test(expected = IllegalArgumentException.class)
+    @Test
     public void testConstructorThrowsWithNullProbabilites() {
-        createSampler(null, 1.0);
+        assertConstructorThrows(null, 1.0);
     }
 
-    @Test(expected = IllegalArgumentException.class)
+    @Test
     public void testConstructorThrowsWithZeroLengthProbabilites() {
-        createSampler(new double[0], 1.0);
+        assertConstructorThrows(new double[0], 1.0);
     }
 
-    @Test(expected = IllegalArgumentException.class)
+    @Test
     public void testConstructorThrowsWithNegativeProbabilites() {
-        createSampler(new double[] {-1, 0.1, 0.2}, 1.0);
+        assertConstructorThrows(new double[] {-1, 0.1, 0.2}, 1.0);
     }
 
-    @Test(expected = IllegalArgumentException.class)
+    @Test
     public void testConstructorThrowsWithNaNProbabilites() {
-        createSampler(new double[] {0.1, Double.NaN, 0.2}, 1.0);
+        assertConstructorThrows(new double[] {0.1, Double.NaN, 0.2}, 1.0);
     }
 
-    @Test(expected = IllegalArgumentException.class)
+    @Test
     public void testConstructorThrowsWithInfiniteProbabilites() {
-        createSampler(new double[] {0.1, Double.POSITIVE_INFINITY, 0.2}, 1.0);
+        assertConstructorThrows(new double[] {0.1, Double.POSITIVE_INFINITY, 0.2}, 1.0);
     }
 
-    @Test(expected = IllegalArgumentException.class)
+    @Test
     public void testConstructorThrowsWithInfiniteSumProbabilites() {
-        createSampler(new double[] {Double.MAX_VALUE, Double.MAX_VALUE}, 1.0);
+        assertConstructorThrows(new double[] {Double.MAX_VALUE, Double.MAX_VALUE}, 1.0);
     }
 
-    @Test(expected = IllegalArgumentException.class)
+    @Test
     public void testConstructorThrowsWithZeroSumProbabilites() {
-        createSampler(new double[4], 1.0);
+        assertConstructorThrows(new double[4], 1.0);
     }
 
-    @Test(expected = IllegalArgumentException.class)
+    @Test
     public void testConstructorThrowsWithZeroAlpha() {
-        createSampler(new double[] {0.5, 0.5}, 0.0);
-    }
-
-    @Test(expected = IllegalArgumentException.class)
-    public void testConstructorThrowsWithNegativeAlpha() {
-        createSampler(new double[] {0.5, 0.5}, -1.0);
+        assertConstructorThrows(new double[] {0.5, 0.5}, 0.0);
     }
 
     @Test
-    public void testToString() {
-        final SharedStateDiscreteSampler sampler = createSampler(new double[] {0.5, 0.5}, 1.0);
-        Assertions.assertTrue(sampler.toString().toLowerCase().contains("guide table"));
+    public void testConstructorThrowsWithNegativeAlpha() {
+        assertConstructorThrows(new double[] {0.5, 0.5}, -1.0);
     }
 
     /**
-     * Creates the sampler.
+     * Assert the factory constructor throws and {@link IllegalArgumentException}.
      *
      * @param probabilities the probabilities
-     * @return the alias method discrete sampler
+     * @param alpha the alpha
      */
-    private static SharedStateDiscreteSampler createSampler(double[] probabilities, double alpha) {
+    private static void assertConstructorThrows(double[] probabilities, double alpha) {
+        final UniformRandomProvider rng = RandomSource.SPLIT_MIX_64.create(0L);
+        Assertions.assertThrows(IllegalArgumentException.class,
+            () -> GuideTableDiscreteSampler.of(rng, probabilities, alpha));
+    }
+
+    @Test
+    public void testToString() {
         final UniformRandomProvider rng = RandomSource.SPLIT_MIX_64.create();
-        return GuideTableDiscreteSampler.of(rng, probabilities, alpha);
+        final SharedStateDiscreteSampler sampler = GuideTableDiscreteSampler.of(rng, new double[] {0.5, 0.5}, 1.0);
+        Assertions.assertTrue(sampler.toString().toLowerCase().contains("guide table"));
     }
 
     /**
@@ -201,7 +203,8 @@ public class GuideTableDiscreteSamplerTest {
      * @param alpha the alpha
      */
     private static void checkSamples(double[] probabilies, double alpha) {
-        final SharedStateDiscreteSampler sampler = createSampler(probabilies, alpha);
+        final UniformRandomProvider rng = RandomSource.JSF_64.create();
+        final SharedStateDiscreteSampler sampler = GuideTableDiscreteSampler.of(rng, probabilies, alpha);
 
         final int numberOfSamples = 10000;
         final long[] samples = new long[probabilies.length];
diff --git a/commons-rng-sampling/src/test/java/org/apache/commons/rng/sampling/distribution/InternalUtilsTest.java b/commons-rng-sampling/src/test/java/org/apache/commons/rng/sampling/distribution/InternalUtilsTest.java
index 8505efc..18c5f69 100644
--- a/commons-rng-sampling/src/test/java/org/apache/commons/rng/sampling/distribution/InternalUtilsTest.java
+++ b/commons-rng-sampling/src/test/java/org/apache/commons/rng/sampling/distribution/InternalUtilsTest.java
@@ -38,14 +38,16 @@ public class InternalUtilsTest {
         }
     }
 
-    @Test(expected = IndexOutOfBoundsException.class)
+    @Test
     public void testFactorialThrowsWhenNegative() {
-        InternalUtils.factorial(-1);
+        Assertions.assertThrows(IndexOutOfBoundsException.class,
+            () -> InternalUtils.factorial(-1));
     }
 
-    @Test(expected = IndexOutOfBoundsException.class)
+    @Test
     public void testFactorialThrowsWhenNotRepresentableAsLong() {
-        InternalUtils.factorial(MAX_REPRESENTABLE + 1);
+        Assertions.assertThrows(IndexOutOfBoundsException.class,
+            () -> InternalUtils.factorial(MAX_REPRESENTABLE + 1));
     }
 
     @Test
@@ -92,13 +94,15 @@ public class InternalUtilsTest {
         }
     }
 
-    @Test(expected = IndexOutOfBoundsException.class)
+    @Test
     public void testLogFactorialThrowsWhenNegative() {
-        FactorialLog.create().value(-1);
+        Assertions.assertThrows(IndexOutOfBoundsException.class,
+            () -> FactorialLog.create().value(-1));
     }
 
-    @Test(expected = NegativeArraySizeException.class)
+    @Test
     public void testLogFactorialWithCacheThrowsWhenNegative() {
-        FactorialLog.create().withCache(-1);
+        Assertions.assertThrows(NegativeArraySizeException.class,
+            () -> FactorialLog.create().withCache(-1));
     }
 }
diff --git a/commons-rng-sampling/src/test/java/org/apache/commons/rng/sampling/distribution/InverseTransformParetoSamplerTest.java b/commons-rng-sampling/src/test/java/org/apache/commons/rng/sampling/distribution/InverseTransformParetoSamplerTest.java
index b34b201..cda4f9b 100644
--- a/commons-rng-sampling/src/test/java/org/apache/commons/rng/sampling/distribution/InverseTransformParetoSamplerTest.java
+++ b/commons-rng-sampling/src/test/java/org/apache/commons/rng/sampling/distribution/InverseTransformParetoSamplerTest.java
@@ -21,6 +21,7 @@ import org.apache.commons.rng.UniformRandomProvider;
 import org.apache.commons.rng.sampling.RandomAssert;
 import org.apache.commons.rng.simple.RandomSource;
 import org.junit.Test;
+import org.junit.jupiter.api.Assertions;
 
 /**
  * Test for the {@link InverseTransformParetoSampler}. The tests hit edge cases for the sampler.
@@ -29,25 +30,27 @@ public class InverseTransformParetoSamplerTest {
     /**
      * Test the constructor with a bad scale.
      */
-    @Test(expected = IllegalArgumentException.class)
+    @Test
     public void testConstructorThrowsWithZeroScale() {
         final RestorableUniformRandomProvider rng =
             RandomSource.SPLIT_MIX_64.create(0L);
         final double scale = 0;
         final double shape = 1;
-        InverseTransformParetoSampler.of(rng, scale, shape);
+        Assertions.assertThrows(IllegalArgumentException.class,
+            () -> InverseTransformParetoSampler.of(rng, scale, shape));
     }
 
     /**
      * Test the constructor with a bad shape.
      */
-    @Test(expected = IllegalArgumentException.class)
+    @Test
     public void testConstructorThrowsWithZeroShape() {
         final RestorableUniformRandomProvider rng =
             RandomSource.SPLIT_MIX_64.create(0L);
         final double scale = 1;
         final double shape = 0;
-        InverseTransformParetoSampler.of(rng, scale, shape);
+        Assertions.assertThrows(IllegalArgumentException.class,
+            () -> InverseTransformParetoSampler.of(rng, scale, shape));
     }
 
     /**
diff --git a/commons-rng-sampling/src/test/java/org/apache/commons/rng/sampling/distribution/KempSmallMeanPoissonSamplerTest.java b/commons-rng-sampling/src/test/java/org/apache/commons/rng/sampling/distribution/KempSmallMeanPoissonSamplerTest.java
index cec759b..50508c3 100644
--- a/commons-rng-sampling/src/test/java/org/apache/commons/rng/sampling/distribution/KempSmallMeanPoissonSamplerTest.java
+++ b/commons-rng-sampling/src/test/java/org/apache/commons/rng/sampling/distribution/KempSmallMeanPoissonSamplerTest.java
@@ -42,41 +42,41 @@ public class KempSmallMeanPoissonSamplerTest {
     /**
      * Test the constructor with a bad mean.
      */
-    @Test(expected = IllegalArgumentException.class)
+    @Test
     public void testConstructorThrowsWithMeanLargerThanUpperBound() {
         final double mean = SUPPORTED_UPPER_BOUND + 1;
-        @SuppressWarnings("unused")
-        SharedStateDiscreteSampler sampler = KempSmallMeanPoissonSampler.of(dummyRng, mean);
+        Assertions.assertThrows(IllegalArgumentException.class,
+            () -> KempSmallMeanPoissonSampler.of(dummyRng, mean));
     }
 
     /**
      * Test the constructor with zero mean.
      */
-    @Test(expected = IllegalArgumentException.class)
+    @Test
     public void testConstructorThrowsWithZeroMean() {
         final double mean = 0;
-        @SuppressWarnings("unused")
-        SharedStateDiscreteSampler sampler = KempSmallMeanPoissonSampler.of(dummyRng, mean);
+        Assertions.assertThrows(IllegalArgumentException.class,
+            () -> KempSmallMeanPoissonSampler.of(dummyRng, mean));
     }
 
     /**
      * Test the constructor with a negative mean.
      */
-    @Test(expected = IllegalArgumentException.class)
+    @Test
     public void testConstructorThrowsWithNegativeMean() {
         final double mean = -1;
-        @SuppressWarnings("unused")
-        SharedStateDiscreteSampler sampler = KempSmallMeanPoissonSampler.of(dummyRng, mean);
+        Assertions.assertThrows(IllegalArgumentException.class,
+            () -> KempSmallMeanPoissonSampler.of(dummyRng, mean));
     }
 
     /**
      * Test the constructor with a NaN mean.
      */
-    @Test(expected = IllegalArgumentException.class)
+    @Test
     public void testConstructorWithNaNMean() {
         final double mean = Double.NaN;
-        @SuppressWarnings("unused")
-        SharedStateDiscreteSampler sampler = KempSmallMeanPoissonSampler.of(dummyRng, mean);
+        Assertions.assertThrows(IllegalArgumentException.class,
+            () -> KempSmallMeanPoissonSampler.of(dummyRng, mean));
     }
 
     /**
diff --git a/commons-rng-sampling/src/test/java/org/apache/commons/rng/sampling/distribution/LargeMeanPoissonSamplerTest.java b/commons-rng-sampling/src/test/java/org/apache/commons/rng/sampling/distribution/LargeMeanPoissonSamplerTest.java
index f3707e4..582898a 100644
--- a/commons-rng-sampling/src/test/java/org/apache/commons/rng/sampling/distribution/LargeMeanPoissonSamplerTest.java
+++ b/commons-rng-sampling/src/test/java/org/apache/commons/rng/sampling/distribution/LargeMeanPoissonSamplerTest.java
@@ -36,59 +36,61 @@ public class LargeMeanPoissonSamplerTest {
     /**
      * Test the constructor with a bad mean.
      */
-    @Test(expected = IllegalArgumentException.class)
+    @Test
     public void testConstructorThrowsWithMeanLargerThanUpperBound() {
         final RestorableUniformRandomProvider rng =
                 RandomSource.SPLIT_MIX_64.create(0L);
         final double mean = Integer.MAX_VALUE / 2 + 1;
-        LargeMeanPoissonSampler.of(rng, mean);
+        Assertions.assertThrows(IllegalArgumentException.class,
+            () -> LargeMeanPoissonSampler.of(rng, mean));
     }
 
     /**
      * Test the constructor with a mean below 1.
      */
-    @Test(expected = IllegalArgumentException.class)
+    @Test
     public void testConstructorThrowsWithMeanBelow1() {
         final RestorableUniformRandomProvider rng =
                 RandomSource.SPLIT_MIX_64.create(0L);
         final double mean = Math.nextDown(1);
-        LargeMeanPoissonSampler.of(rng, mean);
+        Assertions.assertThrows(IllegalArgumentException.class,
+            () -> LargeMeanPoissonSampler.of(rng, mean));
     }
 
     /**
      * Test the constructor using the state with a negative fractional mean.
      */
-    @Test(expected = IllegalArgumentException.class)
+    @Test
     public void testConstructorThrowsWithStateAndNegativeFractionalMean() {
         final RestorableUniformRandomProvider rng =
                 RandomSource.SPLIT_MIX_64.create(0L);
         final LargeMeanPoissonSamplerState state = new LargeMeanPoissonSampler(rng, 1).getState();
-        @SuppressWarnings("unused")
-        LargeMeanPoissonSampler sampler = new LargeMeanPoissonSampler(rng, state, -0.1);
+        Assertions.assertThrows(IllegalArgumentException.class,
+            () -> new LargeMeanPoissonSampler(rng, state, -0.1));
     }
 
     /**
      * Test the constructor with a non-fractional mean.
      */
-    @Test(expected = IllegalArgumentException.class)
+    @Test
     public void testConstructorThrowsWithStateAndNonFractionalMean() {
         final RestorableUniformRandomProvider rng =
                 RandomSource.SPLIT_MIX_64.create(0L);
         final LargeMeanPoissonSamplerState state = new LargeMeanPoissonSampler(rng, 1).getState();
-        @SuppressWarnings("unused")
-        LargeMeanPoissonSampler sampler = new LargeMeanPoissonSampler(rng, state, 1.1);
+        Assertions.assertThrows(IllegalArgumentException.class,
+            () -> new LargeMeanPoissonSampler(rng, state, 1.1));
     }
 
     /**
      * Test the constructor with fractional mean of 1.
      */
-    @Test(expected = IllegalArgumentException.class)
+    @Test
     public void testConstructorThrowsWithStateAndFractionalMeanOne() {
         final RestorableUniformRandomProvider rng =
                 RandomSource.SPLIT_MIX_64.create(0L);
         final LargeMeanPoissonSamplerState state = new LargeMeanPoissonSampler(rng, 1).getState();
-        @SuppressWarnings("unused")
-        LargeMeanPoissonSampler sampler = new LargeMeanPoissonSampler(rng, state, 1);
+        Assertions.assertThrows(IllegalArgumentException.class,
+            () -> new LargeMeanPoissonSampler(rng, state, 1));
     }
 
     // Sampling tests
diff --git a/commons-rng-sampling/src/test/java/org/apache/commons/rng/sampling/distribution/LevySamplerTest.java b/commons-rng-sampling/src/test/java/org/apache/commons/rng/sampling/distribution/LevySamplerTest.java
index 27cbc61..4943d06 100644
--- a/commons-rng-sampling/src/test/java/org/apache/commons/rng/sampling/distribution/LevySamplerTest.java
+++ b/commons-rng-sampling/src/test/java/org/apache/commons/rng/sampling/distribution/LevySamplerTest.java
@@ -31,23 +31,25 @@ public class LevySamplerTest {
     /**
      * Test the constructor with a negative scale.
      */
-    @Test(expected = IllegalArgumentException.class)
+    @Test
     public void testConstructorThrowsWithNegativeScale() {
         final UniformRandomProvider rng = RandomSource.SPLIT_MIX_64.create(0L);
         final double location = 1;
         final double scale = -1e-6;
-        LevySampler.of(rng, location, scale);
+        Assertions.assertThrows(IllegalArgumentException.class,
+            () -> LevySampler.of(rng, location, scale));
     }
 
     /**
      * Test the constructor with a zero scale.
      */
-    @Test(expected = IllegalArgumentException.class)
+    @Test
     public void testConstructorThrowsWithZeroScale() {
         final UniformRandomProvider rng = RandomSource.SPLIT_MIX_64.create(0L);
         final double location = 1;
         final double scale = 0;
-        LevySampler.of(rng, location, scale);
+        Assertions.assertThrows(IllegalArgumentException.class,
+            () -> LevySampler.of(rng, location, scale));
     }
 
     /**
diff --git a/commons-rng-sampling/src/test/java/org/apache/commons/rng/sampling/distribution/LogNormalSamplerTest.java b/commons-rng-sampling/src/test/java/org/apache/commons/rng/sampling/distribution/LogNormalSamplerTest.java
index a554fd1..0ffe543 100644
--- a/commons-rng-sampling/src/test/java/org/apache/commons/rng/sampling/distribution/LogNormalSamplerTest.java
+++ b/commons-rng-sampling/src/test/java/org/apache/commons/rng/sampling/distribution/LogNormalSamplerTest.java
@@ -22,6 +22,7 @@ import org.apache.commons.rng.sampling.RandomAssert;
 import org.apache.commons.rng.sampling.SharedStateSampler;
 import org.apache.commons.rng.simple.RandomSource;
 import org.junit.Test;
+import org.junit.jupiter.api.Assertions;
 
 /**
  * Test for the {@link LogNormalSampler}. The tests hit edge cases for the sampler.
@@ -30,27 +31,29 @@ public class LogNormalSamplerTest {
     /**
      * Test the constructor with a bad shape.
      */
-    @Test(expected = IllegalArgumentException.class)
+    @Test
     public void testConstructorThrowsWithNegativeScale() {
         final RestorableUniformRandomProvider rng =
             RandomSource.SPLIT_MIX_64.create(0L);
         final NormalizedGaussianSampler gauss = ZigguratSampler.NormalizedGaussian.of(rng);
         final double scale = -1e-6;
         final double shape = 1;
-        LogNormalSampler.of(gauss, scale, shape);
+        Assertions.assertThrows(IllegalArgumentException.class,
+            () -> LogNormalSampler.of(gauss, scale, shape));
     }
 
     /**
      * Test the constructor with a bad shape.
      */
-    @Test(expected = IllegalArgumentException.class)
+    @Test
     public void testConstructorThrowsWithZeroShape() {
         final RestorableUniformRandomProvider rng =
             RandomSource.SPLIT_MIX_64.create(0L);
         final NormalizedGaussianSampler gauss = ZigguratSampler.NormalizedGaussian.of(rng);
         final double scale = 1;
         final double shape = 0;
-        LogNormalSampler.of(gauss, scale, shape);
+        Assertions.assertThrows(IllegalArgumentException.class,
+            () -> LogNormalSampler.of(gauss, scale, shape));
     }
 
     /**
@@ -73,7 +76,7 @@ public class LogNormalSamplerTest {
      * Test the SharedStateSampler implementation throws if the underlying sampler is
      * not a SharedStateSampler.
      */
-    @Test(expected = UnsupportedOperationException.class)
+    @Test
     public void testSharedStateSamplerThrowsIfUnderlyingSamplerDoesNotShareState() {
         final UniformRandomProvider rng2 = RandomSource.SPLIT_MIX_64.create(0L);
         final NormalizedGaussianSampler gauss = new NormalizedGaussianSampler() {
@@ -86,14 +89,15 @@ public class LogNormalSamplerTest {
         final double shape = 4.56;
         final SharedStateContinuousSampler sampler1 =
             LogNormalSampler.of(gauss, scale, shape);
-        sampler1.withUniformRandomProvider(rng2);
+        Assertions.assertThrows(UnsupportedOperationException.class,
+            () -> sampler1.withUniformRandomProvider(rng2));
     }
 
     /**
      * Test the SharedStateSampler implementation throws if the underlying sampler is
      * a SharedStateSampler that returns an incorrect type.
      */
-    @Test(expected = UnsupportedOperationException.class)
+    @Test
     public void testSharedStateSamplerThrowsIfUnderlyingSamplerReturnsWrongSharedState() {
         final UniformRandomProvider rng2 = RandomSource.SPLIT_MIX_64.create(0L);
         final NormalizedGaussianSampler gauss = new BadSharedStateNormalizedGaussianSampler();
@@ -101,7 +105,8 @@ public class LogNormalSamplerTest {
         final double shape = 4.56;
         final SharedStateContinuousSampler sampler1 =
             LogNormalSampler.of(gauss, scale, shape);
-        sampler1.withUniformRandomProvider(rng2);
+        Assertions.assertThrows(UnsupportedOperationException.class,
+            () -> sampler1.withUniformRandomProvider(rng2));
     }
 
     /**
diff --git a/commons-rng-sampling/src/test/java/org/apache/commons/rng/sampling/distribution/MarsagliaTsangWangDiscreteSamplerTest.java b/commons-rng-sampling/src/test/java/org/apache/commons/rng/sampling/distribution/MarsagliaTsangWangDiscreteSamplerTest.java
index ffbaab3..51ec692 100644
--- a/commons-rng-sampling/src/test/java/org/apache/commons/rng/sampling/distribution/MarsagliaTsangWangDiscreteSamplerTest.java
+++ b/commons-rng-sampling/src/test/java/org/apache/commons/rng/sampling/distribution/MarsagliaTsangWangDiscreteSamplerTest.java
@@ -32,39 +32,50 @@ import org.junit.Test;
  * <p>Statistical testing of the sampler is performed using entries in {@link DiscreteSamplersList}.</p>
  */
 public class MarsagliaTsangWangDiscreteSamplerTest {
-    @Test(expected = IllegalArgumentException.class)
+    @Test
     public void testCreateDiscreteDistributionThrowsWithNullProbabilites() {
-        createDiscreteDistributionSampler(null);
+        assertEnumeratedSamplerConstructorThrows(null);
     }
 
-    @Test(expected = IllegalArgumentException.class)
+    @Test
     public void testCreateDiscreteDistributionThrowsWithZeroLengthProbabilites() {
-        createDiscreteDistributionSampler(new double[0]);
+        assertEnumeratedSamplerConstructorThrows(new double[0]);
     }
 
-    @Test(expected = IllegalArgumentException.class)
+    @Test
     public void testCreateDiscreteDistributionThrowsWithNegativeProbabilites() {
-        createDiscreteDistributionSampler(new double[] {-1, 0.1, 0.2});
+        assertEnumeratedSamplerConstructorThrows(new double[] {-1, 0.1, 0.2});
     }
 
-    @Test(expected = IllegalArgumentException.class)
+    @Test
     public void testCreateDiscreteDistributionThrowsWithNaNProbabilites() {
-        createDiscreteDistributionSampler(new double[] {0.1, Double.NaN, 0.2});
+        assertEnumeratedSamplerConstructorThrows(new double[] {0.1, Double.NaN, 0.2});
     }
 
-    @Test(expected = IllegalArgumentException.class)
+    @Test
     public void testCreateDiscreteDistributionThrowsWithInfiniteProbabilites() {
-        createDiscreteDistributionSampler(new double[] {0.1, Double.POSITIVE_INFINITY, 0.2});
+        assertEnumeratedSamplerConstructorThrows(new double[] {0.1, Double.POSITIVE_INFINITY, 0.2});
     }
 
-    @Test(expected = IllegalArgumentException.class)
+    @Test
     public void testCreateDiscreteDistributionThrowsWithInfiniteSumProbabilites() {
-        createDiscreteDistributionSampler(new double[] {Double.MAX_VALUE, Double.MAX_VALUE});
+        assertEnumeratedSamplerConstructorThrows(new double[] {Double.MAX_VALUE, Double.MAX_VALUE});
     }
 
-    @Test(expected = IllegalArgumentException.class)
+    @Test
     public void testCreateDiscreteDistributionThrowsWithZeroSumProbabilites() {
-        createDiscreteDistributionSampler(new double[4]);
+        assertEnumeratedSamplerConstructorThrows(new double[4]);
+    }
+
+    /**
+     * Assert the enumerated sampler factory constructor throws an {@link IllegalArgumentException}.
+     *
+     * @param probabilities Probabilities.
+     */
+    private static void assertEnumeratedSamplerConstructorThrows(double[] probabilities) {
+        final UniformRandomProvider rng = new SplitMix64(0L);
+        Assertions.assertThrows(IllegalArgumentException.class,
+            () -> MarsagliaTsangWangDiscreteSampler.Enumerated.of(rng, probabilities));
     }
 
     /**
@@ -72,24 +83,14 @@ public class MarsagliaTsangWangDiscreteSamplerTest {
      */
     @Test
     public void testToString() {
-        final DiscreteSampler sampler = createDiscreteDistributionSampler(new double[] {0.5, 0.5});
+        final UniformRandomProvider rng = new SplitMix64(0L);
+        final DiscreteSampler sampler = MarsagliaTsangWangDiscreteSampler.Enumerated.of(rng, new double[] {0.5, 0.5});
         String text = sampler.toString();
         for (String item : new String[] {"Marsaglia", "Tsang", "Wang"}) {
             Assertions.assertTrue(text.contains(item), () -> "toString missing: " + item);
         }
     }
 
-    /**
-     * Creates the sampler.
-     *
-     * @param probabilities Probabilities.
-     * @return the sampler
-     */
-    private static SharedStateDiscreteSampler createDiscreteDistributionSampler(double[] probabilities) {
-        final UniformRandomProvider rng = new SplitMix64(0L);
-        return MarsagliaTsangWangDiscreteSampler.Enumerated.of(rng, probabilities);
-    }
-
     // Sampling tests
 
     /**
@@ -295,23 +296,23 @@ public class MarsagliaTsangWangDiscreteSamplerTest {
     /**
      * Test the Poisson distribution with a bad mean that is above the supported range.
      */
-    @Test(expected = IllegalArgumentException.class)
+    @Test
     public void testCreatePoissonDistributionThrowsWithMeanLargerThanUpperBound() {
         final UniformRandomProvider rng = new FixedRNG();
         final double mean = 1025;
-        @SuppressWarnings("unused")
-        final DiscreteSampler sampler = MarsagliaTsangWangDiscreteSampler.Poisson.of(rng, mean);
+        Assertions.assertThrows(IllegalArgumentException.class,
+            () -> MarsagliaTsangWangDiscreteSampler.Poisson.of(rng, mean));
     }
 
     /**
      * Test the Poisson distribution with a bad mean that is below the supported range.
      */
-    @Test(expected = IllegalArgumentException.class)
+    @Test
     public void testCreatePoissonDistributionThrowsWithZeroMean() {
         final UniformRandomProvider rng = new FixedRNG();
         final double mean = 0;
-        @SuppressWarnings("unused")
-        final DiscreteSampler sampler = MarsagliaTsangWangDiscreteSampler.Poisson.of(rng, mean);
+        Assertions.assertThrows(IllegalArgumentException.class,
+            () -> MarsagliaTsangWangDiscreteSampler.Poisson.of(rng, mean));
     }
 
     /**
@@ -359,49 +360,49 @@ public class MarsagliaTsangWangDiscreteSamplerTest {
     /**
      * Test the Binomial distribution with a bad number of trials.
      */
-    @Test(expected = IllegalArgumentException.class)
+    @Test
     public void testCreateBinomialDistributionThrowsWithTrialsBelow0() {
         final UniformRandomProvider rng = new FixedRNG();
         final int trials = -1;
         final double p = 0.5;
-        @SuppressWarnings("unused")
-        final DiscreteSampler sampler = MarsagliaTsangWangDiscreteSampler.Binomial.of(rng, trials, p);
+        Assertions.assertThrows(IllegalArgumentException.class,
+            () -> MarsagliaTsangWangDiscreteSampler.Binomial.of(rng, trials, p));
     }
 
     /**
      * Test the Binomial distribution with an unsupported number of trials.
      */
-    @Test(expected = IllegalArgumentException.class)
+    @Test
     public void testCreateBinomialDistributionThrowsWithTrialsAboveMax() {
         final UniformRandomProvider rng = new FixedRNG();
         final int trials = 1 << 16; // 2^16
         final double p = 0.5;
-        @SuppressWarnings("unused")
-        final DiscreteSampler sampler = MarsagliaTsangWangDiscreteSampler.Binomial.of(rng, trials, p);
+        Assertions.assertThrows(IllegalArgumentException.class,
+            () -> MarsagliaTsangWangDiscreteSampler.Binomial.of(rng, trials, p));
     }
 
     /**
      * Test the Binomial distribution with probability {@code < 0}.
      */
-    @Test(expected = IllegalArgumentException.class)
+    @Test
     public void testCreateBinomialDistributionThrowsWithProbabilityBelow0() {
         final UniformRandomProvider rng = new FixedRNG();
         final int trials = 1;
         final double p = -0.5;
-        @SuppressWarnings("unused")
-        final DiscreteSampler sampler = MarsagliaTsangWangDiscreteSampler.Binomial.of(rng, trials, p);
+        Assertions.assertThrows(IllegalArgumentException.class,
+            () -> MarsagliaTsangWangDiscreteSampler.Binomial.of(rng, trials, p));
     }
 
     /**
      * Test the Binomial distribution with probability {@code > 1}.
      */
-    @Test(expected = IllegalArgumentException.class)
+    @Test
     public void testCreateBinomialDistributionThrowsWithProbabilityAbove1() {
         final UniformRandomProvider rng = new FixedRNG();
         final int trials = 1;
         final double p = 1.5;
-        @SuppressWarnings("unused")
-        final DiscreteSampler sampler = MarsagliaTsangWangDiscreteSampler.Binomial.of(rng, trials, p);
+        Assertions.assertThrows(IllegalArgumentException.class,
+            () -> MarsagliaTsangWangDiscreteSampler.Binomial.of(rng, trials, p));
     }
 
     /**
@@ -434,7 +435,7 @@ public class MarsagliaTsangWangDiscreteSamplerTest {
      * Test the Binomial distribution with distribution parameters that create a p(0)
      * that is zero (thus the distribution cannot be computed).
      */
-    @Test(expected = IllegalArgumentException.class)
+    @Test
     public void testCreateBinomialDistributionThrowsWhenP0IsZero() {
         final UniformRandomProvider rng = new FixedRNG();
         // As above but increase the trials so p(0) should be zero
@@ -442,8 +443,8 @@ public class MarsagliaTsangWangDiscreteSamplerTest {
         final double p = 0.5;
         // Validate set-up
         Assertions.assertEquals(0, getBinomialP0(trials, p), 0, "Invalid test set-up for p(0)");
-        @SuppressWarnings("unused")
-        final DiscreteSampler sampler = MarsagliaTsangWangDiscreteSampler.Binomial.of(rng, trials, p);
+        Assertions.assertThrows(IllegalArgumentException.class,
+            () -> MarsagliaTsangWangDiscreteSampler.Binomial.of(rng, trials, p));
     }
 
     /**
diff --git a/commons-rng-sampling/src/test/java/org/apache/commons/rng/sampling/distribution/PoissonSamplerCacheTest.java b/commons-rng-sampling/src/test/java/org/apache/commons/rng/sampling/distribution/PoissonSamplerCacheTest.java
index a604199..671f50e 100644
--- a/commons-rng-sampling/src/test/java/org/apache/commons/rng/sampling/distribution/PoissonSamplerCacheTest.java
+++ b/commons-rng-sampling/src/test/java/org/apache/commons/rng/sampling/distribution/PoissonSamplerCacheTest.java
@@ -98,11 +98,12 @@ public class PoissonSamplerCacheTest {
     /**
      * Test the cache requires a range with {@code max >= min}.
      */
-    @Test(expected = IllegalArgumentException.class)
+    @Test
     public void testConstructorThrowsWhenMaxIsLessThanMin() {
         final double min = PoissonSampler.PIVOT;
         final double max = Math.nextDown(min);
-        createPoissonSamplerCache(min, max);
+        Assertions.assertThrows(IllegalArgumentException.class,
+            () -> createPoissonSamplerCache(min, max));
     }
 
     /**
@@ -184,11 +185,12 @@ public class PoissonSamplerCacheTest {
     /**
      * Test the cache requires a range with {@code max >= min}.
      */
-    @Test(expected = IllegalArgumentException.class)
+    @Test
     public void testWithRangeConstructorThrowsWhenMaxIsLessThanMin() {
         final double min = PoissonSampler.PIVOT;
         final double max = Math.nextDown(min);
-        createPoissonSamplerCache().withRange(min, max);
+        Assertions.assertThrows(IllegalArgumentException.class,
+            () -> createPoissonSamplerCache().withRange(min, max));
     }
 
     /**
@@ -244,24 +246,26 @@ public class PoissonSamplerCacheTest {
      *
      * <p>Note this test actually tests the SmallMeanPoissonSampler throws.
      */
-    @Test(expected = IllegalArgumentException.class)
+    @Test
     public void testCreateSharedStateSamplerThrowsWithZeroMean() {
         final RestorableUniformRandomProvider rng =
                 RandomSource.SPLIT_MIX_64.create(0L);
         final PoissonSamplerCache cache = createPoissonSamplerCache();
-        cache.createSharedStateSampler(rng, 0);
+        Assertions.assertThrows(IllegalArgumentException.class,
+            () -> cache.createSharedStateSampler(rng, 0));
     }
 
     /**
      * Test createSharedStateSampler() with a mean that is too large.
      */
-    @Test(expected = IllegalArgumentException.class)
+    @Test
     public void testCreateSharedStateSamplerThrowsWithNonIntegerMean() {
         final RestorableUniformRandomProvider rng =
                 RandomSource.SPLIT_MIX_64.create(0L);
         final PoissonSamplerCache cache = createPoissonSamplerCache();
         final double mean = Integer.MAX_VALUE + 1.0;
-        cache.createSharedStateSampler(rng, mean);
+        Assertions.assertThrows(IllegalArgumentException.class,
+            () -> cache.createSharedStateSampler(rng, mean));
     }
 
     // Sampling tests
diff --git a/commons-rng-sampling/src/test/java/org/apache/commons/rng/sampling/distribution/RejectionInversionZipfSamplerTest.java b/commons-rng-sampling/src/test/java/org/apache/commons/rng/sampling/distribution/RejectionInversionZipfSamplerTest.java
index a69c87c..70e8f27 100644
--- a/commons-rng-sampling/src/test/java/org/apache/commons/rng/sampling/distribution/RejectionInversionZipfSamplerTest.java
+++ b/commons-rng-sampling/src/test/java/org/apache/commons/rng/sampling/distribution/RejectionInversionZipfSamplerTest.java
@@ -21,6 +21,7 @@ import org.apache.commons.rng.UniformRandomProvider;
 import org.apache.commons.rng.sampling.RandomAssert;
 import org.apache.commons.rng.simple.RandomSource;
 import org.junit.Test;
+import org.junit.jupiter.api.Assertions;
 
 /**
  * Test for the {@link RejectionInversionZipfSampler}. The tests hit edge cases for the sampler.
@@ -29,25 +30,27 @@ public class RejectionInversionZipfSamplerTest {
     /**
      * Test the constructor with a bad number of elements.
      */
-    @Test(expected = IllegalArgumentException.class)
+    @Test
     public void testConstructorThrowsWithZeroNumberOfElements() {
         final RestorableUniformRandomProvider rng =
             RandomSource.SPLIT_MIX_64.create(0L);
         final int numberOfElements = 0;
         final double exponent = 1;
-        RejectionInversionZipfSampler.of(rng, numberOfElements, exponent);
+        Assertions.assertThrows(IllegalArgumentException.class,
+            () -> RejectionInversionZipfSampler.of(rng, numberOfElements, exponent));
     }
 
     /**
      * Test the constructor with a bad exponent.
      */
-    @Test(expected = IllegalArgumentException.class)
+    @Test
     public void testConstructorThrowsWithZeroExponent() {
         final RestorableUniformRandomProvider rng =
             RandomSource.SPLIT_MIX_64.create(0L);
         final int numberOfElements = 1;
         final double exponent = 0;
-        RejectionInversionZipfSampler.of(rng, numberOfElements, exponent);
+        Assertions.assertThrows(IllegalArgumentException.class,
+            () -> RejectionInversionZipfSampler.of(rng, numberOfElements, exponent));
     }
 
     /**
diff --git a/commons-rng-sampling/src/test/java/org/apache/commons/rng/sampling/distribution/SmallMeanPoissonSamplerTest.java b/commons-rng-sampling/src/test/java/org/apache/commons/rng/sampling/distribution/SmallMeanPoissonSamplerTest.java
index a1f9427..617d96c 100644
--- a/commons-rng-sampling/src/test/java/org/apache/commons/rng/sampling/distribution/SmallMeanPoissonSamplerTest.java
+++ b/commons-rng-sampling/src/test/java/org/apache/commons/rng/sampling/distribution/SmallMeanPoissonSamplerTest.java
@@ -29,7 +29,7 @@ public class SmallMeanPoissonSamplerTest {
     /**
      * Test the constructor with a bad mean.
      */
-    @Test(expected = IllegalArgumentException.class)
+    @Test
     public void testConstructorThrowsWithMeanThatSetsProbabilityP0ToZero() {
         final UniformRandomProvider rng =
             RandomSource.SPLIT_MIX_64.create(0L);
@@ -37,18 +37,20 @@ public class SmallMeanPoissonSamplerTest {
         // Note: p0 = Math.exp(-mean) => mean = -Math.log(p0).
         // Add to the limit on the mean to cause p0 to be zero.
         final double mean = -Math.log(p0) + 1;
-        SmallMeanPoissonSampler.of(rng, mean);
+        Assertions.assertThrows(IllegalArgumentException.class,
+            () -> SmallMeanPoissonSampler.of(rng, mean));
     }
 
     /**
      * Test the constructor with a bad mean.
      */
-    @Test(expected = IllegalArgumentException.class)
+    @Test
     public void testConstructorThrowsWithZeroMean() {
         final UniformRandomProvider rng =
             RandomSource.SPLIT_MIX_64.create(0L);
         final double mean = 0;
-        SmallMeanPoissonSampler.of(rng, mean);
+        Assertions.assertThrows(IllegalArgumentException.class,
+            () -> SmallMeanPoissonSampler.of(rng, mean));
     }
 
     /**
diff --git a/commons-rng-sampling/src/test/java/org/apache/commons/rng/sampling/distribution/StableSamplerTest.java b/commons-rng-sampling/src/test/java/org/apache/commons/rng/sampling/distribution/StableSamplerTest.java
index 29ebe13..70964e7 100644
--- a/commons-rng-sampling/src/test/java/org/apache/commons/rng/sampling/distribution/StableSamplerTest.java
+++ b/commons-rng-sampling/src/test/java/org/apache/commons/rng/sampling/distribution/StableSamplerTest.java
@@ -73,22 +73,23 @@ public class StableSamplerTest {
     private static final double VALID_GAMMA = 2.34;
     private static final double VALID_DELTA = 3.45;
 
-    @Test(expected = IllegalArgumentException.class)
+    @Test
     public void testAlphaZeroThrows() {
-        createStableSampler(0.0, VALID_BETA, VALID_GAMMA, VALID_DELTA);
+        assertConstructorThrows(0.0, VALID_BETA, VALID_GAMMA, VALID_DELTA);
     }
 
-    @Test(expected = IllegalArgumentException.class)
+    @Test
     public void testAlphaBelowZeroThrows() {
-        createStableSampler(Math.nextDown(0.0), VALID_BETA, VALID_GAMMA, VALID_DELTA);
+        assertConstructorThrows(Math.nextDown(0.0), VALID_BETA, VALID_GAMMA, VALID_DELTA);
     }
 
-    @Test(expected = IllegalArgumentException.class)
+    @Test
     public void testAlphaTooCloseToZeroThrows() {
         // The realistic range for alpha is not Double.MIN_VALUE.
         // The number 1 - alpha must not be 1.
         // This is valid
-        StableSampler s = createStableSampler(SMALLEST_ALPHA, VALID_BETA, VALID_GAMMA, VALID_DELTA);
+        final UniformRandomProvider rng = new SplitMix64(0L);
+        StableSampler s = StableSampler.of(rng, SMALLEST_ALPHA, VALID_BETA, VALID_GAMMA, VALID_DELTA);
         Assertions.assertNotNull(s);
 
         // Smaller than this is still above zero but 1 - alpha == 1
@@ -97,76 +98,76 @@ public class StableSamplerTest {
         Assertions.assertEquals(1.0, 1 - alphaTooSmall, "Expected rounding to 1");
 
         // Because alpha is effectively zero this will throw
-        createStableSampler(alphaTooSmall, VALID_BETA, VALID_GAMMA, VALID_DELTA);
+        assertConstructorThrows(alphaTooSmall, VALID_BETA, VALID_GAMMA, VALID_DELTA);
     }
 
-    @Test(expected = IllegalArgumentException.class)
+    @Test
     public void testAlphaAboveTwoThrows() {
-        createStableSampler(Math.nextUp(2.0), VALID_BETA, VALID_GAMMA, VALID_DELTA);
+        assertConstructorThrows(Math.nextUp(2.0), VALID_BETA, VALID_GAMMA, VALID_DELTA);
     }
 
-    @Test(expected = IllegalArgumentException.class)
+    @Test
     public void testAlphaNaNThrows() {
-        createStableSampler(Double.NaN, VALID_BETA, VALID_GAMMA, VALID_DELTA);
+        assertConstructorThrows(Double.NaN, VALID_BETA, VALID_GAMMA, VALID_DELTA);
     }
 
-    @Test(expected = IllegalArgumentException.class)
+    @Test
     public void testBetaBelowMinusOneThrows() {
-        createStableSampler(VALID_ALPHA, Math.nextDown(-1.0), VALID_GAMMA, VALID_DELTA);
+        assertConstructorThrows(VALID_ALPHA, Math.nextDown(-1.0), VALID_GAMMA, VALID_DELTA);
     }
 
-    @Test(expected = IllegalArgumentException.class)
+    @Test
     public void testBetaAboveOneThrows() {
-        createStableSampler(VALID_ALPHA, Math.nextUp(1.0), VALID_GAMMA, VALID_DELTA);
+        assertConstructorThrows(VALID_ALPHA, Math.nextUp(1.0), VALID_GAMMA, VALID_DELTA);
     }
 
-    @Test(expected = IllegalArgumentException.class)
+    @Test
     public void testBetaNaNThrows() {
-        createStableSampler(VALID_ALPHA, Double.NaN, VALID_GAMMA, VALID_DELTA);
+        assertConstructorThrows(VALID_ALPHA, Double.NaN, VALID_GAMMA, VALID_DELTA);
     }
 
-    @Test(expected = IllegalArgumentException.class)
+    @Test
     public void testGammaNotStrictlyPositiveThrows() {
-        createStableSampler(VALID_ALPHA, VALID_BETA, 0.0, VALID_DELTA);
+        assertConstructorThrows(VALID_ALPHA, VALID_BETA, 0.0, VALID_DELTA);
     }
 
-    @Test(expected = IllegalArgumentException.class)
+    @Test
     public void testGammaInfThrows() {
-        createStableSampler(VALID_ALPHA, VALID_BETA, Double.POSITIVE_INFINITY, VALID_DELTA);
+        assertConstructorThrows(VALID_ALPHA, VALID_BETA, Double.POSITIVE_INFINITY, VALID_DELTA);
     }
 
-    @Test(expected = IllegalArgumentException.class)
+    @Test
     public void testGammaNaNThrows() {
-        createStableSampler(VALID_ALPHA, VALID_BETA, Double.NaN, VALID_DELTA);
+        assertConstructorThrows(VALID_ALPHA, VALID_BETA, Double.NaN, VALID_DELTA);
     }
 
-    @Test(expected = IllegalArgumentException.class)
+    @Test
     public void testDeltaInfThrows() {
-        createStableSampler(VALID_ALPHA, VALID_BETA, VALID_GAMMA, Double.POSITIVE_INFINITY);
+        assertConstructorThrows(VALID_ALPHA, VALID_BETA, VALID_GAMMA, Double.POSITIVE_INFINITY);
     }
 
-    @Test(expected = IllegalArgumentException.class)
+    @Test
     public void testDeltaNegInfThrows() {
-        createStableSampler(VALID_ALPHA, VALID_BETA, VALID_GAMMA, Double.NEGATIVE_INFINITY);
+        assertConstructorThrows(VALID_ALPHA, VALID_BETA, VALID_GAMMA, Double.NEGATIVE_INFINITY);
     }
 
-    @Test(expected = IllegalArgumentException.class)
+    @Test
     public void testDeltaNaNThrows() {
-        createStableSampler(VALID_ALPHA, VALID_BETA, VALID_GAMMA, Double.NaN);
+        assertConstructorThrows(VALID_ALPHA, VALID_BETA, VALID_GAMMA, Double.NaN);
     }
 
     /**
-     * Creates the stable sampler. Used for factory constructor tests with a default RNG.
+     * Asserts the stable sampler factory constructor throws an {@link IllegalArgumentException}.
      *
      * @param alpha Stability parameter. Must be in range {@code (0, 2]}.
      * @param beta Skewness parameter. Must be in range {@code [-1, 1]}.
      * @param gamma Scale parameter. Must be strictly positive and finite.
      * @param delta Location parameter. Must be finite.
-     * @return the stable sampler
      */
-    private static StableSampler createStableSampler(double alpha, double beta, double gamma, double delta) {
+    private static void assertConstructorThrows(double alpha, double beta, double gamma, double delta) {
         final UniformRandomProvider rng = new SplitMix64(0L);
-        return StableSampler.of(rng, alpha, beta, gamma, delta);
+        Assertions.assertThrows(IllegalArgumentException.class,
+            () -> StableSampler.of(rng, alpha, beta, gamma, delta));
     }
 
     /**
diff --git a/commons-rng-sampling/src/test/java/org/apache/commons/rng/sampling/distribution/UniformLongSamplerTest.java b/commons-rng-sampling/src/test/java/org/apache/commons/rng/sampling/distribution/UniformLongSamplerTest.java
index f55aeb6..1019bf2 100644
--- a/commons-rng-sampling/src/test/java/org/apache/commons/rng/sampling/distribution/UniformLongSamplerTest.java
+++ b/commons-rng-sampling/src/test/java/org/apache/commons/rng/sampling/distribution/UniformLongSamplerTest.java
@@ -42,12 +42,13 @@ public class UniformLongSamplerTest {
     /**
      * Test the constructor with a bad range.
      */
-    @Test(expected = IllegalArgumentException.class)
+    @Test
     public void testConstructorThrowsWithLowerAboveUpper() {
         final long upper = 55;
         final long lower = upper + 1;
         final UniformRandomProvider rng = RandomSource.SPLIT_MIX_64.create(0L);
-        UniformLongSampler.of(rng, lower, upper);
+        Assertions.assertThrows(IllegalArgumentException.class,
+            () -> UniformLongSampler.of(rng, lower, upper));
     }
 
     @Test
diff --git a/commons-rng-sampling/src/test/java/org/apache/commons/rng/sampling/distribution/ZigguratNormalizedGaussianSamplerTest.java b/commons-rng-sampling/src/test/java/org/apache/commons/rng/sampling/distribution/ZigguratNormalizedGaussianSamplerTest.java
index 5dbe346..95aa7ce 100644
--- a/commons-rng-sampling/src/test/java/org/apache/commons/rng/sampling/distribution/ZigguratNormalizedGaussianSamplerTest.java
+++ b/commons-rng-sampling/src/test/java/org/apache/commons/rng/sampling/distribution/ZigguratNormalizedGaussianSamplerTest.java
@@ -17,6 +17,7 @@
 package org.apache.commons.rng.sampling.distribution;
 
 import org.junit.Test;
+import org.junit.jupiter.api.Assertions;
 import org.apache.commons.rng.UniformRandomProvider;
 import org.apache.commons.rng.sampling.RandomAssert;
 import org.apache.commons.rng.simple.RandomSource;
@@ -26,7 +27,7 @@ import org.apache.commons.rng.simple.RandomSource;
  */
 public class ZigguratNormalizedGaussianSamplerTest {
     // Cf. RNG-56
-    @Test(expected = StackOverflowError.class)
+    @Test
     public void testInfiniteLoop() {
         // A bad implementation whose only purpose is to force access
         // to the rarest branch.
@@ -45,7 +46,8 @@ public class ZigguratNormalizedGaussianSamplerTest {
             };
 
         // Infinite loop (in v1.1).
-        new ZigguratNormalizedGaussianSampler(bad).sample();
+        Assertions.assertThrows(StackOverflowError.class,
+            () -> new ZigguratNormalizedGaussianSampler(bad).sample());
     }
 
     /**
diff --git a/commons-rng-sampling/src/test/java/org/apache/commons/rng/sampling/distribution/ZigguratSamplerTest.java b/commons-rng-sampling/src/test/java/org/apache/commons/rng/sampling/distribution/ZigguratSamplerTest.java
index 2ad0a24..e31a48b 100644
--- a/commons-rng-sampling/src/test/java/org/apache/commons/rng/sampling/distribution/ZigguratSamplerTest.java
+++ b/commons-rng-sampling/src/test/java/org/apache/commons/rng/sampling/distribution/ZigguratSamplerTest.java
@@ -36,11 +36,12 @@ public class ZigguratSamplerTest {
     /**
      * Test the exponential constructor with a bad mean.
      */
-    @Test(expected = IllegalArgumentException.class)
+    @Test
     public void testExponentialConstructorThrowsWithZeroMean() {
         final RestorableUniformRandomProvider rng = RandomSource.SPLIT_MIX_64.create(0L);
         final double mean = 0;
-        ZigguratSampler.Exponential.of(rng, mean);
+        Assertions.assertThrows(IllegalArgumentException.class,
+            () -> ZigguratSampler.Exponential.of(rng, mean));
     }
 
     /**
diff --git a/commons-rng-sampling/src/test/java/org/apache/commons/rng/sampling/shape/BoxSamplerTest.java b/commons-rng-sampling/src/test/java/org/apache/commons/rng/sampling/shape/BoxSamplerTest.java
index 89fa197..ea31084 100644
--- a/commons-rng-sampling/src/test/java/org/apache/commons/rng/sampling/shape/BoxSamplerTest.java
+++ b/commons-rng-sampling/src/test/java/org/apache/commons/rng/sampling/shape/BoxSamplerTest.java
@@ -35,10 +35,11 @@ public class BoxSamplerTest {
     /**
      * Test an unsupported dimension.
      */
-    @Test(expected = IllegalArgumentException.class)
+    @Test
     public void testInvalidDimensionThrows() {
         final UniformRandomProvider rng = RandomSource.SPLIT_MIX_64.create(0L);
-        BoxSampler.of(rng, new double[1], new double[1]);
+        Assertions.assertThrows(IllegalArgumentException.class,
+            () -> BoxSampler.of(rng, new double[1], new double[1]));
     }
 
     /**
diff --git a/commons-rng-sampling/src/test/java/org/apache/commons/rng/sampling/shape/LineSamplerTest.java b/commons-rng-sampling/src/test/java/org/apache/commons/rng/sampling/shape/LineSamplerTest.java
index b30a734..a8084b9 100644
--- a/commons-rng-sampling/src/test/java/org/apache/commons/rng/sampling/shape/LineSamplerTest.java
+++ b/commons-rng-sampling/src/test/java/org/apache/commons/rng/sampling/shape/LineSamplerTest.java
@@ -35,10 +35,11 @@ public class LineSamplerTest {
     /**
      * Test an unsupported dimension.
      */
-    @Test(expected = IllegalArgumentException.class)
+    @Test
     public void testInvalidDimensionThrows() {
         final UniformRandomProvider rng = RandomSource.SPLIT_MIX_64.create(0L);
-        LineSampler.of(rng, new double[0], new double[0]);
+        Assertions.assertThrows(IllegalArgumentException.class,
+            () -> LineSampler.of(rng, new double[0], new double[0]));
     }
 
     /**
diff --git a/commons-rng-sampling/src/test/java/org/apache/commons/rng/sampling/shape/TriangleSamplerTest.java b/commons-rng-sampling/src/test/java/org/apache/commons/rng/sampling/shape/TriangleSamplerTest.java
index 5f51c02..149d8ad 100644
--- a/commons-rng-sampling/src/test/java/org/apache/commons/rng/sampling/shape/TriangleSamplerTest.java
+++ b/commons-rng-sampling/src/test/java/org/apache/commons/rng/sampling/shape/TriangleSamplerTest.java
@@ -93,10 +93,11 @@ public class TriangleSamplerTest {
     /**
      * Test an unsupported dimension.
      */
-    @Test(expected = IllegalArgumentException.class)
+    @Test
     public void testInvalidDimensionThrows() {
         final UniformRandomProvider rng = RandomSource.SPLIT_MIX_64.create(0L);
-        TriangleSampler.of(rng, new double[1], new double[1], new double[1]);
+        Assertions.assertThrows(IllegalArgumentException.class,
+            () -> TriangleSampler.of(rng, new double[1], new double[1], new double[1]));
     }
 
     /**
diff --git a/commons-rng-sampling/src/test/java/org/apache/commons/rng/sampling/shape/UnitBallSamplerTest.java b/commons-rng-sampling/src/test/java/org/apache/commons/rng/sampling/shape/UnitBallSamplerTest.java
index 66221d5..7617bcf 100644
--- a/commons-rng-sampling/src/test/java/org/apache/commons/rng/sampling/shape/UnitBallSamplerTest.java
+++ b/commons-rng-sampling/src/test/java/org/apache/commons/rng/sampling/shape/UnitBallSamplerTest.java
@@ -35,10 +35,11 @@ public class UnitBallSamplerTest {
     /**
      * Test a non-positive dimension.
      */
-    @Test(expected = IllegalArgumentException.class)
+    @Test
     public void testInvalidDimensionThrows() {
         final UniformRandomProvider rng = RandomSource.SPLIT_MIX_64.create(0L);
-        UnitBallSampler.of(rng, 0);
+        Assertions.assertThrows(IllegalArgumentException.class,
+            () -> UnitBallSampler.of(rng, 0));
     }
 
     /**
diff --git a/commons-rng-simple/src/test/java/org/apache/commons/rng/simple/JDKRandomWrapperTest.java b/commons-rng-simple/src/test/java/org/apache/commons/rng/simple/JDKRandomWrapperTest.java
index e6a0559..5effced 100644
--- a/commons-rng-simple/src/test/java/org/apache/commons/rng/simple/JDKRandomWrapperTest.java
+++ b/commons-rng-simple/src/test/java/org/apache/commons/rng/simple/JDKRandomWrapperTest.java
@@ -120,10 +120,10 @@ public class JDKRandomWrapperTest {
         }
     }
 
-    @Test(expected = IllegalArgumentException.class)
+    @Test
     public void testNextLongInRangeThrows() {
         final UniformRandomProvider rng1 = new JDKRandomWrapper(new Random(5675767L));
-        rng1.nextLong(0);
+        Assertions.assertThrows(IllegalArgumentException.class, () -> rng1.nextLong(0));
     }
 
     /**
diff --git a/commons-rng-simple/src/test/java/org/apache/commons/rng/simple/ProvidersCommonParametricTest.java b/commons-rng-simple/src/test/java/org/apache/commons/rng/simple/ProvidersCommonParametricTest.java
index 036790b..dffa57c 100644
--- a/commons-rng-simple/src/test/java/org/apache/commons/rng/simple/ProvidersCommonParametricTest.java
+++ b/commons-rng-simple/src/test/java/org/apache/commons/rng/simple/ProvidersCommonParametricTest.java
@@ -74,10 +74,10 @@ public class ProvidersCommonParametricTest {
 
     // Seeding tests.
 
-    @Test(expected = UnsupportedOperationException.class)
+    @Test
     public void testUnsupportedSeedType() {
         final byte seed = 123;
-        originalSource.create(seed, originalArgs);
+        Assertions.assertThrows(UnsupportedOperationException.class, () -> originalSource.create(seed, originalArgs));
     }
 
     /**
diff --git a/commons-rng-simple/src/test/java/org/apache/commons/rng/simple/ThreadLocalRandomSourceTest.java b/commons-rng-simple/src/test/java/org/apache/commons/rng/simple/ThreadLocalRandomSourceTest.java
index 613fc6c..a100973 100644
--- a/commons-rng-simple/src/test/java/org/apache/commons/rng/simple/ThreadLocalRandomSourceTest.java
+++ b/commons-rng-simple/src/test/java/org/apache/commons/rng/simple/ThreadLocalRandomSourceTest.java
@@ -44,14 +44,15 @@ public class ThreadLocalRandomSourceTest {
         toIgnore = EnumSet.of(RandomSource.TWO_CMRES_SELECT);
     }
 
-    @Test(expected = IllegalArgumentException.class)
+    @Test
     public void testCurrentThrowsForNullRandomSource() {
-        ThreadLocalRandomSource.current(null);
+        Assertions.assertThrows(IllegalArgumentException.class, () -> ThreadLocalRandomSource.current(null));
     }
 
-    @Test(expected = IllegalArgumentException.class)
+    @Test
     public void testCurrentThrowsForRandomSourceWithDataArguments() {
-        ThreadLocalRandomSource.current(RandomSource.TWO_CMRES_SELECT);
+        Assertions.assertThrows(IllegalArgumentException.class,
+            () -> ThreadLocalRandomSource.current(RandomSource.TWO_CMRES_SELECT));
     }
 
     @Test
diff --git a/commons-rng-simple/src/test/java/org/apache/commons/rng/simple/internal/NativeSeedTypeTest.java b/commons-rng-simple/src/test/java/org/apache/commons/rng/simple/internal/NativeSeedTypeTest.java
index e325d39..96c540d 100644
--- a/commons-rng-simple/src/test/java/org/apache/commons/rng/simple/internal/NativeSeedTypeTest.java
+++ b/commons-rng-simple/src/test/java/org/apache/commons/rng/simple/internal/NativeSeedTypeTest.java
@@ -27,9 +27,9 @@ public class NativeSeedTypeTest {
      * Test the conversion throws for an unsupported type. All supported types are
      * tested in the {@link NativeSeedTypeParametricTest}.
      */
-    @Test(expected = UnsupportedOperationException.class)
+    @Test
     public void testConvertSeedToBytesUsingNullThrows() {
-        NativeSeedType.convertSeedToBytes(null);
+        Assertions.assertThrows(UnsupportedOperationException.class, () -> NativeSeedType.convertSeedToBytes(null));
     }
 
     /**

[commons-rng] 02/13: Remove Java 8 profiles from modules

Posted by ah...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

aherbert pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/commons-rng.git

commit 6663901584fc1eafb1f125361f2be707c6f68578
Author: Alex Herbert <ah...@apache.org>
AuthorDate: Sun Aug 15 09:22:09 2021 +0100

    Remove Java 8 profiles from modules
---
 commons-rng-client-api/pom.xml | 13 -------------
 commons-rng-core/pom.xml       | 13 -------------
 commons-rng-sampling/pom.xml   | 13 -------------
 commons-rng-simple/pom.xml     | 13 -------------
 4 files changed, 52 deletions(-)

diff --git a/commons-rng-client-api/pom.xml b/commons-rng-client-api/pom.xml
index e842eca..82eb825 100644
--- a/commons-rng-client-api/pom.xml
+++ b/commons-rng-client-api/pom.xml
@@ -42,17 +42,4 @@
     <rng.jira.component>client-api</rng.jira.component>
   </properties>
 
-  <profiles>
-    <profile>
-      <id>jdk8-plugins</id>
-      <activation>
-        <jdk>[1.8,)</jdk>
-      </activation>
-      <properties>
-        <!-- Allow japicmp -->
-        <japicmp.skip>false</japicmp.skip>
-      </properties>
-    </profile>
-  </profiles>
-
 </project>
diff --git a/commons-rng-core/pom.xml b/commons-rng-core/pom.xml
index 3f831c6..fa683cf 100644
--- a/commons-rng-core/pom.xml
+++ b/commons-rng-core/pom.xml
@@ -71,17 +71,4 @@
     </plugins>
   </build>
 
-  <profiles>
-    <profile>
-      <id>jdk8-plugins</id>
-      <activation>
-        <jdk>[1.8,)</jdk>
-      </activation>
-      <properties>
-        <!-- Allow japicmp -->
-        <japicmp.skip>false</japicmp.skip>
-      </properties>
-    </profile>
-  </profiles>
-
 </project>
diff --git a/commons-rng-sampling/pom.xml b/commons-rng-sampling/pom.xml
index a17bebf..b6e16fc 100644
--- a/commons-rng-sampling/pom.xml
+++ b/commons-rng-sampling/pom.xml
@@ -75,17 +75,4 @@
     </plugins>
   </build>
 
-  <profiles>
-    <profile>
-      <id>jdk8-plugins</id>
-      <activation>
-        <jdk>[1.8,)</jdk>
-      </activation>
-      <properties>
-        <!-- Allow japicmp -->
-        <japicmp.skip>false</japicmp.skip>
-      </properties>
-    </profile>
-  </profiles>
-
 </project>
diff --git a/commons-rng-simple/pom.xml b/commons-rng-simple/pom.xml
index 98338a2..faabe26 100644
--- a/commons-rng-simple/pom.xml
+++ b/commons-rng-simple/pom.xml
@@ -69,17 +69,4 @@
     </plugins>
   </build>
 
-  <profiles>
-    <profile>
-      <id>jdk8-plugins</id>
-      <activation>
-        <jdk>[1.8,)</jdk>
-      </activation>
-      <properties>
-        <!-- Allow japicmp -->
-        <japicmp.skip>false</japicmp.skip>
-      </properties>
-    </profile>
-  </profiles>
-
 </project>

[commons-rng] 05/13: RNG-163: Update parametric tests to JUnit 5 ParameterizedTest

Posted by ah...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

aherbert pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/commons-rng.git

commit ad27ea7db0e20c2028cb38575e0b5a63e1f95cc4
Author: Alex Herbert <ah...@apache.org>
AuthorDate: Sun Aug 15 21:24:51 2021 +0100

    RNG-163: Update parametric tests to JUnit 5 ParameterizedTest
---
 .../rng/core/JumpableProvidersParametricTest.java  | 121 +++++-------
 .../rng/core/Providers32ParametricTest.java        |  27 +--
 .../rng/core/Providers64ParametricTest.java        |  28 +--
 .../rng/core/ProvidersCommonParametricTest.java    | 212 ++++++++++-----------
 .../org/apache/commons/rng/core/ProvidersList.java | 140 ++++++--------
 .../ContinuousSamplerParametricTest.java           |  31 +--
 .../distribution/ContinuousSamplersList.java       |  23 ++-
 .../DiscreteSamplerParametricTest.java             |  41 +---
 .../distribution/DiscreteSamplersList.java         |  29 ++-
 .../rng/simple/ProvidersCommonParametricTest.java  | 187 ++++++++++--------
 .../apache/commons/rng/simple/ProvidersList.java   |  39 +++-
 .../internal/NativeSeedTypeParametricTest.java     | 102 +++++-----
 .../RandomSourceInternalParametricTest.java        |  72 ++++---
 13 files changed, 485 insertions(+), 567 deletions(-)

diff --git a/commons-rng-core/src/test/java/org/apache/commons/rng/core/JumpableProvidersParametricTest.java b/commons-rng-core/src/test/java/org/apache/commons/rng/core/JumpableProvidersParametricTest.java
index 4793b42..9490712 100644
--- a/commons-rng-core/src/test/java/org/apache/commons/rng/core/JumpableProvidersParametricTest.java
+++ b/commons-rng-core/src/test/java/org/apache/commons/rng/core/JumpableProvidersParametricTest.java
@@ -18,10 +18,8 @@ package org.apache.commons.rng.core;
 
 import org.junit.jupiter.api.Assertions;
 import org.junit.jupiter.api.Assumptions;
-import org.junit.Test;
-import org.junit.runner.RunWith;
-import org.junit.runners.Parameterized;
-import org.junit.runners.Parameterized.Parameters;
+import org.junit.jupiter.params.ParameterizedTest;
+import org.junit.jupiter.params.provider.MethodSource;
 
 import java.util.Arrays;
 
@@ -36,7 +34,6 @@ import org.apache.commons.rng.core.source64.LongProvider;
 /**
  * Tests which all {@link JumpableUniformRandomProvider} generators must pass.
  */
-@RunWith(value = Parameterized.class)
 public class JumpableProvidersParametricTest {
     /** The size of the state for the IntProvider. */
     private static final int INT_PROVIDER_STATE_SIZE;
@@ -48,81 +45,54 @@ public class JumpableProvidersParametricTest {
         LONG_PROVIDER_STATE_SIZE = new State64Generator().getStateSize();
     }
 
-    /** RNG under test. */
-    private final JumpableUniformRandomProvider generator;
-
-    /**
-     * Initializes generator instance.
-     *
-     * @param rng RNG to be tested.
-     */
-    public JumpableProvidersParametricTest(JumpableUniformRandomProvider rng) {
-        generator = rng;
-    }
-
     /**
      * Gets the list of Jumpable generators.
      *
      * @return the list
      */
-    @Parameters(name = "{index}: data={0}")
-    public static Iterable<JumpableUniformRandomProvider[]> getList() {
+    private static Iterable<JumpableUniformRandomProvider> getJumpableProviders() {
         return ProvidersList.listJumpable();
     }
 
     /**
-     * Gets the function using the {@link JumpableUniformRandomProvider#jump()} method.
-     *
-     * @return the jump function
-     */
-    private TestJumpFunction getJumpFunction() {
-        return new TestJumpFunction() {
-            @Override
-            public UniformRandomProvider jump() {
-                return generator.jump();
-            }
-        };
-    }
-
-    /**
      * Gets the function using the {@link LongJumpableUniformRandomProvider#longJump()} method.
+     * If the RNG is not long jumpable then this will raise an exception to skip the test.
      *
+     * @param generator RNG under test.
      * @return the jump function
      */
-    private TestJumpFunction getLongJumpFunction() {
+    private static TestJumpFunction getLongJumpFunction(JumpableUniformRandomProvider generator) {
         Assumptions.assumeTrue(generator instanceof LongJumpableUniformRandomProvider, "No long jump function");
-
-        final LongJumpableUniformRandomProvider rng = (LongJumpableUniformRandomProvider) generator;
-        return new TestJumpFunction() {
-            @Override
-            public UniformRandomProvider jump() {
-                return rng.longJump();
-            }
-        };
+        final LongJumpableUniformRandomProvider rng2 = (LongJumpableUniformRandomProvider) generator;
+        return rng2::jump;
     }
 
     /**
      * Test that the random generator returned from the jump is a new instance of the same class.
      */
-    @Test
-    public void testJumpReturnsACopy() {
-        assertJumpReturnsACopy(getJumpFunction());
+    @ParameterizedTest
+    @MethodSource("getJumpableProviders")
+    public void testJumpReturnsACopy(JumpableUniformRandomProvider generator) {
+        assertJumpReturnsACopy(generator::jump, generator);
     }
 
     /**
      * Test that the random generator returned from the long jump is a new instance of the same class.
      */
-    @Test
-    public void testLongJumpReturnsACopy() {
-        assertJumpReturnsACopy(getLongJumpFunction());
+    @ParameterizedTest
+    @MethodSource("getJumpableProviders")
+    public void testLongJumpReturnsACopy(JumpableUniformRandomProvider generator) {
+        assertJumpReturnsACopy(getLongJumpFunction(generator), generator);
     }
 
     /**
      * Assert that the random generator returned from the jump function is a new instance of the same class.
      *
      * @param jumpFunction Jump function to test.
+     * @param generator RNG under test.
      */
-    private void assertJumpReturnsACopy(TestJumpFunction jumpFunction) {
+    private static void assertJumpReturnsACopy(TestJumpFunction jumpFunction,
+                                               JumpableUniformRandomProvider generator) {
         final UniformRandomProvider copy = jumpFunction.jump();
         Assertions.assertNotSame(generator, copy, "The copy instance should be a different object");
         Assertions.assertEquals(generator.getClass(), copy.getClass(), "The copy instance should be the same class");
@@ -132,18 +102,20 @@ public class JumpableProvidersParametricTest {
      * Test that the random generator state of the copy instance returned from the jump
      * matches the input state.
      */
-    @Test
-    public void testJumpCopyMatchesPreJumpState() {
-        assertCopyMatchesPreJumpState(getJumpFunction());
+    @ParameterizedTest
+    @MethodSource("getJumpableProviders")
+    public void testJumpCopyMatchesPreJumpState(JumpableUniformRandomProvider generator) {
+        assertCopyMatchesPreJumpState(generator::jump, generator);
     }
 
     /**
      * Test that the random generator state of the copy instance returned from the long jump
      * matches the input state.
      */
-    @Test
-    public void testLongJumpCopyMatchesPreJumpState() {
-        assertCopyMatchesPreJumpState(getLongJumpFunction());
+    @ParameterizedTest
+    @MethodSource("getJumpableProviders")
+    public void testLongJumpCopyMatchesPreJumpState(JumpableUniformRandomProvider generator) {
+        assertCopyMatchesPreJumpState(getLongJumpFunction(generator), generator);
     }
 
     /**
@@ -163,8 +135,10 @@ public class JumpableProvidersParametricTest {
      * nextBoolean() and nextInt() functions.</p>
      *
      * @param jumpFunction Jump function to test.
+     * @param generator RNG under test.
      */
-    private void assertCopyMatchesPreJumpState(TestJumpFunction jumpFunction) {
+    private static void assertCopyMatchesPreJumpState(TestJumpFunction jumpFunction,
+                                                      JumpableUniformRandomProvider generator) {
         Assumptions.assumeTrue(generator instanceof RestorableUniformRandomProvider, "Not a restorable RNG");
 
         for (int repeats = 0; repeats < 2; repeats++) {
@@ -192,26 +166,20 @@ public class JumpableProvidersParametricTest {
      * Test that a jump resets the state of the default implementation of a generator in
      * {@link IntProvider} and {@link LongProvider}.
      */
-    @Test
-    public void testJumpResetsDefaultState() {
-        if (generator instanceof IntProvider) {
-            assertJumpResetsDefaultState(getJumpFunction(), INT_PROVIDER_STATE_SIZE);
-        } else if (generator instanceof LongProvider) {
-            assertJumpResetsDefaultState(getJumpFunction(), LONG_PROVIDER_STATE_SIZE);
-        }
+    @ParameterizedTest
+    @MethodSource("getJumpableProviders")
+    public void testJumpResetsDefaultState(JumpableUniformRandomProvider generator) {
+        assertJumpResetsDefaultState(generator::jump, generator);
     }
 
     /**
      * Test that a long jump resets the state of the default implementation of a generator in
      * {@link IntProvider} and {@link LongProvider}.
      */
-    @Test
-    public void testLongJumpResetsDefaultState() {
-        if (generator instanceof IntProvider) {
-            assertJumpResetsDefaultState(getLongJumpFunction(), INT_PROVIDER_STATE_SIZE);
-        } else if (generator instanceof LongProvider) {
-            assertJumpResetsDefaultState(getLongJumpFunction(), LONG_PROVIDER_STATE_SIZE);
-        }
+    @ParameterizedTest
+    @MethodSource("getJumpableProviders")
+    public void testLongJumpResetsDefaultState(JumpableUniformRandomProvider generator) {
+        assertJumpResetsDefaultState(getLongJumpFunction(generator), generator);
     }
 
     /**
@@ -222,9 +190,18 @@ public class JumpableProvidersParametricTest {
      * {@link IntProvider} and {@link LongProvider} is reset.</p>
      *
      * @param jumpFunction Jump function to test.
-     * @param stateSize State size.
+     * @param generator RNG under test.
      */
-    private void assertJumpResetsDefaultState(TestJumpFunction jumpFunction, int stateSize) {
+    private static void assertJumpResetsDefaultState(TestJumpFunction jumpFunction,
+                                                     JumpableUniformRandomProvider generator) {
+        int stateSize;
+        if (generator instanceof IntProvider) {
+            stateSize = INT_PROVIDER_STATE_SIZE;
+        } else if (generator instanceof LongProvider) {
+            stateSize = LONG_PROVIDER_STATE_SIZE;
+        } else {
+            throw new AssertionError("Unsupported RNG");
+        }
         final byte[] expected = new byte[stateSize];
         for (int repeats = 0; repeats < 2; repeats++) {
             // Exercise the generator.
diff --git a/commons-rng-core/src/test/java/org/apache/commons/rng/core/Providers32ParametricTest.java b/commons-rng-core/src/test/java/org/apache/commons/rng/core/Providers32ParametricTest.java
index 319400a..81d8897 100644
--- a/commons-rng-core/src/test/java/org/apache/commons/rng/core/Providers32ParametricTest.java
+++ b/commons-rng-core/src/test/java/org/apache/commons/rng/core/Providers32ParametricTest.java
@@ -16,37 +16,22 @@
  */
 package org.apache.commons.rng.core;
 
-import org.junit.Test;
-import org.junit.runner.RunWith;
-import org.junit.runners.Parameterized;
-import org.junit.runners.Parameterized.Parameters;
+import org.junit.jupiter.params.ParameterizedTest;
+import org.junit.jupiter.params.provider.MethodSource;
 
 import org.apache.commons.rng.RestorableUniformRandomProvider;
 
 /**
  * Tests which all 32-bits based generators must pass.
  */
-@RunWith(value = Parameterized.class)
 public class Providers32ParametricTest {
-    /** RNG under test. */
-    private final RestorableUniformRandomProvider generator;
-
-    /**
-     * Initializes generator instance.
-     *
-     * @param rng RNG to be tested.
-     */
-    public Providers32ParametricTest(RestorableUniformRandomProvider rng) {
-        generator = rng;
-    }
-
-    @Parameters(name = "{index}: data={0}")
-    public static Iterable<RestorableUniformRandomProvider[]> getList() {
+    private static Iterable<RestorableUniformRandomProvider> getList() {
         return ProvidersList.list32();
     }
 
-    @Test
-    public void testNextBytesChunks() {
+    @ParameterizedTest
+    @MethodSource("getList")
+    public void testNextBytesChunks(RestorableUniformRandomProvider generator) {
         final int[] chunkSizes = {4, 8, 12, 16};
         final int[] chunks = {1, 2, 3, 4, 5};
         for (int chunkSize : chunkSizes) {
diff --git a/commons-rng-core/src/test/java/org/apache/commons/rng/core/Providers64ParametricTest.java b/commons-rng-core/src/test/java/org/apache/commons/rng/core/Providers64ParametricTest.java
index 61a1d35..945c0fb 100644
--- a/commons-rng-core/src/test/java/org/apache/commons/rng/core/Providers64ParametricTest.java
+++ b/commons-rng-core/src/test/java/org/apache/commons/rng/core/Providers64ParametricTest.java
@@ -16,37 +16,21 @@
  */
 package org.apache.commons.rng.core;
 
-import org.junit.Test;
-import org.junit.runner.RunWith;
-import org.junit.runners.Parameterized;
-import org.junit.runners.Parameterized.Parameters;
-
+import org.junit.jupiter.params.ParameterizedTest;
+import org.junit.jupiter.params.provider.MethodSource;
 import org.apache.commons.rng.RestorableUniformRandomProvider;
 
 /**
  * Tests which all 64-bits based generators must pass.
  */
-@RunWith(value = Parameterized.class)
 public class Providers64ParametricTest {
-    /** RNG under test. */
-    private final RestorableUniformRandomProvider generator;
-
-    /**
-     * Initializes generator instance.
-     *
-     * @param rng RNG to be tested.
-     */
-    public Providers64ParametricTest(RestorableUniformRandomProvider rng) {
-        generator = rng;
-    }
-
-    @Parameters(name = "{index}: data={0}")
-    public static Iterable<RestorableUniformRandomProvider[]> getList() {
+    private static Iterable<RestorableUniformRandomProvider> getList() {
         return ProvidersList.list64();
     }
 
-    @Test
-    public void testNextBytesChunks() {
+    @ParameterizedTest
+    @MethodSource("getList")
+    public void testNextBytesChunks(RestorableUniformRandomProvider generator) {
         final int[] chunkSizes = {8, 16, 24};
         final int[] chunks = {1, 2, 3, 4, 5};
         for (int chunkSize : chunkSizes) {
diff --git a/commons-rng-core/src/test/java/org/apache/commons/rng/core/ProvidersCommonParametricTest.java b/commons-rng-core/src/test/java/org/apache/commons/rng/core/ProvidersCommonParametricTest.java
index 696b765..032f34d 100644
--- a/commons-rng-core/src/test/java/org/apache/commons/rng/core/ProvidersCommonParametricTest.java
+++ b/commons-rng-core/src/test/java/org/apache/commons/rng/core/ProvidersCommonParametricTest.java
@@ -22,10 +22,8 @@ import java.util.ArrayList;
 import java.util.concurrent.Callable;
 
 import org.junit.jupiter.api.Assertions;
-import org.junit.Test;
-import org.junit.runner.RunWith;
-import org.junit.runners.Parameterized;
-import org.junit.runners.Parameterized.Parameters;
+import org.junit.jupiter.params.ParameterizedTest;
+import org.junit.jupiter.params.provider.MethodSource;
 
 import org.apache.commons.rng.UniformRandomProvider;
 import org.apache.commons.rng.RestorableUniformRandomProvider;
@@ -34,42 +32,30 @@ import org.apache.commons.rng.RandomProviderState;
 /**
  * Tests which all generators must pass.
  */
-@RunWith(value = Parameterized.class)
 public class ProvidersCommonParametricTest {
-    /** RNG under test. */
-    private final RestorableUniformRandomProvider generator;
-
-    /**
-     * Initializes generator instance.
-     *
-     * @param rng RNG to be tested.
-     */
-    public ProvidersCommonParametricTest(RestorableUniformRandomProvider rng) {
-        generator = rng;
-    }
-
-    @Parameters(name = "{index}: data={0}")
-    public static Iterable<RestorableUniformRandomProvider[]> getList() {
+    private static Iterable<RestorableUniformRandomProvider> getList() {
         return ProvidersList.list();
     }
 
-
     // Precondition tests
 
-    @Test
-    public void testPreconditionNextInt() {
+    @ParameterizedTest
+    @MethodSource("getList")
+    public void testPreconditionNextInt(UniformRandomProvider generator) {
         Assertions.assertThrows(IllegalArgumentException.class, () -> generator.nextInt(-1));
         Assertions.assertThrows(IllegalArgumentException.class, () -> generator.nextInt(0));
     }
 
-    @Test
-    public void testPreconditionNextLong() {
+    @ParameterizedTest
+    @MethodSource("getList")
+    public void testPreconditionNextLong(UniformRandomProvider generator) {
         Assertions.assertThrows(IllegalArgumentException.class, () -> generator.nextLong(-1));
         Assertions.assertThrows(IllegalArgumentException.class, () -> generator.nextLong(0));
     }
 
-    @Test
-    public void testPreconditionNextBytes() {
+    @ParameterizedTest
+    @MethodSource("getList")
+    public void testPreconditionNextBytes(UniformRandomProvider generator) {
         final int size = 10;
         final int num = 1;
         final byte[] buf = new byte[size];
@@ -80,11 +66,11 @@ public class ProvidersCommonParametricTest {
         Assertions.assertThrows(IndexOutOfBoundsException.class, () -> generator.nextBytes(buf, offset, -1));
     }
 
-
     // Uniformity tests
 
-    @Test
-    public void testUniformNextBytesFullBuffer() {
+    @ParameterizedTest
+    @MethodSource("getList")
+    public void testUniformNextBytesFullBuffer(UniformRandomProvider generator) {
         // Value chosen to exercise all the code lines in the
         // "nextBytes" methods.
         final int size = 23;
@@ -97,11 +83,12 @@ public class ProvidersCommonParametricTest {
             }
         };
 
-        Assertions.assertTrue(isUniformNextBytes(buffer, 0, size, nextMethod));
+        Assertions.assertTrue(isUniformNextBytes(buffer, 0, size, nextMethod), generator::toString);
     }
 
-    @Test
-    public void testUniformNextBytesPartialBuffer() {
+    @ParameterizedTest
+    @MethodSource("getList")
+    public void testUniformNextBytesPartialBuffer(UniformRandomProvider generator) {
         final int totalSize = 1234;
         final int offset = 567;
         final int size = 89;
@@ -116,52 +103,57 @@ public class ProvidersCommonParametricTest {
         };
 
         // Test should pass for the part of the buffer where values are put.
-        Assertions.assertTrue(isUniformNextBytes(buffer, offset, offset + size, nextMethod));
+        Assertions.assertTrue(isUniformNextBytes(buffer, offset, offset + size, nextMethod), generator::toString);
 
         // Test must fail for the parts of the buffer where no values are put.
         Assertions.assertFalse(isUniformNextBytes(buffer, 0, offset, nextMethod));
         Assertions.assertFalse(isUniformNextBytes(buffer, offset + size, buffer.length, nextMethod));
     }
 
-    @Test
-    public void testUniformNextIntegerInRange() {
+    @ParameterizedTest
+    @MethodSource("getList")
+    public void testUniformNextIntegerInRange(UniformRandomProvider generator) {
         // Statistical test uses 10 bins so tests are invalid below this level
-        checkNextIntegerInRange(10, 1000);
-        checkNextIntegerInRange(12, 1000);
-        checkNextIntegerInRange(31, 1000);
-        checkNextIntegerInRange(32, 1000);
-        checkNextIntegerInRange(2016128993, 1000);
-        checkNextIntegerInRange(1834691456, 1000);
-        checkNextIntegerInRange(869657561, 1000);
-        checkNextIntegerInRange(1570504788, 1000);
+        checkNextIntegerInRange(generator, 10, 1000);
+        checkNextIntegerInRange(generator, 12, 1000);
+        checkNextIntegerInRange(generator, 31, 1000);
+        checkNextIntegerInRange(generator, 32, 1000);
+        checkNextIntegerInRange(generator, 2016128993, 1000);
+        checkNextIntegerInRange(generator, 1834691456, 1000);
+        checkNextIntegerInRange(generator, 869657561, 1000);
+        checkNextIntegerInRange(generator, 1570504788, 1000);
     }
 
-    @Test
-    public void testUniformNextLongInRange() {
+    @ParameterizedTest
+    @MethodSource("getList")
+    public void testUniformNextLongInRange(UniformRandomProvider generator) {
         // Statistical test uses 10 bins so tests are invalid below this level
-        checkNextLongInRange(11, 1000);
-        checkNextLongInRange(19, 1000);
-        checkNextLongInRange(31, 1000);
-        checkNextLongInRange(32, 1000);
+        checkNextLongInRange(generator, 11, 1000);
+        checkNextLongInRange(generator, 19, 1000);
+        checkNextLongInRange(generator, 31, 1000);
+        checkNextLongInRange(generator, 32, 1000);
 
         final long q = Long.MAX_VALUE / 4;
-        checkNextLongInRange(q, 1000);
-        checkNextLongInRange(2 * q, 1000);
-        checkNextLongInRange(3 * q, 1000);
+        checkNextLongInRange(generator, q, 1000);
+        checkNextLongInRange(generator, 2 * q, 1000);
+        checkNextLongInRange(generator, 3 * q, 1000);
     }
 
-    @Test
-    public void testUniformNextFloat() {
-        checkNextFloat(1000);
+    @ParameterizedTest
+    @MethodSource("getList")
+    public void testUniformNextFloat(UniformRandomProvider generator) {
+        checkNextFloat(generator, 1000);
     }
 
-    @Test
-    public void testUniformNextDouble() {
-        checkNextDouble(1000);
+    @ParameterizedTest
+    @MethodSource("getList")
+    public void testUniformNextDouble(UniformRandomProvider generator) {
+        checkNextDouble(generator, 1000);
     }
 
-    @Test
-    public void testUniformNextIntRandomWalk() {
+    @ParameterizedTest
+    @MethodSource("getList")
+    public void testUniformNextIntRandomWalk(UniformRandomProvider generator) {
         final Callable<Boolean> nextMethod = new Callable<Boolean>() {
             @Override
             public Boolean call() throws Exception {
@@ -169,11 +161,12 @@ public class ProvidersCommonParametricTest {
             }
         };
 
-        checkRandomWalk(1000, nextMethod);
+        checkRandomWalk(generator, 1000, nextMethod);
     }
 
-    @Test
-    public void testUniformNextLongRandomWalk() {
+    @ParameterizedTest
+    @MethodSource("getList")
+    public void testUniformNextLongRandomWalk(UniformRandomProvider generator) {
         final Callable<Boolean> nextMethod = new Callable<Boolean>() {
             @Override
             public Boolean call() throws Exception {
@@ -181,11 +174,12 @@ public class ProvidersCommonParametricTest {
             }
         };
 
-        checkRandomWalk(1000, nextMethod);
+        checkRandomWalk(generator, 1000, nextMethod);
     }
 
-    @Test
-    public void testUniformNextBooleanRandomWalk() {
+    @ParameterizedTest
+    @MethodSource("getList")
+    public void testUniformNextBooleanRandomWalk(UniformRandomProvider generator) {
         final Callable<Boolean> nextMethod = new Callable<Boolean>() {
             @Override
             public Boolean call() throws Exception {
@@ -193,13 +187,14 @@ public class ProvidersCommonParametricTest {
             }
         };
 
-        checkRandomWalk(1000, nextMethod);
+        checkRandomWalk(generator, 1000, nextMethod);
     }
 
     // State save and restore tests.
 
-    @Test
-    public void testStateSettable() {
+    @ParameterizedTest
+    @MethodSource("getList")
+    public void testStateSettable(RestorableUniformRandomProvider generator) {
         // Should be fairly large in order to ensure that all the internal
         // state is away from its initial settings.
         final int n = 10000;
@@ -207,29 +202,31 @@ public class ProvidersCommonParametricTest {
         // Save.
         final RandomProviderState state = generator.saveState();
         // Store some values.
-        final List<Number> listOrig = makeList(n);
+        final List<Number> listOrig = makeList(n, generator);
         // Discard a few more.
-        final List<Number> listDiscard = makeList(n);
+        final List<Number> listDiscard = makeList(n, generator);
         Assertions.assertNotEquals(0, listDiscard.size());
         Assertions.assertNotEquals(listOrig, listDiscard);
         // Reset.
         generator.restoreState(state);
         // Replay.
-        final List<Number> listReplay = makeList(n);
+        final List<Number> listReplay = makeList(n, generator);
         Assertions.assertNotSame(listOrig, listReplay);
         // Check that the restored state is the same as the original.
         Assertions.assertEquals(listOrig, listReplay);
     }
 
-    @Test
-    public void testStateWrongSize() {
+    @ParameterizedTest
+    @MethodSource("getList")
+    public void testStateWrongSize(RestorableUniformRandomProvider generator) {
         final RandomProviderState state = new DummyGenerator().saveState();
         // Try to restore with an invalid state (wrong size).
         Assertions.assertThrows(IllegalStateException.class, () -> generator.restoreState(state));
     }
 
-    @Test
-    public void testRestoreForeignState() {
+    @ParameterizedTest
+    @MethodSource("getList")
+    public void testRestoreForeignState(RestorableUniformRandomProvider generator) {
         Assertions.assertThrows(IllegalArgumentException.class, () -> generator.restoreState(new RandomProviderState() {}));
     }
 
@@ -239,10 +236,11 @@ public class ProvidersCommonParametricTest {
      * Populates a list with random numbers.
      *
      * @param n Loop counter.
+     * @param generator RNG under test.
      * @return a list containing {@code 11 * n} random numbers.
      */
-    private List<Number> makeList(int n) {
-        final List<Number> list = new ArrayList<Number>();
+    private List<Number> makeList(int n, UniformRandomProvider generator) {
+        final List<Number> list = new ArrayList<>();
 
         for (int i = 0; i < n; i++) {
             // Append 11 values.
@@ -328,11 +326,14 @@ public class ProvidersCommonParametricTest {
      * approximately equal number of counts.
      * The test uses the expectation from a fixed-step "random walk".
      *
+     * @param generator Generator.
+     * @param sampleSize Number of random values generated.
      * @param nextMethod Method that returns {@code true} if the generated
      * values are to be placed in the first bin, {@code false} if it must
      * go to the second bin.
      */
-    private void checkRandomWalk(int sampleSize,
+    private void checkRandomWalk(UniformRandomProvider generator,
+                                 int sampleSize,
                                  Callable<Boolean> nextMethod) {
         int walk = 0;
 
@@ -359,41 +360,32 @@ public class ProvidersCommonParametricTest {
     /**
      * Tests uniformity of the distribution produced by {@code nextInt(int)}.
      *
+     * @param generator Generator.
      * @param max Upper bound.
      * @param sampleSize Number of random values generated.
      */
-    private void checkNextIntegerInRange(final int max,
-                                         int sampleSize) {
-        checkNextIntegerInRange(generator, max, sampleSize);
-    }
-
-    /**
-     * Tests uniformity of the distribution produced by {@code nextInt(int)}.
-     *
-     * @param rng Generator.
-     * @param max Upper bound.
-     * @param sampleSize Number of random values generated.
-     */
-    private void checkNextIntegerInRange(final UniformRandomProvider rng,
+    private void checkNextIntegerInRange(final UniformRandomProvider generator,
                                          final int max,
                                          int sampleSize) {
         final Callable<Integer> nextMethod = new Callable<Integer>() {
             @Override
             public Integer call() throws Exception {
-                return rng.nextInt(max);
+                return generator.nextInt(max);
             }
         };
 
-        checkNextInRange(max, sampleSize, nextMethod);
+        checkNextInRange(generator, max, sampleSize, nextMethod);
     }
 
     /**
      * Tests uniformity of the distribution produced by {@code nextLong(long)}.
      *
+     * @param generator Generator.
      * @param max Upper bound.
      * @param sampleSize Number of random values generated.
      */
-    private void checkNextLongInRange(final long max,
+    private void checkNextLongInRange(final UniformRandomProvider generator,
+                                      long max,
                                       int sampleSize) {
         final Callable<Long> nextMethod = new Callable<Long>() {
             @Override
@@ -402,15 +394,17 @@ public class ProvidersCommonParametricTest {
             }
         };
 
-        checkNextInRange(max, sampleSize, nextMethod);
+        checkNextInRange(generator, max, sampleSize, nextMethod);
     }
 
     /**
      * Tests uniformity of the distribution produced by {@code nextFloat()}.
      *
+     * @param generator Generator.
      * @param sampleSize Number of random values generated.
      */
-    private void checkNextFloat(int sampleSize) {
+    private void checkNextFloat(final UniformRandomProvider generator,
+                                int sampleSize) {
         final int max = 1234;
         final Callable<Integer> nextMethod = new Callable<Integer>() {
             @Override
@@ -419,15 +413,17 @@ public class ProvidersCommonParametricTest {
             }
         };
 
-        checkNextInRange(max, sampleSize, nextMethod);
+        checkNextInRange(generator, max, sampleSize, nextMethod);
     }
 
     /**
      * Tests uniformity of the distribution produced by {@code nextDouble()}.
      *
+     * @param generator Generator.
      * @param sampleSize Number of random values generated.
      */
-    private void checkNextDouble(int sampleSize) {
+    private void checkNextDouble(final UniformRandomProvider generator,
+                                 int sampleSize) {
         final int max = 578;
         final Callable<Integer> nextMethod = new Callable<Integer>() {
             @Override
@@ -436,7 +432,7 @@ public class ProvidersCommonParametricTest {
             }
         };
 
-        checkNextInRange(max, sampleSize, nextMethod);
+        checkNextInRange(generator, max, sampleSize, nextMethod);
     }
 
     /**
@@ -447,11 +443,13 @@ public class ProvidersCommonParametricTest {
      * Repeat tests are performed at the 1% level and the total number of failed
      * tests is tested at the 0.5% significance level.
      *
+     * @param generator Generator.
      * @param max Upper bound.
      * @param nextMethod method to call.
      * @param sampleSize Number of random values generated.
      */
-    private <T extends Number> void checkNextInRange(T max,
+    private <T extends Number> void checkNextInRange(final UniformRandomProvider generator,
+                                                     T max,
                                                      int sampleSize,
                                                      Callable<T> nextMethod) {
         final int numTests = 500;
@@ -532,27 +530,27 @@ public class ProvidersCommonParametricTest {
     }
 
     /**
-     * @param rng Generator.
+     * @param generator Generator.
      * @param chunkSize Size of the small buffer.
      * @param numChunks Number of chunks that make the large buffer.
      */
-    static void checkNextBytesChunks(RestorableUniformRandomProvider rng,
+    static void checkNextBytesChunks(RestorableUniformRandomProvider generator,
                                      int chunkSize,
                                      int numChunks) {
         final byte[] b1 = new byte[chunkSize * numChunks];
         final byte[] b2 = new byte[chunkSize];
 
-        final RandomProviderState state = rng.saveState();
+        final RandomProviderState state = generator.saveState();
 
         // Generate the chunks in a single call.
-        rng.nextBytes(b1);
+        generator.nextBytes(b1);
 
         // Reset to previous state.
-        rng.restoreState(state);
+        generator.restoreState(state);
 
         // Generate the chunks in consecutive calls.
         for (int i = 0; i < numChunks; i++) {
-            rng.nextBytes(b2);
+            generator.nextBytes(b2);
         }
 
         // Store last "chunkSize" bytes of b1 into b3.
diff --git a/commons-rng-core/src/test/java/org/apache/commons/rng/core/ProvidersList.java b/commons-rng-core/src/test/java/org/apache/commons/rng/core/ProvidersList.java
index 620a5cc..6f18ab4 100644
--- a/commons-rng-core/src/test/java/org/apache/commons/rng/core/ProvidersList.java
+++ b/commons-rng-core/src/test/java/org/apache/commons/rng/core/ProvidersList.java
@@ -78,17 +78,13 @@ import org.apache.commons.rng.RestorableUniformRandomProvider;
  */
 public final class ProvidersList {
     /** List of all RNGs implemented in the library. */
-    private static final List<RestorableUniformRandomProvider[]> LIST =
-        new ArrayList<RestorableUniformRandomProvider[]>();
+    private static final List<RestorableUniformRandomProvider> LIST = new ArrayList<>();
     /** List of 32-bits based RNGs. */
-    private static final List<RestorableUniformRandomProvider[]> LIST32 =
-        new ArrayList<RestorableUniformRandomProvider[]>();
+    private static final List<RestorableUniformRandomProvider> LIST32 = new ArrayList<>();
     /** List of 64-bits based RNGs. */
-    private static final List<RestorableUniformRandomProvider[]> LIST64 =
-        new ArrayList<RestorableUniformRandomProvider[]>();
+    private static final List<RestorableUniformRandomProvider> LIST64 = new ArrayList<>();
     /** List of {@link JumpableUniformRandomProvider} RNGs. */
-    private static final List<JumpableUniformRandomProvider[]> LIST_JUMP =
-        new ArrayList<JumpableUniformRandomProvider[]>();
+    private static final List<JumpableUniformRandomProvider> LIST_JUMP = new ArrayList<>();
 
     static {
         // External generator for creating a random seed.
@@ -96,57 +92,57 @@ public final class ProvidersList {
 
         try {
             // "int"-based RNGs.
-            add(LIST32, new JDKRandom(g.nextLong()));
-            add(LIST32, new MersenneTwister(new int[] {g.nextInt(), g.nextInt(), g.nextInt()}));
-            add(LIST32, new Well512a(new int[] {g.nextInt(), g.nextInt(), g.nextInt()}));
-            add(LIST32, new Well1024a(new int[] {g.nextInt(), g.nextInt(), g.nextInt()}));
-            add(LIST32, new Well19937a(new int[] {g.nextInt(), g.nextInt(), g.nextInt()}));
-            add(LIST32, new Well19937c(new int[] {g.nextInt(), g.nextInt(), g.nextInt()}));
-            add(LIST32, new Well44497a(new int[] {g.nextInt(), g.nextInt(), g.nextInt()}));
-            add(LIST32, new Well44497b(new int[] {g.nextInt(), g.nextInt(), g.nextInt()}));
-            add(LIST32, new ISAACRandom(new int[] {g.nextInt(), g.nextInt(), g.nextInt()}));
-            add(LIST32, new MultiplyWithCarry256(new int[] {g.nextInt(), g.nextInt(), g.nextInt()}));
-            add(LIST32, new KISSRandom(new int[] {g.nextInt(), g.nextInt(), g.nextInt()}));
-            add(LIST32, new XoRoShiRo64Star(new int[] {g.nextInt(), g.nextInt()}));
-            add(LIST32, new XoRoShiRo64StarStar(new int[] {g.nextInt(), g.nextInt(), g.nextInt()}));
-            add(LIST32, new XoShiRo128Plus(new int[] {g.nextInt(), g.nextInt(), g.nextInt()}));
-            add(LIST32, new XoShiRo128StarStar(new int[] {g.nextInt(), g.nextInt(), g.nextInt()}));
-            add(LIST32, new PcgXshRr32(new long[] {g.nextLong()}));
-            add(LIST32, new PcgXshRr32(g.nextLong()));
-            add(LIST32, new PcgXshRs32(new long[] {g.nextLong()}));
-            add(LIST32, new PcgXshRs32(g.nextLong()));
-            add(LIST32, new PcgMcgXshRr32(g.nextLong()));
-            add(LIST32, new PcgMcgXshRs32(g.nextLong()));
+            LIST32.add(new JDKRandom(g.nextLong()));
+            LIST32.add(new MersenneTwister(new int[] {g.nextInt(), g.nextInt(), g.nextInt()}));
+            LIST32.add(new Well512a(new int[] {g.nextInt(), g.nextInt(), g.nextInt()}));
+            LIST32.add(new Well1024a(new int[] {g.nextInt(), g.nextInt(), g.nextInt()}));
+            LIST32.add(new Well19937a(new int[] {g.nextInt(), g.nextInt(), g.nextInt()}));
+            LIST32.add(new Well19937c(new int[] {g.nextInt(), g.nextInt(), g.nextInt()}));
+            LIST32.add(new Well44497a(new int[] {g.nextInt(), g.nextInt(), g.nextInt()}));
+            LIST32.add(new Well44497b(new int[] {g.nextInt(), g.nextInt(), g.nextInt()}));
+            LIST32.add(new ISAACRandom(new int[] {g.nextInt(), g.nextInt(), g.nextInt()}));
+            LIST32.add(new MultiplyWithCarry256(new int[] {g.nextInt(), g.nextInt(), g.nextInt()}));
+            LIST32.add(new KISSRandom(new int[] {g.nextInt(), g.nextInt(), g.nextInt()}));
+            LIST32.add(new XoRoShiRo64Star(new int[] {g.nextInt(), g.nextInt()}));
+            LIST32.add(new XoRoShiRo64StarStar(new int[] {g.nextInt(), g.nextInt(), g.nextInt()}));
+            LIST32.add(new XoShiRo128Plus(new int[] {g.nextInt(), g.nextInt(), g.nextInt()}));
+            LIST32.add(new XoShiRo128StarStar(new int[] {g.nextInt(), g.nextInt(), g.nextInt()}));
+            LIST32.add(new PcgXshRr32(new long[] {g.nextLong()}));
+            LIST32.add(new PcgXshRr32(g.nextLong()));
+            LIST32.add(new PcgXshRs32(new long[] {g.nextLong()}));
+            LIST32.add(new PcgXshRs32(g.nextLong()));
+            LIST32.add(new PcgMcgXshRr32(g.nextLong()));
+            LIST32.add(new PcgMcgXshRs32(g.nextLong()));
             // Ensure a high complexity increment is used for the Weyl sequence
-            add(LIST32, new MiddleSquareWeylSequence(new long[] {g.nextLong(), g.nextLong(), 0xb5ad4eceda1ce2a9L}));
-            add(LIST32, new DotyHumphreySmallFastCounting32(new int[] {g.nextInt(), g.nextInt()}));
-            add(LIST32, new JenkinsSmallFast32(g.nextInt()));
-            add(LIST32, new XoShiRo128PlusPlus(new int[] {g.nextInt(), g.nextInt(), g.nextInt()}));
+            LIST32.add(new MiddleSquareWeylSequence(new long[] {g.nextLong(), g.nextLong(), 0xb5ad4eceda1ce2a9L}));
+            LIST32.add(new DotyHumphreySmallFastCounting32(new int[] {g.nextInt(), g.nextInt()}));
+            LIST32.add(new JenkinsSmallFast32(g.nextInt()));
+            LIST32.add(new XoShiRo128PlusPlus(new int[] {g.nextInt(), g.nextInt(), g.nextInt()}));
             // ... add more here.
 
             // "long"-based RNGs.
-            add(LIST64, new SplitMix64(g.nextLong()));
-            add(LIST64, new XorShift1024Star(new long[] {g.nextLong(), g.nextLong(), g.nextLong(), g.nextLong()}));
-            add(LIST64, new XorShift1024StarPhi(new long[] {g.nextLong(), g.nextLong(), g.nextLong(), g.nextLong()}));
-            add(LIST64, new TwoCmres(g.nextInt()));
-            add(LIST64, new TwoCmres(g.nextInt(), 5, 8));
-            add(LIST64, new MersenneTwister64(new long[] {g.nextLong(), g.nextLong(), g.nextLong(), g.nextLong()}));
-            add(LIST64, new XoRoShiRo128Plus(new long[] {g.nextLong(), g.nextLong()}));
-            add(LIST64, new XoRoShiRo128StarStar(new long[] {g.nextLong(), g.nextLong()}));
-            add(LIST64, new XoShiRo256Plus(new long[] {g.nextLong(), g.nextLong(), g.nextLong(), g.nextLong()}));
-            add(LIST64, new XoShiRo256StarStar(new long[] {g.nextLong(), g.nextLong(), g.nextLong(), g.nextLong()}));
-            add(LIST64, new XoShiRo512Plus(new long[] {g.nextLong(), g.nextLong(), g.nextLong(), g.nextLong()}));
-            add(LIST64, new XoShiRo512StarStar(new long[] {g.nextLong(), g.nextLong(), g.nextLong(), g.nextLong()}));
-            add(LIST64, new PcgRxsMXs64(new long[] {g.nextLong()}));
-            add(LIST64, new PcgRxsMXs64(g.nextLong()));
-            add(LIST64, new DotyHumphreySmallFastCounting64(new long[] {g.nextLong(), g.nextLong()}));
-            add(LIST64, new JenkinsSmallFast64(g.nextLong()));
-            add(LIST64, new XoRoShiRo128PlusPlus(new long[] {g.nextLong(), g.nextLong()}));
-            add(LIST64, new XoShiRo256PlusPlus(new long[] {g.nextLong(), g.nextLong(), g.nextLong(), g.nextLong()}));
-            add(LIST64, new XoShiRo512PlusPlus(new long[] {g.nextLong(), g.nextLong(), g.nextLong(), g.nextLong()}));
-            add(LIST64, new XoRoShiRo1024PlusPlus(new long[] {g.nextLong(), g.nextLong(), g.nextLong(), g.nextLong()}));
-            add(LIST64, new XoRoShiRo1024Star(new long[] {g.nextLong(), g.nextLong(), g.nextLong(), g.nextLong()}));
-            add(LIST64, new XoRoShiRo1024StarStar(new long[] {g.nextLong(), g.nextLong(), g.nextLong(), g.nextLong()}));
+            LIST64.add(new SplitMix64(g.nextLong()));
+            LIST64.add(new XorShift1024Star(new long[] {g.nextLong(), g.nextLong(), g.nextLong(), g.nextLong()}));
+            LIST64.add(new XorShift1024StarPhi(new long[] {g.nextLong(), g.nextLong(), g.nextLong(), g.nextLong()}));
+            LIST64.add(new TwoCmres(g.nextInt()));
+            LIST64.add(new TwoCmres(g.nextInt(), 5, 8));
+            LIST64.add(new MersenneTwister64(new long[] {g.nextLong(), g.nextLong(), g.nextLong(), g.nextLong()}));
+            LIST64.add(new XoRoShiRo128Plus(new long[] {g.nextLong(), g.nextLong()}));
+            LIST64.add(new XoRoShiRo128StarStar(new long[] {g.nextLong(), g.nextLong()}));
+            LIST64.add(new XoShiRo256Plus(new long[] {g.nextLong(), g.nextLong(), g.nextLong(), g.nextLong()}));
+            LIST64.add(new XoShiRo256StarStar(new long[] {g.nextLong(), g.nextLong(), g.nextLong(), g.nextLong()}));
+            LIST64.add(new XoShiRo512Plus(new long[] {g.nextLong(), g.nextLong(), g.nextLong(), g.nextLong()}));
+            LIST64.add(new XoShiRo512StarStar(new long[] {g.nextLong(), g.nextLong(), g.nextLong(), g.nextLong()}));
+            LIST64.add(new PcgRxsMXs64(new long[] {g.nextLong()}));
+            LIST64.add(new PcgRxsMXs64(g.nextLong()));
+            LIST64.add(new DotyHumphreySmallFastCounting64(new long[] {g.nextLong(), g.nextLong()}));
+            LIST64.add(new JenkinsSmallFast64(g.nextLong()));
+            LIST64.add(new XoRoShiRo128PlusPlus(new long[] {g.nextLong(), g.nextLong()}));
+            LIST64.add(new XoShiRo256PlusPlus(new long[] {g.nextLong(), g.nextLong(), g.nextLong(), g.nextLong()}));
+            LIST64.add(new XoShiRo512PlusPlus(new long[] {g.nextLong(), g.nextLong(), g.nextLong(), g.nextLong()}));
+            LIST64.add(new XoRoShiRo1024PlusPlus(new long[] {g.nextLong(), g.nextLong(), g.nextLong(), g.nextLong()}));
+            LIST64.add(new XoRoShiRo1024Star(new long[] {g.nextLong(), g.nextLong(), g.nextLong(), g.nextLong()}));
+            LIST64.add(new XoRoShiRo1024StarStar(new long[] {g.nextLong(), g.nextLong(), g.nextLong(), g.nextLong()}));
             // ... add more here.
 
             // Do not modify the remaining statements.
@@ -154,11 +150,9 @@ public final class ProvidersList {
             LIST.addAll(LIST32);
             LIST.addAll(LIST64);
             // Dynamically identify the Jumpable RNGs
-            for (RestorableUniformRandomProvider[] rng : LIST) {
-                if (rng[0] instanceof JumpableUniformRandomProvider) {
-                    add(LIST_JUMP, (JumpableUniformRandomProvider) rng[0]);
-                }
-            }
+            LIST.stream()
+                .filter(rng -> rng instanceof JumpableUniformRandomProvider)
+                .forEach(rng -> LIST_JUMP.add((JumpableUniformRandomProvider) rng));
         } catch (Exception e) {
             // CHECKSTYLE: stop Regexp
             System.err.println("Unexpected exception while creating the list of generators: " + e);
@@ -174,30 +168,12 @@ public final class ProvidersList {
     private ProvidersList() {}
 
     /**
-     * Helper to statisfy Junit requirement that each parameter set contains
-     * the same number of objects.
-     */
-    private static void add(List<RestorableUniformRandomProvider[]> list,
-                            RestorableUniformRandomProvider rng) {
-        list.add(new RestorableUniformRandomProvider[] {rng});
-    }
-
-    /**
-     * Helper to statisfy Junit requirement that each parameter set contains
-     * the same number of objects.
-     */
-    private static void add(List<JumpableUniformRandomProvider[]> list,
-                            JumpableUniformRandomProvider rng) {
-        list.add(new JumpableUniformRandomProvider[] {rng});
-    }
-
-    /**
      * Subclasses that are "parametric" tests can forward the call to
      * the "@Parameters"-annotated method to this method.
      *
      * @return the list of all generators.
      */
-    public static Iterable<RestorableUniformRandomProvider[]> list() {
+    public static Iterable<RestorableUniformRandomProvider> list() {
         return Collections.unmodifiableList(LIST);
     }
 
@@ -207,7 +183,7 @@ public final class ProvidersList {
      *
      * @return the list of 32-bits based generators.
      */
-    public static Iterable<RestorableUniformRandomProvider[]> list32() {
+    public static Iterable<RestorableUniformRandomProvider> list32() {
         return Collections.unmodifiableList(LIST32);
     }
 
@@ -217,7 +193,7 @@ public final class ProvidersList {
      *
      * @return the list of 64-bits based generators.
      */
-    public static Iterable<RestorableUniformRandomProvider[]> list64() {
+    public static Iterable<RestorableUniformRandomProvider> list64() {
         return Collections.unmodifiableList(LIST64);
     }
 
@@ -227,7 +203,7 @@ public final class ProvidersList {
      *
      * @return the list of {@link JumpableUniformRandomProvider} generators.
      */
-    public static Iterable<JumpableUniformRandomProvider[]> listJumpable() {
+    public static Iterable<JumpableUniformRandomProvider> listJumpable() {
         return Collections.unmodifiableList(LIST_JUMP);
     }
 }
diff --git a/commons-rng-sampling/src/test/java/org/apache/commons/rng/sampling/distribution/ContinuousSamplerParametricTest.java b/commons-rng-sampling/src/test/java/org/apache/commons/rng/sampling/distribution/ContinuousSamplerParametricTest.java
index 4ad40e3..058e3b0 100644
--- a/commons-rng-sampling/src/test/java/org/apache/commons/rng/sampling/distribution/ContinuousSamplerParametricTest.java
+++ b/commons-rng-sampling/src/test/java/org/apache/commons/rng/sampling/distribution/ContinuousSamplerParametricTest.java
@@ -21,36 +21,21 @@ import java.util.List;
 import java.util.ArrayList;
 
 import org.junit.jupiter.api.Assertions;
-import org.junit.Test;
-import org.junit.runner.RunWith;
-import org.junit.runners.Parameterized;
-import org.junit.runners.Parameterized.Parameters;
+import org.junit.jupiter.params.ParameterizedTest;
+import org.junit.jupiter.params.provider.MethodSource;
 
 /**
  * Tests for random deviates generators.
  */
-@RunWith(value = Parameterized.class)
 public class ContinuousSamplerParametricTest {
-    /** Sampler under test. */
-    private final ContinuousSamplerTestData sampler;
-
-    /**
-     * Initializes the test instance.
-     *
-     * @param data sampler to be tested.
-     */
-    public ContinuousSamplerParametricTest(ContinuousSamplerTestData data) {
-        sampler = data;
-    }
-
-    @Parameters(name = "{index}: data={0}")
-    public static Iterable<ContinuousSamplerTestData[]> getList() {
+    private static Iterable<ContinuousSamplerTestData> getSamplerTestData() {
         return ContinuousSamplersList.list();
     }
 
-    @Test
-    public void testSampling() {
-        check(20000, sampler.getSampler(), sampler.getDeciles());
+    @ParameterizedTest
+    @MethodSource("getSamplerTestData")
+    public void testSampling(ContinuousSamplerTestData data) {
+        check(20000, data.getSampler(), data.getDeciles());
     }
 
     /**
@@ -85,7 +70,7 @@ public class ContinuousSamplerParametricTest {
         final double chi2CriticalValue = 21.67;
 
         // For storing chi2 larger than the critical value.
-        final List<Double> failedStat = new ArrayList<Double>();
+        final List<Double> failedStat = new ArrayList<>();
         try {
             final int lastDecileIndex = numBins - 1;
             for (int i = 0; i < numTests; i++) {
diff --git a/commons-rng-sampling/src/test/java/org/apache/commons/rng/sampling/distribution/ContinuousSamplersList.java b/commons-rng-sampling/src/test/java/org/apache/commons/rng/sampling/distribution/ContinuousSamplersList.java
index e84776f..d145db3 100644
--- a/commons-rng-sampling/src/test/java/org/apache/commons/rng/sampling/distribution/ContinuousSamplersList.java
+++ b/commons-rng-sampling/src/test/java/org/apache/commons/rng/sampling/distribution/ContinuousSamplersList.java
@@ -28,8 +28,7 @@ import org.apache.commons.rng.simple.RandomSource;
  */
 public final class ContinuousSamplersList {
     /** List of all RNGs implemented in the library. */
-    private static final List<ContinuousSamplerTestData[]> LIST =
-        new ArrayList<ContinuousSamplerTestData[]>();
+    private static final List<ContinuousSamplerTestData> LIST = new ArrayList<>();
 
     static {
         try {
@@ -290,7 +289,7 @@ public final class ContinuousSamplersList {
      * @param dist Distribution to which the samples are supposed to conform.
      * @param rng Generator of uniformly distributed sequences.
      */
-    private static void add(List<ContinuousSamplerTestData[]> list,
+    private static void add(List<ContinuousSamplerTestData> list,
                             final org.apache.commons.math3.distribution.RealDistribution dist,
                             UniformRandomProvider rng) {
         final ContinuousSampler inverseMethodSampler =
@@ -305,8 +304,8 @@ public final class ContinuousSamplersList {
                         return dist.toString();
                     }
                 });
-        list.add(new ContinuousSamplerTestData[] {new ContinuousSamplerTestData(inverseMethodSampler,
-                                                                                getDeciles(dist))});
+        list.add(new ContinuousSamplerTestData(inverseMethodSampler,
+                                               getDeciles(dist)));
     }
 
     /**
@@ -314,11 +313,11 @@ public final class ContinuousSamplersList {
      * @param dist Distribution to which the samples are supposed to conform.
      * @param sampler Sampler.
      */
-    private static void add(List<ContinuousSamplerTestData[]> list,
+    private static void add(List<ContinuousSamplerTestData> list,
                             final org.apache.commons.math3.distribution.RealDistribution dist,
                             final ContinuousSampler sampler) {
-        list.add(new ContinuousSamplerTestData[] {new ContinuousSamplerTestData(sampler,
-                                                                                getDeciles(dist))});
+        list.add(new ContinuousSamplerTestData(sampler,
+                                               getDeciles(dist)));
     }
 
     /**
@@ -326,11 +325,11 @@ public final class ContinuousSamplersList {
      * @param deciles Deciles of the given distribution.
      * @param sampler Sampler.
      */
-    private static void add(List<ContinuousSamplerTestData[]> list,
+    private static void add(List<ContinuousSamplerTestData> list,
                             final double[] deciles,
                             final ContinuousSampler sampler) {
-        list.add(new ContinuousSamplerTestData[] {new ContinuousSamplerTestData(sampler,
-                                                                                deciles)});
+        list.add(new ContinuousSamplerTestData(sampler,
+                                               deciles));
     }
 
     /**
@@ -339,7 +338,7 @@ public final class ContinuousSamplersList {
      *
      * @return the list of all generators.
      */
-    public static Iterable<ContinuousSamplerTestData[]> list() {
+    public static Iterable<ContinuousSamplerTestData> list() {
         return Collections.unmodifiableList(LIST);
     }
 
diff --git a/commons-rng-sampling/src/test/java/org/apache/commons/rng/sampling/distribution/DiscreteSamplerParametricTest.java b/commons-rng-sampling/src/test/java/org/apache/commons/rng/sampling/distribution/DiscreteSamplerParametricTest.java
index 8ad84d1..f65c68c 100644
--- a/commons-rng-sampling/src/test/java/org/apache/commons/rng/sampling/distribution/DiscreteSamplerParametricTest.java
+++ b/commons-rng-sampling/src/test/java/org/apache/commons/rng/sampling/distribution/DiscreteSamplerParametricTest.java
@@ -21,49 +21,28 @@ import java.util.List;
 import java.util.ArrayList;
 
 import org.junit.jupiter.api.Assertions;
-import org.junit.Test;
-import org.junit.runner.RunWith;
-import org.junit.runners.Parameterized;
-import org.junit.runners.Parameterized.Parameters;
+import org.junit.jupiter.params.ParameterizedTest;
+import org.junit.jupiter.params.provider.MethodSource;
 
 import org.apache.commons.math3.stat.inference.ChiSquareTest;
 
 /**
  * Tests for random deviates generators.
  */
-@RunWith(value = Parameterized.class)
 public class DiscreteSamplerParametricTest {
-    /** Sampler under test. */
-    private final DiscreteSamplerTestData sampler;
-
-    /**
-     * Initializes the test instance.
-     *
-     * @param data sampler to be tested.
-     */
-    public DiscreteSamplerParametricTest(DiscreteSamplerTestData data) {
-        sampler = data;
-    }
-
-    @Parameters(name = "{index}: data={0}")
-    public static Iterable<DiscreteSamplerTestData[]> getList() {
+    private static Iterable<DiscreteSamplerTestData> getSamplerTestData() {
         return DiscreteSamplersList.list();
     }
 
-    @Test
-    public void testSampling() {
+    @ParameterizedTest
+    @MethodSource("getSamplerTestData")
+    public void testSampling(DiscreteSamplerTestData data) {
         final int sampleSize = 10000;
-
-        final double[] prob = sampler.getProbabilities();
-        final int len = prob.length;
-        final double[] expected = new double[len];
-        for (int i = 0; i < len; i++) {
-            expected[i] = prob[i] * sampleSize;
-        }
+        // Probabilities are normalised by the chi-square test
         check(sampleSize,
-              sampler.getSampler(),
-              sampler.getPoints(),
-              expected);
+              data.getSampler(),
+              data.getPoints(),
+              data.getProbabilities());
     }
 
     /**
diff --git a/commons-rng-sampling/src/test/java/org/apache/commons/rng/sampling/distribution/DiscreteSamplersList.java b/commons-rng-sampling/src/test/java/org/apache/commons/rng/sampling/distribution/DiscreteSamplersList.java
index 3e4b9f7..abb2445 100644
--- a/commons-rng-sampling/src/test/java/org/apache/commons/rng/sampling/distribution/DiscreteSamplersList.java
+++ b/commons-rng-sampling/src/test/java/org/apache/commons/rng/sampling/distribution/DiscreteSamplersList.java
@@ -30,8 +30,7 @@ import org.apache.commons.rng.simple.RandomSource;
  */
 public final class DiscreteSamplersList {
     /** List of all RNGs implemented in the library. */
-    private static final List<DiscreteSamplerTestData[]> LIST =
-        new ArrayList<DiscreteSamplerTestData[]>();
+    private static final List<DiscreteSamplerTestData> LIST = new ArrayList<>();
 
     static {
         try {
@@ -204,7 +203,7 @@ public final class DiscreteSamplersList {
      * @param points Outcomes selection.
      * @param rng Generator of uniformly distributed sequences.
      */
-    private static void add(List<DiscreteSamplerTestData[]> list,
+    private static void add(List<DiscreteSamplerTestData> list,
                             final org.apache.commons.math3.distribution.IntegerDistribution dist,
                             int[] points,
                             UniformRandomProvider rng) {
@@ -220,9 +219,9 @@ public final class DiscreteSamplersList {
                         return dist.toString();
                     }
                 });
-        list.add(new DiscreteSamplerTestData[] {new DiscreteSamplerTestData(inverseMethodSampler,
-                                                                            points,
-                                                                            getProbabilities(dist, points))});
+        list.add(new DiscreteSamplerTestData(inverseMethodSampler,
+                                             points,
+                                             getProbabilities(dist, points)));
     }
 
     /**
@@ -231,13 +230,13 @@ public final class DiscreteSamplersList {
      * @param points Outcomes selection.
      * @param sampler Sampler.
      */
-    private static void add(List<DiscreteSamplerTestData[]> list,
+    private static void add(List<DiscreteSamplerTestData> list,
                             final org.apache.commons.math3.distribution.IntegerDistribution dist,
                             int[] points,
                             final DiscreteSampler sampler) {
-        list.add(new DiscreteSamplerTestData[] {new DiscreteSamplerTestData(sampler,
-                                                                            points,
-                                                                            getProbabilities(dist, points))});
+        list.add(new DiscreteSamplerTestData(sampler,
+                                             points,
+                                             getProbabilities(dist, points)));
     }
 
     /**
@@ -245,12 +244,12 @@ public final class DiscreteSamplersList {
      * @param probabilities Probability distribution to which the samples are supposed to conform.
      * @param sampler Sampler.
      */
-    private static void add(List<DiscreteSamplerTestData[]> list,
+    private static void add(List<DiscreteSamplerTestData> list,
                             final double[] probabilities,
                             final DiscreteSampler sampler) {
-        list.add(new DiscreteSamplerTestData[] {new DiscreteSamplerTestData(sampler,
-                                                                            MathArrays.natural(probabilities.length),
-                                                                            probabilities)});
+        list.add(new DiscreteSamplerTestData(sampler,
+                                             MathArrays.natural(probabilities.length),
+                                             probabilities));
     }
 
     /**
@@ -259,7 +258,7 @@ public final class DiscreteSamplersList {
      *
      * @return the list of all generators.
      */
-    public static Iterable<DiscreteSamplerTestData[]> list() {
+    public static Iterable<DiscreteSamplerTestData> list() {
         return Collections.unmodifiableList(LIST);
     }
 
diff --git a/commons-rng-simple/src/test/java/org/apache/commons/rng/simple/ProvidersCommonParametricTest.java b/commons-rng-simple/src/test/java/org/apache/commons/rng/simple/ProvidersCommonParametricTest.java
index dffa57c..ed56283 100644
--- a/commons-rng-simple/src/test/java/org/apache/commons/rng/simple/ProvidersCommonParametricTest.java
+++ b/commons-rng-simple/src/test/java/org/apache/commons/rng/simple/ProvidersCommonParametricTest.java
@@ -27,11 +27,9 @@ import java.io.ByteArrayOutputStream;
 import java.io.ByteArrayInputStream;
 
 import org.junit.jupiter.api.Assertions;
-import org.junit.Test;
 import org.junit.jupiter.api.Assumptions;
-import org.junit.runner.RunWith;
-import org.junit.runners.Parameterized;
-import org.junit.runners.Parameterized.Parameters;
+import org.junit.jupiter.params.ParameterizedTest;
+import org.junit.jupiter.params.provider.MethodSource;
 
 import org.apache.commons.rng.UniformRandomProvider;
 import org.apache.commons.rng.JumpableUniformRandomProvider;
@@ -44,51 +42,35 @@ import org.apache.commons.rng.core.source64.SplitMix64;
 /**
  * Tests which all generators must pass.
  */
-@RunWith(value = Parameterized.class)
 public class ProvidersCommonParametricTest {
-    /** RNG under test. */
-    private final UniformRandomProvider generator;
-    /** RNG specifier. */
-    private final RandomSource originalSource;
-    /** Seed (constructor's first parameter). */
-    private final Object originalSeed;
-    /** Constructor's additional parameters. */
-    private final Object[] originalArgs;
-
-    /**
-     * Initializes the test instance.
-     *
-     * @param data Random source (and seed arguments) to be tested.
-     */
-    public ProvidersCommonParametricTest(ProvidersList.Data data) {
-        originalSource = data.getSource();
-        originalSeed = data.getSeed();
-        originalArgs = data.getArgs();
-        generator = originalSource.create(originalSeed, originalArgs);
-    }
-
-    @Parameters(name = "{index}: data={0}")
-    public static Iterable<ProvidersList.Data[]> getList() {
+    private static Iterable<ProvidersList.Data> getProvidersTestData() {
         return ProvidersList.list();
     }
 
     // Seeding tests.
 
-    @Test
-    public void testUnsupportedSeedType() {
+    @ParameterizedTest
+    @MethodSource("getProvidersTestData")
+    public void testUnsupportedSeedType(ProvidersList.Data data) {
         final byte seed = 123;
-        Assertions.assertThrows(UnsupportedOperationException.class, () -> originalSource.create(seed, originalArgs));
+        Assertions.assertThrows(UnsupportedOperationException.class,
+            () -> data.getSource().create(seed, data.getArgs()));
     }
 
     /**
      * Test the factory create method returns the same class as the instance create method.
      */
-    @Test
-    public void testFactoryCreateMethod() {
+    @ParameterizedTest
+    @MethodSource("getProvidersTestData")
+    public void testFactoryCreateMethod(ProvidersList.Data data) {
+        final RandomSource originalSource = data.getSource();
+        final Object originalSeed = data.getSeed();
+        final Object[] originalArgs = data.getArgs();
         // Cannot test providers that require arguments
         Assumptions.assumeTrue(originalArgs == null);
         @SuppressWarnings("deprecation")
-        final UniformRandomProvider rng = RandomSource.create(originalSource);
+        final UniformRandomProvider rng = RandomSource.create(data.getSource());
+        final UniformRandomProvider generator = originalSource.create(originalSeed, originalArgs);
         Assertions.assertEquals(generator.getClass(), rng.getClass());
     }
 
@@ -96,8 +78,13 @@ public class ProvidersCommonParametricTest {
      * Test the factory create method returns the same class as the instance create method
      * and produces the same output.
      */
-    @Test
-    public void testFactoryCreateMethodWithSeed() {
+    @ParameterizedTest
+    @MethodSource("getProvidersTestData")
+    public void testFactoryCreateMethodWithSeed(ProvidersList.Data data) {
+        final RandomSource originalSource = data.getSource();
+        final Object originalSeed = data.getSeed();
+        final Object[] originalArgs = data.getArgs();
+        final UniformRandomProvider generator = originalSource.create(originalSeed, originalArgs);
         @SuppressWarnings("deprecation")
         final UniformRandomProvider rng1 = RandomSource.create(originalSource, originalSeed, originalArgs);
         Assertions.assertEquals(rng1.getClass(), generator.getClass());
@@ -112,8 +99,11 @@ public class ProvidersCommonParametricTest {
      * Test the create method throws an {@link IllegalArgumentException} if passed the wrong
      * arguments.
      */
-    @Test
-    public void testCreateMethodThrowsWithIncorrectArguments() {
+    @ParameterizedTest
+    @MethodSource("getProvidersTestData")
+    public void testCreateMethodThrowsWithIncorrectArguments(ProvidersList.Data data) {
+        final RandomSource originalSource = data.getSource();
+        final Object[] originalArgs = data.getArgs();
         if (originalArgs == null) {
             try {
                 // Try passing arguments to a provider that does not require them
@@ -135,8 +125,12 @@ public class ProvidersCommonParametricTest {
         }
     }
 
-    @Test
-    public void testAllSeedTypes() {
+    @ParameterizedTest
+    @MethodSource("getProvidersTestData")
+    public void testAllSeedTypes(ProvidersList.Data data) {
+        final RandomSource originalSource = data.getSource();
+        final Object originalSeed = data.getSeed();
+        final Object[] originalArgs = data.getArgs();
         final Integer intSeed = -12131415;
         final Long longSeed = -1213141516171819L;
         final int[] intArraySeed = new int[] {0, 11, -22, 33, -44, 55, -66, 77, -88, 99};
@@ -169,8 +163,11 @@ public class ProvidersCommonParametricTest {
         Assertions.assertEquals(5, nonNativeSeedCount);
     }
 
-    @Test
-    public void testNullSeed() {
+    @ParameterizedTest
+    @MethodSource("getProvidersTestData")
+    public void testNullSeed(ProvidersList.Data data) {
+        final RandomSource originalSource = data.getSource();
+        final Object[] originalArgs = data.getArgs();
         // Note: This is the only test that explicitly calls RandomSource.create() with no other arguments.
         final UniformRandomProvider rng = originalArgs == null ?
             originalSource.create() :
@@ -178,8 +175,11 @@ public class ProvidersCommonParametricTest {
         checkNextIntegerInRange(rng, 10, 10000);
     }
 
-    @Test
-    public void testEmptyIntArraySeed() {
+    @ParameterizedTest
+    @MethodSource("getProvidersTestData")
+    public void testEmptyIntArraySeed(ProvidersList.Data data) {
+        final RandomSource originalSource = data.getSource();
+        final Object[] originalArgs = data.getArgs();
         final int[] empty = new int[0];
         Assumptions.assumeTrue(originalSource.isNativeSeed(empty));
 
@@ -188,8 +188,11 @@ public class ProvidersCommonParametricTest {
         checkNextIntegerInRange(rng, 10, 20000);
     }
 
-    @Test
-    public void testEmptyLongArraySeed() {
+    @ParameterizedTest
+    @MethodSource("getProvidersTestData")
+    public void testEmptyLongArraySeed(ProvidersList.Data data) {
+        final RandomSource originalSource = data.getSource();
+        final Object[] originalArgs = data.getArgs();
         final long[] empty = new long[0];
         Assumptions.assumeTrue(originalSource.isNativeSeed(empty));
         // The Middle-Square Weyl Sequence generator cannot self-seed
@@ -200,8 +203,11 @@ public class ProvidersCommonParametricTest {
         checkNextIntegerInRange(rng, 10, 10000);
     }
 
-    @Test
-    public void testZeroIntArraySeed() {
+    @ParameterizedTest
+    @MethodSource("getProvidersTestData")
+    public void testZeroIntArraySeed(ProvidersList.Data data) {
+        final RandomSource originalSource = data.getSource();
+        final Object[] originalArgs = data.getArgs();
         // Exercise capacity to escape all "zero" state.
         final int[] zero = new int[2000]; // Large enough to fill the entire state with zeroes.
         final UniformRandomProvider rng = originalSource.create(zero, originalArgs);
@@ -210,8 +216,11 @@ public class ProvidersCommonParametricTest {
         checkNextIntegerInRange(rng, 10, 10000);
     }
 
-    @Test
-    public void testZeroLongArraySeed() {
+    @ParameterizedTest
+    @MethodSource("getProvidersTestData")
+    public void testZeroLongArraySeed(ProvidersList.Data data) {
+        final RandomSource originalSource = data.getSource();
+        final Object[] originalArgs = data.getArgs();
         // Exercise capacity to escape all "zero" state.
         final long[] zero = new long[2000]; // Large enough to fill the entire state with zeroes.
         final UniformRandomProvider rng = originalSource.create(zero, originalArgs);
@@ -220,15 +229,21 @@ public class ProvidersCommonParametricTest {
         checkNextIntegerInRange(rng, 10, 10000);
     }
 
-    @Test
-    public void testRandomSourceCreateSeed() {
+    @ParameterizedTest
+    @MethodSource("getProvidersTestData")
+    public void testRandomSourceCreateSeed(ProvidersList.Data data) {
+        final RandomSource originalSource = data.getSource();
+        final Object[] originalArgs = data.getArgs();
         final byte[] seed = originalSource.createSeed();
         final UniformRandomProvider rng = originalSource.create(seed, originalArgs);
         checkNextIntegerInRange(rng, 10, 10000);
     }
 
-    @Test
-    public void testRandomSourceCreateSeedFromRNG() {
+    @ParameterizedTest
+    @MethodSource("getProvidersTestData")
+    public void testRandomSourceCreateSeedFromRNG(ProvidersList.Data data) {
+        final RandomSource originalSource = data.getSource();
+        final Object[] originalArgs = data.getArgs();
         final byte[] seed = originalSource.createSeed(new SplitMix64(RandomSource.createLong()));
         final UniformRandomProvider rng = originalSource.create(seed, originalArgs);
         checkNextIntegerInRange(rng, 10, 10000);
@@ -236,8 +251,13 @@ public class ProvidersCommonParametricTest {
 
     // State save and restore tests.
 
-    @Test
-    public void testUnrestorable() {
+    @SuppressWarnings("unused")
+    @ParameterizedTest
+    @MethodSource("getProvidersTestData")
+    public void testUnrestorable(ProvidersList.Data data) {
+        final RandomSource originalSource = data.getSource();
+        final Object originalSeed = data.getSeed();
+        final Object[] originalArgs = data.getArgs();
         // Create two generators of the same type as the one being tested.
         final UniformRandomProvider rng1 = originalSource.create(originalSeed, originalArgs);
         final UniformRandomProvider rng2 = RandomSource.unrestorable(originalSource.create(originalSeed, originalArgs));
@@ -248,18 +268,18 @@ public class ProvidersCommonParametricTest {
         // Cast must work.
         final RestorableUniformRandomProvider restorable = (RestorableUniformRandomProvider) rng1;
         // Cast must fail.
-        try {
-            final RestorableUniformRandomProvider dummy = (RestorableUniformRandomProvider) rng2;
-            Assertions.fail("Cast should have failed");
-        } catch (ClassCastException e) {
-            // Expected.
-        }
+        Assertions.assertThrows(ClassCastException.class, () -> {
+            RestorableUniformRandomProvider dummy = (RestorableUniformRandomProvider) rng2;
+        });
     }
 
-    @Test
-    public void testSerializingState()
+    @ParameterizedTest
+    @MethodSource("getProvidersTestData")
+    public void testSerializingState(ProvidersList.Data data)
         throws IOException,
                ClassNotFoundException {
+        final UniformRandomProvider generator = data.getSource().create(data.getSeed(), data.getArgs());
+
         // Large "n" is not necessary here as we only test the serialization.
         final int n = 100;
 
@@ -274,10 +294,10 @@ public class ProvidersCommonParametricTest {
         oos.writeObject(((RandomProviderDefaultState) stateOrig).getState());
 
         // Store some values.
-        final List<Number> listOrig = makeList(n);
+        final List<Number> listOrig = makeList(n, generator);
 
         // Discard a few more.
-        final List<Number> listDiscard = makeList(n);
+        final List<Number> listDiscard = makeList(n, generator);
         Assertions.assertNotEquals(0, listDiscard.size());
         Assertions.assertNotEquals(listOrig, listDiscard);
 
@@ -292,21 +312,26 @@ public class ProvidersCommonParametricTest {
         restorable.restoreState(stateNew);
 
         // Replay.
-        final List<Number> listReplay = makeList(n);
+        final List<Number> listReplay = makeList(n, generator);
         Assertions.assertNotSame(listOrig, listReplay);
 
         // Check that the serialized data recreated the orginal state.
         Assertions.assertEquals(listOrig, listReplay);
     }
 
-    @Test
-    public void testUnrestorableToString() {
+    @ParameterizedTest
+    @MethodSource("getProvidersTestData")
+    public void testUnrestorableToString(ProvidersList.Data data) {
+        final UniformRandomProvider generator = data.getSource().create(data.getSeed(), data.getArgs());
         Assertions.assertEquals(generator.toString(),
-                            RandomSource.unrestorable(generator).toString());
+                                RandomSource.unrestorable(generator).toString());
     }
 
-    @Test
-    public void testSupportedInterfaces() {
+    @ParameterizedTest
+    @MethodSource("getProvidersTestData")
+    public void testSupportedInterfaces(ProvidersList.Data data) {
+        final RandomSource originalSource = data.getSource();
+        final Object[] originalArgs = data.getArgs();
         final UniformRandomProvider rng = originalSource.create(null, originalArgs);
         Assertions.assertEquals(rng instanceof JumpableUniformRandomProvider,
                                 originalSource.isJumpable(),
@@ -330,10 +355,11 @@ public class ProvidersCommonParametricTest {
      * Populates a list with random numbers.
      *
      * @param n Loop counter.
+     * @param generator Random generator.
      * @return a list containing {@code 11 * n} random numbers.
      */
-    private List<Number> makeList(int n) {
-        final List<Number> list = new ArrayList<Number>();
+    private static List<Number> makeList(int n, UniformRandomProvider generator) {
+        final List<Number> list = new ArrayList<>();
 
         for (int i = 0; i < n; i++) {
             // Append 11 values.
@@ -359,6 +385,7 @@ public class ProvidersCommonParametricTest {
      * @param rng Generator.
      * @param max Upper bound.
      * @param sampleSize Number of random values generated.
+     * @param generator Random generator.
      */
     private void checkNextIntegerInRange(final UniformRandomProvider rng,
                                          final int max,
@@ -370,7 +397,7 @@ public class ProvidersCommonParametricTest {
             }
         };
 
-        checkNextInRange(max, sampleSize, nextMethod);
+        checkNextInRange(max, sampleSize, nextMethod, rng);
     }
 
     /**
@@ -384,10 +411,12 @@ public class ProvidersCommonParametricTest {
      * @param max Upper bound.
      * @param nextMethod method to call.
      * @param sampleSize Number of random values generated.
+     * @param generator Random generator.
      */
-    private <T extends Number> void checkNextInRange(T max,
-                                                     int sampleSize,
-                                                     Callable<T> nextMethod) {
+    private static <T extends Number> void checkNextInRange(T max,
+                                                            int sampleSize,
+                                                            Callable<T> nextMethod,
+                                                            UniformRandomProvider generator) {
         final int numTests = 500;
 
         // Do not change (statistical test assumes that dof = 9).
@@ -461,7 +490,7 @@ public class ProvidersCommonParametricTest {
 
         if (numFailures > 11) { // Test will fail with 0.5% probability
             Assertions.fail(generator + ": Too many failures for n = " + n +
-                        " (" + numFailures + " out of " + numTests + " tests failed)");
+                            " (" + numFailures + " out of " + numTests + " tests failed)");
         }
     }
 
diff --git a/commons-rng-simple/src/test/java/org/apache/commons/rng/simple/ProvidersList.java b/commons-rng-simple/src/test/java/org/apache/commons/rng/simple/ProvidersList.java
index 3fcf119..645ce6c 100644
--- a/commons-rng-simple/src/test/java/org/apache/commons/rng/simple/ProvidersList.java
+++ b/commons-rng-simple/src/test/java/org/apache/commons/rng/simple/ProvidersList.java
@@ -32,11 +32,11 @@ import java.util.Collections;
  */
 public final class ProvidersList {
     /** List of all RNGs implemented in the library. */
-    private static final List<Data[]> LIST = new ArrayList<Data[]>();
+    private static final List<Data> LIST = new ArrayList<>();
     /** List of 32-bits based RNGs. */
-    private static final List<Data[]> LIST32 = new ArrayList<Data[]>();
+    private static final List<Data> LIST32 = new ArrayList<>();
     /** List of 64-bits based RNGs. */
-    private static final List<Data[]> LIST64 = new ArrayList<Data[]>();
+    private static final List<Data> LIST64 = new ArrayList<>();
 
     static {
         try {
@@ -115,14 +115,14 @@ public final class ProvidersList {
      * Helper to statisfy Junit requirement that each parameter set contains
      * the same number of objects.
      */
-    private static void add(List<Data[]> list,
+    private static void add(List<Data> list,
                             RandomSource source,
                             Object... data) {
         final RandomSource rng = source;
         final Object seed = data.length > 0 ? data[0] : null;
         final Object[] args = data.length > 1 ? Arrays.copyOfRange(data, 1, data.length) : null;
 
-        list.add(new Data[] {new Data(rng, seed, args)});
+        list.add(new Data(rng, seed, args));
     }
 
     /**
@@ -131,7 +131,7 @@ public final class ProvidersList {
      *
      * @return the list of all generators.
      */
-    public static Iterable<Data[]> list() {
+    public static Iterable<Data> list() {
         return Collections.unmodifiableList(LIST);
     }
 
@@ -141,7 +141,7 @@ public final class ProvidersList {
      *
      * @return the list of 32-bits based generators.
      */
-    public static Iterable<Data[]> list32() {
+    public static Iterable<Data> list32() {
         return Collections.unmodifiableList(LIST32);
     }
 
@@ -151,7 +151,7 @@ public final class ProvidersList {
      *
      * @return the list of 64-bits based generators.
      */
-    public static Iterable<Data[]> list64() {
+    public static Iterable<Data> list64() {
         return Collections.unmodifiableList(LIST64);
     }
 
@@ -160,10 +160,18 @@ public final class ProvidersList {
      * Better not to mix Junit assumptions of the usage of "Object[]".
      */
     public static class Data {
+        /** RNG specifier. */
         private final RandomSource source;
+        /** Seed (constructor's first parameter). */
         private final Object seed;
+        /** Constructor's additional parameters. */
         private final Object[] args;
 
+        /**
+         * @param source RNG specifier.
+         * @param seed Seed (constructor's first parameter).
+         * @param args Constructor's additional parameters.
+         */
         public Data(RandomSource source,
                     Object seed,
                     Object[] args) {
@@ -172,14 +180,29 @@ public final class ProvidersList {
             this.args = args;
         }
 
+        /**
+         * Gets the RNG specifier.
+         *
+         * @return RNG specifier.
+         */
         public RandomSource getSource() {
             return source;
         }
 
+        /**
+         * Gets the seed (constructor's first parameter).
+         *
+         * @return Seed
+         */
         public Object getSeed() {
             return seed;
         }
 
+        /**
+         * Gets the constructor's additional parameters.
+         *
+         * @return Additional parameters.
+         */
         public Object[] getArgs() {
             return args == null ? null : Arrays.copyOf(args, args.length);
         }
diff --git a/commons-rng-simple/src/test/java/org/apache/commons/rng/simple/internal/NativeSeedTypeParametricTest.java b/commons-rng-simple/src/test/java/org/apache/commons/rng/simple/internal/NativeSeedTypeParametricTest.java
index 8469047..e9bb527 100644
--- a/commons-rng-simple/src/test/java/org/apache/commons/rng/simple/internal/NativeSeedTypeParametricTest.java
+++ b/commons-rng-simple/src/test/java/org/apache/commons/rng/simple/internal/NativeSeedTypeParametricTest.java
@@ -17,20 +17,21 @@
 package org.apache.commons.rng.simple.internal;
 
 import org.junit.jupiter.api.Assertions;
+import org.junit.jupiter.params.ParameterizedTest;
+import org.junit.jupiter.params.provider.EnumSource;
 import org.junit.Test;
-import org.junit.runner.RunWith;
-import org.junit.runners.Parameterized;
-import org.junit.runners.Parameterized.Parameters;
 
 import java.lang.reflect.Array;
+import java.util.Arrays;
+import java.util.Set;
 import java.util.function.Supplier;
+import java.util.stream.Collectors;
 
 /**
  * Tests for the {@link NativeSeedType} seed conversions. This test
  * ensures that a seed can be created or converted from any supported input seed to each
  * supported native seed type.
  */
-@RunWith(value = Parameterized.class)
 public class NativeSeedTypeParametricTest {
     /** This is a list of the class types that are supported native seeds. */
     private static final Object[] SUPPORTED_NATIVE_TYPES = {
@@ -53,59 +54,39 @@ public class NativeSeedTypeParametricTest {
         Double.valueOf(Math.PI),
     };
 
-    /** The native seed type enum instance. */
-    private final NativeSeedType nativeSeedType;
-    /** The class type of the native seed. */
-    private final Class<?> type;
-
     /**
-     * Initializes the test instance.
-     *
-     * @param type The type of the native seed.
+     * Check that there are enum values for all supported types.
+     * This ensures the test is maintained to correspond to the enum.
      */
-    public NativeSeedTypeParametricTest(Class<?> type) {
-        this.type = type;
-        nativeSeedType = findNativeSeedType(type);
-    }
+    @Test
+    public void testNativeSeedTypeEnum() {
+        Set<Class<?>> supported = Arrays.stream(SUPPORTED_NATIVE_TYPES)
+            .map(o -> (Class<?>) o)
+            .collect(Collectors.toSet());
+        Assertions.assertEquals(SUPPORTED_NATIVE_TYPES.length, supported.size(),
+            "Class type of supported seeds should be unique");
 
-    /**
-     * Gets the supported native seed types.
-     *
-     * @return the types
-     */
-    @Parameters
-    public static Object[] getTypes() {
-        // Check that there are enum values for all supported types.
-        // This ensures the test is maintained to correspond to the enum.
-        Assertions.assertEquals(SUPPORTED_NATIVE_TYPES.length, NativeSeedType.values().length,
+        final NativeSeedType[] values = NativeSeedType.values();
+        Assertions.assertEquals(SUPPORTED_NATIVE_TYPES.length, values.length,
             "Incorrect number of enum values for the supported native types");
 
-        return SUPPORTED_NATIVE_TYPES;
-    }
-
-    /**
-     * Creates the native seed type.
-     *
-     * @param type Class of the native seed.
-     * @return the native seed type
-     */
-    private static NativeSeedType findNativeSeedType(Class<?> type) {
-        for (final NativeSeedType nativeSeedType : NativeSeedType.values()) {
-            if (type.equals(nativeSeedType.getType())) {
-                return nativeSeedType;
-            }
-        }
-        throw new AssertionError("No enum matching the type: " + type);
+        // Remove each
+        Arrays.stream(values).map(NativeSeedType::getType).forEach(supported::remove);
+        Assertions.assertEquals(0, supported.size());
     }
 
     /**
      * Test the seed can be created as the correct type.
+     *
+     * @param nativeSeedType Native seed type.
      */
-    @Test
-    public void testCreateSeed() {
+    @ParameterizedTest
+    @EnumSource
+    public void testCreateSeed(NativeSeedType nativeSeedType) {
         final int size = 3;
         final Object seed = nativeSeedType.createSeed(size);
         Assertions.assertNotNull(seed);
+        final Class<?> type = nativeSeedType.getType();
         Assertions.assertEquals(type, seed.getClass(), "Seed was not the correct class");
         if (type.isArray()) {
             Assertions.assertEquals(size, Array.getLength(seed), "Seed was not created the correct length");
@@ -114,9 +95,12 @@ public class NativeSeedTypeParametricTest {
 
     /**
      * Test the seed can be created, converted to a byte[] and then back to the native type.
+     *
+     * @param nativeSeedType Native seed type.
      */
-    @Test
-    public void testConvertSeedToBytes() {
+    @ParameterizedTest
+    @EnumSource
+    public void testConvertSeedToBytes(NativeSeedType nativeSeedType) {
         final int size = 3;
         final Object seed = nativeSeedType.createSeed(size);
         Assertions.assertNotNull(seed, "Null seed");
@@ -125,7 +109,7 @@ public class NativeSeedTypeParametricTest {
         Assertions.assertNotNull(bytes, "Null byte[] seed");
 
         final Object seed2 = nativeSeedType.convertSeed(bytes, size);
-        if (type.isArray()) {
+        if (nativeSeedType.getType().isArray()) {
             // This handles nested primitive arrays
             Assertions.assertArrayEquals(new Object[] {seed}, new Object[] {seed2},
                 "byte[] seed was not converted back");
@@ -136,32 +120,34 @@ public class NativeSeedTypeParametricTest {
 
     /**
      * Test the seed can be converted to the correct type from any of the supported input types.
+     *
+     * @param nativeSeedType The native seed type enum instance.
      */
-    @Test
-    public void testConvertSupportedSeed() {
+    @ParameterizedTest
+    @EnumSource
+    public void testConvertSupportedSeed(NativeSeedType nativeSeedType) {
         // Size can be ignored during conversion and so it not asserted
         final int size = 3;
         for (final Object input : SUPPORTED_SEEDS) {
             final Object seed = nativeSeedType.convertSeed(input, size);
             final Supplier<String> msg = () -> input.getClass() + " input seed was not converted";
             Assertions.assertNotNull(seed, msg);
-            Assertions.assertEquals(type, seed.getClass(), msg);
+            Assertions.assertEquals(nativeSeedType.getType(), seed.getClass(), msg);
         }
     }
 
     /**
      * Test unsupported input seed types are rejected.
+     *
+     * @param nativeSeedType The native seed type enum instance.
      */
-    @Test
-    public void testCannotConvertUnsupportedSeed() {
+    @ParameterizedTest
+    @EnumSource
+    public void testCannotConvertUnsupportedSeed(NativeSeedType nativeSeedType) {
         final int size = 3;
         for (final Object input : UNSUPPORTED_SEEDS) {
-            try {
-                nativeSeedType.convertSeed(input, size);
-                Assertions.fail(input.getClass() + " input seed was not rejected as unsupported");
-            } catch (UnsupportedOperationException ex) {
-                // This is expected
-            }
+            Assertions.assertThrows(UnsupportedOperationException.class,
+                    () -> nativeSeedType.convertSeed(input, size));
         }
     }
 }
diff --git a/commons-rng-simple/src/test/java/org/apache/commons/rng/simple/internal/RandomSourceInternalParametricTest.java b/commons-rng-simple/src/test/java/org/apache/commons/rng/simple/internal/RandomSourceInternalParametricTest.java
index 5948223..2e5ae23 100644
--- a/commons-rng-simple/src/test/java/org/apache/commons/rng/simple/internal/RandomSourceInternalParametricTest.java
+++ b/commons-rng-simple/src/test/java/org/apache/commons/rng/simple/internal/RandomSourceInternalParametricTest.java
@@ -19,10 +19,8 @@ package org.apache.commons.rng.simple.internal;
 import org.apache.commons.rng.core.source64.SplitMix64;
 import org.apache.commons.rng.simple.internal.ProviderBuilder.RandomSourceInternal;
 import org.junit.jupiter.api.Assertions;
-import org.junit.Test;
-import org.junit.runner.RunWith;
-import org.junit.runners.Parameterized;
-import org.junit.runners.Parameterized.Parameters;
+import org.junit.jupiter.params.ParameterizedTest;
+import org.junit.jupiter.params.provider.EnumSource;
 
 import java.util.EnumMap;
 import java.util.function.Supplier;
@@ -32,7 +30,6 @@ import java.util.function.Supplier;
  * ensures that all random sources can create a seed or convert any supported seed to the
  * correct type for the constructor.
  */
-@RunWith(value = Parameterized.class)
 public class RandomSourceInternalParametricTest {
     /** The supported seeds for conversion to a native seed type. */
     private static final Object[] SUPPORTED_SEEDS = {
@@ -49,11 +46,11 @@ public class RandomSourceInternalParametricTest {
     };
     /** The expected byte size of the seed for each RandomSource. */
     private static final EnumMap<RandomSourceInternal, Integer> EXPECTED_SEED_BYTES =
-            new EnumMap<RandomSourceInternal, Integer>(RandomSourceInternal.class);
+            new EnumMap<>(RandomSourceInternal.class);
 
     static {
-        final int intBytes = 4;
-        final int longBytes = 8;
+        final int intBytes = Integer.BYTES;
+        final int longBytes = Long.BYTES;
         EXPECTED_SEED_BYTES.put(RandomSourceInternal.JDK, longBytes * 1);
         EXPECTED_SEED_BYTES.put(RandomSourceInternal.WELL_512_A, intBytes * 16);
         EXPECTED_SEED_BYTES.put(RandomSourceInternal.WELL_1024_A, intBytes * 32);
@@ -105,37 +102,25 @@ public class RandomSourceInternalParametricTest {
         // Verify the seed byte size is reflected in the enum javadoc for RandomSource.
     }
 
-    /** Internal identifier for the random source. */
-    private final RandomSourceInternal randomSourceInternal;
-    /** The class type of the native seed. */
-    private final Class<?> type;
-
     /**
-     * Initializes the test instance.
+     * Get the class type of the native seed for the random source.
      *
      * @param randomSourceInternal Internal identifier for the random source.
      */
-    public RandomSourceInternalParametricTest(RandomSourceInternal randomSourceInternal) {
-        this.randomSourceInternal = randomSourceInternal;
+    private static Class<?> getType(RandomSourceInternal randomSourceInternal) {
         // The first constructor argument is always the seed type
-        this.type = randomSourceInternal.getArgs()[0];
-    }
-
-    /**
-     * Gets the supported native seed types.
-     *
-     * @return the types
-     */
-    @Parameters
-    public static Object[] getTypes() {
-        return RandomSourceInternal.values();
+        return randomSourceInternal.getArgs()[0];
     }
 
     /**
      * Test the seed can be created as the correct type.
+     *
+     * @param randomSourceInternal Internal identifier for the random source.
      */
-    @Test
-    public void testCreateSeed() {
+    @ParameterizedTest
+    @EnumSource
+    public void testCreateSeed(RandomSourceInternal randomSourceInternal) {
+        final Class<?> type = getType(randomSourceInternal);
         final Object seed = randomSourceInternal.createSeed();
         Assertions.assertNotNull(seed);
         Assertions.assertEquals(type, seed.getClass(), "Seed was not the correct class");
@@ -144,9 +129,13 @@ public class RandomSourceInternalParametricTest {
 
     /**
      * Test the seed can be converted to the correct type from any of the supported input types.
+     *
+     * @param randomSourceInternal Internal identifier for the random source.
      */
-    @Test
-    public void testConvertSupportedSeed() {
+    @ParameterizedTest
+    @EnumSource
+    public void testConvertSupportedSeed(RandomSourceInternal randomSourceInternal) {
+        final Class<?> type = getType(randomSourceInternal);
         for (final Object input : SUPPORTED_SEEDS) {
             final Object seed = randomSourceInternal.convertSeed(input);
             final Supplier<String> msg = () -> input.getClass() + " input seed was not converted";
@@ -158,9 +147,12 @@ public class RandomSourceInternalParametricTest {
 
     /**
      * Test unsupported input seed types are rejected.
+     *
+     * @param randomSourceInternal Internal identifier for the random source.
      */
-    @Test
-    public void testCannotConvertUnsupportedSeed() {
+    @ParameterizedTest
+    @EnumSource
+    public void testCannotConvertUnsupportedSeed(RandomSourceInternal randomSourceInternal) {
         for (final Object input : UNSUPPORTED_SEEDS) {
             try {
                 randomSourceInternal.convertSeed(input);
@@ -174,9 +166,12 @@ public class RandomSourceInternalParametricTest {
     /**
      * Test the seed byte size is reported as the size of a int/long primitive for Int/Long
      * seed types and a multiple of it for int[]/long[] types.
+     *
+     * @param randomSourceInternal Internal identifier for the random source.
      */
-    @Test
-    public void testCreateSeedBytesSizeIsPositiveAndMultipleOf4Or8() {
+    @ParameterizedTest
+    @EnumSource
+    public void testCreateSeedBytesSizeIsPositiveAndMultipleOf4Or8(RandomSourceInternal randomSourceInternal) {
         // This should be the full length seed
         final byte[] seed = randomSourceInternal.createSeedBytes(new SplitMix64(12345L));
 
@@ -203,9 +198,12 @@ public class RandomSourceInternalParametricTest {
      * for new generators. This test forms an additional cross-reference check that the
      * seed size in RandomSourceInternal has been correctly set and the size should map to
      * the array size in the RandomSource javadoc (if applicable).
+     *
+     * @param randomSourceInternal Internal identifier for the random source.
      */
-    @Test
-    public void testCreateSeedBytes() {
+    @ParameterizedTest
+    @EnumSource
+    public void testCreateSeedBytes(RandomSourceInternal randomSourceInternal) {
         // This should be the full length seed
         final byte[] seed = randomSourceInternal.createSeedBytes(new SplitMix64(12345L));
         final int size = seed.length;

[commons-rng] 12/13: Use diamond operator

Posted by ah...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

aherbert pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/commons-rng.git

commit f20d09c8e6a4d6349a688de4427cb70d1ce89ce4
Author: Alex Herbert <ah...@apache.org>
AuthorDate: Tue Aug 17 00:06:40 2021 +0100

    Use diamond operator
---
 .../commons/rng/core/ProvidersCommonParametricTest.java    | 14 +++++++-------
 .../apache/commons/rng/sampling/CollectionSamplerTest.java | 10 +++++-----
 .../sampling/DiscreteProbabilityCollectionSamplerTest.java |  2 +-
 .../distribution/DiscreteSamplerParametricTest.java        |  2 +-
 .../commons/rng/simple/ProvidersCommonParametricTest.java  |  2 +-
 .../commons/rng/simple/internal/NoOpConverterTest.java     |  4 ++--
 .../rng/simple/internal/SeedConverterComposerTest.java     |  2 +-
 .../commons/rng/simple/internal/SeedFactoryTest.java       |  6 +++---
 8 files changed, 21 insertions(+), 21 deletions(-)

diff --git a/commons-rng-core/src/test/java/org/apache/commons/rng/core/ProvidersCommonParametricTest.java b/commons-rng-core/src/test/java/org/apache/commons/rng/core/ProvidersCommonParametricTest.java
index f390d10..692baa5 100644
--- a/commons-rng-core/src/test/java/org/apache/commons/rng/core/ProvidersCommonParametricTest.java
+++ b/commons-rng-core/src/test/java/org/apache/commons/rng/core/ProvidersCommonParametricTest.java
@@ -154,7 +154,7 @@ class ProvidersCommonParametricTest {
     @ParameterizedTest
     @MethodSource("getList")
     void testUniformNextIntRandomWalk(UniformRandomProvider generator) {
-        final Callable<Boolean> nextMethod = new Callable<Boolean>() {
+        final Callable<Boolean> nextMethod = new Callable<>() {
             @Override
             public Boolean call() throws Exception {
                 return generator.nextInt() >= 0;
@@ -167,7 +167,7 @@ class ProvidersCommonParametricTest {
     @ParameterizedTest
     @MethodSource("getList")
     void testUniformNextLongRandomWalk(UniformRandomProvider generator) {
-        final Callable<Boolean> nextMethod = new Callable<Boolean>() {
+        final Callable<Boolean> nextMethod = new Callable<>() {
             @Override
             public Boolean call() throws Exception {
                 return generator.nextLong() >= 0;
@@ -180,7 +180,7 @@ class ProvidersCommonParametricTest {
     @ParameterizedTest
     @MethodSource("getList")
     void testUniformNextBooleanRandomWalk(UniformRandomProvider generator) {
-        final Callable<Boolean> nextMethod = new Callable<Boolean>() {
+        final Callable<Boolean> nextMethod = new Callable<>() {
             @Override
             public Boolean call() throws Exception {
                 return generator.nextBoolean();
@@ -367,7 +367,7 @@ class ProvidersCommonParametricTest {
     private void checkNextIntegerInRange(final UniformRandomProvider generator,
                                          final int max,
                                          int sampleSize) {
-        final Callable<Integer> nextMethod = new Callable<Integer>() {
+        final Callable<Integer> nextMethod = new Callable<>() {
             @Override
             public Integer call() throws Exception {
                 return generator.nextInt(max);
@@ -387,7 +387,7 @@ class ProvidersCommonParametricTest {
     private void checkNextLongInRange(final UniformRandomProvider generator,
                                       long max,
                                       int sampleSize) {
-        final Callable<Long> nextMethod = new Callable<Long>() {
+        final Callable<Long> nextMethod = new Callable<>() {
             @Override
             public Long call() throws Exception {
                 return generator.nextLong(max);
@@ -406,7 +406,7 @@ class ProvidersCommonParametricTest {
     private void checkNextFloat(final UniformRandomProvider generator,
                                 int sampleSize) {
         final int max = 1234;
-        final Callable<Integer> nextMethod = new Callable<Integer>() {
+        final Callable<Integer> nextMethod = new Callable<>() {
             @Override
             public Integer call() throws Exception {
                 return (int) (max * generator.nextFloat());
@@ -425,7 +425,7 @@ class ProvidersCommonParametricTest {
     private void checkNextDouble(final UniformRandomProvider generator,
                                  int sampleSize) {
         final int max = 578;
-        final Callable<Integer> nextMethod = new Callable<Integer>() {
+        final Callable<Integer> nextMethod = new Callable<>() {
             @Override
             public Integer call() throws Exception {
                 return (int) (max * generator.nextDouble());
diff --git a/commons-rng-sampling/src/test/java/org/apache/commons/rng/sampling/CollectionSamplerTest.java b/commons-rng-sampling/src/test/java/org/apache/commons/rng/sampling/CollectionSamplerTest.java
index 03c0e76..1a00b2d 100644
--- a/commons-rng-sampling/src/test/java/org/apache/commons/rng/sampling/CollectionSamplerTest.java
+++ b/commons-rng-sampling/src/test/java/org/apache/commons/rng/sampling/CollectionSamplerTest.java
@@ -32,13 +32,13 @@ class CollectionSamplerTest {
 
     @Test
     void testSampleTrivial() {
-        final ArrayList<String> list = new ArrayList<String>();
+        final ArrayList<String> list = new ArrayList<>();
         list.add("Apache");
         list.add("Commons");
         list.add("RNG");
 
         final CollectionSampler<String> sampler =
-            new CollectionSampler<String>(RandomSource.MWC_256.create(),
+            new CollectionSampler<>(RandomSource.MWC_256.create(),
                                           list);
         final String word = sampler.sample();
         for (String w : list) {
@@ -53,8 +53,8 @@ class CollectionSamplerTest {
     void testSamplePrecondition() {
         // Must fail for empty collection.
         Assertions.assertThrows(IllegalArgumentException.class,
-            () -> new CollectionSampler<String>(RandomSource.SPLIT_MIX_64.create(0L),
-                                                new ArrayList<String>()));
+            () -> new CollectionSampler<>(RandomSource.SPLIT_MIX_64.create(0L),
+                                                new ArrayList<>()));
     }
 
     /**
@@ -66,7 +66,7 @@ class CollectionSamplerTest {
         final UniformRandomProvider rng2 = RandomSource.SPLIT_MIX_64.create(0L);
         final List<String> list = Arrays.asList("Apache", "Commons", "RNG");
         final CollectionSampler<String> sampler1 =
-            new CollectionSampler<String>(rng1, list);
+            new CollectionSampler<>(rng1, list);
         final CollectionSampler<String> sampler2 = sampler1.withUniformRandomProvider(rng2);
         RandomAssert.assertProduceSameSequence(sampler1, sampler2);
     }
diff --git a/commons-rng-sampling/src/test/java/org/apache/commons/rng/sampling/DiscreteProbabilityCollectionSamplerTest.java b/commons-rng-sampling/src/test/java/org/apache/commons/rng/sampling/DiscreteProbabilityCollectionSamplerTest.java
index a45aeb2..d584f07 100644
--- a/commons-rng-sampling/src/test/java/org/apache/commons/rng/sampling/DiscreteProbabilityCollectionSamplerTest.java
+++ b/commons-rng-sampling/src/test/java/org/apache/commons/rng/sampling/DiscreteProbabilityCollectionSamplerTest.java
@@ -86,7 +86,7 @@ class DiscreteProbabilityCollectionSamplerTest {
         // Empty Map<T, Double> not allowed
         Assertions.assertThrows(IllegalArgumentException.class,
             () -> new DiscreteProbabilityCollectionSampler<>(rng,
-                 new HashMap<Double, Double>()));
+                 new HashMap<>()));
     }
 
     @Test
diff --git a/commons-rng-sampling/src/test/java/org/apache/commons/rng/sampling/distribution/DiscreteSamplerParametricTest.java b/commons-rng-sampling/src/test/java/org/apache/commons/rng/sampling/distribution/DiscreteSamplerParametricTest.java
index 9c5079d..731d3f0 100644
--- a/commons-rng-sampling/src/test/java/org/apache/commons/rng/sampling/distribution/DiscreteSamplerParametricTest.java
+++ b/commons-rng-sampling/src/test/java/org/apache/commons/rng/sampling/distribution/DiscreteSamplerParametricTest.java
@@ -70,7 +70,7 @@ class DiscreteSamplerParametricTest {
         final long[] observed = new long[numBins];
 
         // For storing chi2 larger than the critical value.
-        final List<Double> failedStat = new ArrayList<Double>();
+        final List<Double> failedStat = new ArrayList<>();
         try {
             for (int i = 0; i < numTests; i++) {
                 Arrays.fill(observed, 0);
diff --git a/commons-rng-simple/src/test/java/org/apache/commons/rng/simple/ProvidersCommonParametricTest.java b/commons-rng-simple/src/test/java/org/apache/commons/rng/simple/ProvidersCommonParametricTest.java
index c4d95cc..f0458c3 100644
--- a/commons-rng-simple/src/test/java/org/apache/commons/rng/simple/ProvidersCommonParametricTest.java
+++ b/commons-rng-simple/src/test/java/org/apache/commons/rng/simple/ProvidersCommonParametricTest.java
@@ -384,7 +384,7 @@ class ProvidersCommonParametricTest {
     private void checkNextIntegerInRange(final UniformRandomProvider rng,
                                          final int max,
                                          int sampleSize) {
-        final Callable<Integer> nextMethod = new Callable<Integer>() {
+        final Callable<Integer> nextMethod = new Callable<>() {
             @Override
             public Integer call() throws Exception {
                 return rng.nextInt(max);
diff --git a/commons-rng-simple/src/test/java/org/apache/commons/rng/simple/internal/NoOpConverterTest.java b/commons-rng-simple/src/test/java/org/apache/commons/rng/simple/internal/NoOpConverterTest.java
index 523059c..b56a85c 100644
--- a/commons-rng-simple/src/test/java/org/apache/commons/rng/simple/internal/NoOpConverterTest.java
+++ b/commons-rng-simple/src/test/java/org/apache/commons/rng/simple/internal/NoOpConverterTest.java
@@ -25,14 +25,14 @@ import org.junit.jupiter.api.Test;
 class NoOpConverterTest {
     @Test
     void testNoOpIntegerCoversion() {
-        final NoOpConverter<Integer> converter = new NoOpConverter<Integer>();
+        final NoOpConverter<Integer> converter = new NoOpConverter<>();
         final Integer in = 123;
         Assertions.assertSame(in, converter.convert(in));
     }
 
     @Test
     void testNoOpLongArrayCoversion() {
-        final NoOpConverter<long[]> converter = new NoOpConverter<long[]>();
+        final NoOpConverter<long[]> converter = new NoOpConverter<>();
         final long[] in = {123L, 456L, Long.MAX_VALUE};
         Assertions.assertSame(in, converter.convert(in));
     }
diff --git a/commons-rng-simple/src/test/java/org/apache/commons/rng/simple/internal/SeedConverterComposerTest.java b/commons-rng-simple/src/test/java/org/apache/commons/rng/simple/internal/SeedConverterComposerTest.java
index 5f91543..8d504e4 100644
--- a/commons-rng-simple/src/test/java/org/apache/commons/rng/simple/internal/SeedConverterComposerTest.java
+++ b/commons-rng-simple/src/test/java/org/apache/commons/rng/simple/internal/SeedConverterComposerTest.java
@@ -28,7 +28,7 @@ class SeedConverterComposerTest {
         final Int2Long int2Long = new Int2Long();
         final Long2LongArray long2LongArray = new Long2LongArray(3);
         final SeedConverterComposer<Integer, Long, long[]> composer =
-                new SeedConverterComposer<Integer, Long, long[]>(int2Long, long2LongArray);
+                new SeedConverterComposer<>(int2Long, long2LongArray);
         final Integer in = 123;
         final Object out = composer.convert(in);
         Assertions.assertTrue(out instanceof long[], "Bad type conversion");
diff --git a/commons-rng-simple/src/test/java/org/apache/commons/rng/simple/internal/SeedFactoryTest.java b/commons-rng-simple/src/test/java/org/apache/commons/rng/simple/internal/SeedFactoryTest.java
index 6c51b71..0252667 100644
--- a/commons-rng-simple/src/test/java/org/apache/commons/rng/simple/internal/SeedFactoryTest.java
+++ b/commons-rng-simple/src/test/java/org/apache/commons/rng/simple/internal/SeedFactoryTest.java
@@ -31,7 +31,7 @@ import org.apache.commons.rng.core.util.NumberFactory;
 class SeedFactoryTest {
     @Test
     void testCreateLong() {
-        final Map<Long, Integer> values = new HashMap<Long, Integer>();
+        final Map<Long, Integer> values = new HashMap<>();
 
         final int n = 100000;
         for (int i = 0; i < n; i++) {
@@ -50,7 +50,7 @@ class SeedFactoryTest {
 
     @Test
     void testCreateLongArray() {
-        final Map<Long, Integer> values = new HashMap<Long, Integer>();
+        final Map<Long, Integer> values = new HashMap<>();
 
         final int n = 100000;
         final long[] array = SeedFactory.createLongArray(n);
@@ -70,7 +70,7 @@ class SeedFactoryTest {
 
     @Test
     void testCreateIntArray() {
-        final Map<Long, Integer> values = new HashMap<Long, Integer>();
+        final Map<Long, Integer> values = new HashMap<>();
 
         for (int i = 0; i < 50000; i++) {
             final int[] a = SeedFactory.createIntArray(2);

[commons-rng] 08/13: RNG-163: Replace try-catch with assertThrows

Posted by ah...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

aherbert pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/commons-rng.git

commit 551ecefb3d427487aa3b15a784b67c354ab37713
Author: Alex Herbert <ah...@apache.org>
AuthorDate: Sun Aug 15 22:37:01 2021 +0100

    RNG-163: Replace try-catch with assertThrows
---
 .../commons/rng/core/source64/TwoCmresTest.java    | 38 ++++++----------
 .../commons/rng/core/util/NumberFactoryTest.java   | 52 ++++++++++------------
 .../rng/sampling/CompositeSamplersTest.java        |  9 ++--
 .../distribution/ContinuousUniformSamplerTest.java | 18 +++-----
 .../GuideTableDiscreteSamplerTest.java             |  2 +-
 .../commons/rng/sampling/shape/BoxSamplerTest.java | 20 ++++-----
 .../rng/sampling/shape/CoordinatesTest.java        | 31 ++++++-------
 .../rng/sampling/shape/LineSamplerTest.java        | 22 ++++-----
 .../rng/sampling/shape/TetrahedronSamplerTest.java | 21 ++++-----
 .../rng/sampling/shape/TriangleSamplerTest.java    | 22 ++++-----
 .../rng/simple/ProvidersCommonParametricTest.java  | 26 +++++------
 .../RandomSourceInternalParametricTest.java        |  9 ++--
 12 files changed, 108 insertions(+), 162 deletions(-)

diff --git a/commons-rng-core/src/test/java/org/apache/commons/rng/core/source64/TwoCmresTest.java b/commons-rng-core/src/test/java/org/apache/commons/rng/core/source64/TwoCmresTest.java
index f368f42..0d7f72c 100644
--- a/commons-rng-core/src/test/java/org/apache/commons/rng/core/source64/TwoCmresTest.java
+++ b/commons-rng-core/src/test/java/org/apache/commons/rng/core/source64/TwoCmresTest.java
@@ -68,12 +68,9 @@ public class TwoCmresTest {
     public void testSubcycleGeneratorsMustBeDifferent() {
         final int max = TwoCmres.numberOfSubcycleGenerators();
         for (int i = 0; i < max; i++) {
-            try {
-                new TwoCmres(-97845, i, i);
-                Assertions.fail("Exception expected");
-            } catch (IllegalArgumentException e) {
-                // Expected.
-            }
+            final int subCycle = i;
+            Assertions.assertThrows(IllegalArgumentException.class,
+                () -> new TwoCmres(-97845, subCycle, subCycle));
         }
     }
 
@@ -94,25 +91,18 @@ public class TwoCmresTest {
         }
 
         for (int wrongIndex : new int[] {-1, max}) {
-            try {
-                new TwoCmres(seed, wrongIndex, 1);
-                Assertions.fail("Exception expected for index=" + wrongIndex);
-            } catch (IndexOutOfBoundsException e) {
-                // Expected.
-            }
-
-            try {
-                new TwoCmres(seed, 1, wrongIndex);
-                Assertions.fail("Exception expected for index=" + wrongIndex);
-            } catch (IndexOutOfBoundsException e) {
-                // Expected.
-            }
+            Assertions.assertThrows(IndexOutOfBoundsException.class,
+                () -> new TwoCmres(seed, wrongIndex, 1),
+                () -> "Exception expected for index i = " + wrongIndex);
+            Assertions.assertThrows(IndexOutOfBoundsException.class,
+                () -> new TwoCmres(seed, 1, wrongIndex),
+                () -> "Exception expected for index j = " + wrongIndex);
         }
     }
 
     @Test
     public void testCmresFactoryThrowsWithDuplicateMultiplier() {
-        ArrayList<Cmres> list = new ArrayList<Cmres>();
+        final ArrayList<Cmres> list = new ArrayList<>();
         final long multiply = 0;
         final int rotate = 3;
         final int start = 5;
@@ -120,11 +110,9 @@ public class TwoCmresTest {
         list.add(new Cmres(multiply, rotate, start));
 
         long nextMultiply = multiply + 1;
-        try {
-            Cmres.Factory.checkUnique(list, nextMultiply);
-        } catch (IllegalStateException ex) {
-            Assertions.fail("The next multiply should be unique: " + nextMultiply);
-        }
+        Assertions.assertDoesNotThrow(
+            () -> Cmres.Factory.checkUnique(list, nextMultiply),
+            () -> "The next multiply should be unique: " + nextMultiply);
 
         list.add(new Cmres(nextMultiply, rotate, start));
         // This should throw as the list now contains the multiply value
diff --git a/commons-rng-core/src/test/java/org/apache/commons/rng/core/util/NumberFactoryTest.java b/commons-rng-core/src/test/java/org/apache/commons/rng/core/util/NumberFactoryTest.java
index b3312d2..e145b71 100644
--- a/commons-rng-core/src/test/java/org/apache/commons/rng/core/util/NumberFactoryTest.java
+++ b/commons-rng-core/src/test/java/org/apache/commons/rng/core/util/NumberFactoryTest.java
@@ -168,13 +168,12 @@ public class NumberFactoryTest {
     @Test
     public void testMakeIntPrecondition1() {
         for (int i = 0; i <= 10; i++) {
-            try {
-                NumberFactory.makeInt(new byte[i]);
-                if (i != INT_SIZE) {
-                    Assertions.fail("Exception expected");
-                }
-            } catch (IllegalArgumentException e) {
-                // Expected.
+            final byte[] bytes = new byte[i];
+            if (i != INT_SIZE) {
+                Assertions.assertThrows(IllegalArgumentException.class,
+                    () -> NumberFactory.makeInt(bytes));
+            } else {
+                Assertions.assertEquals(0, NumberFactory.makeInt(bytes));
             }
         }
     }
@@ -182,13 +181,12 @@ public class NumberFactoryTest {
     @Test
     public void testMakeIntArrayPrecondition1() {
         for (int i = 0; i <= 20; i++) {
-            try {
-                NumberFactory.makeIntArray(new byte[i]);
-                if (i != 0 && i % INT_SIZE != 0) {
-                    Assertions.fail("Exception expected");
-                }
-            } catch (IllegalArgumentException e) {
-                // Expected.
+            final byte[] bytes = new byte[i];
+            if (i != 0 && i % INT_SIZE != 0) {
+                Assertions.assertThrows(IllegalArgumentException.class,
+                    () -> NumberFactory.makeIntArray(bytes));
+            } else {
+                Assertions.assertArrayEquals(new int[i / INT_SIZE], NumberFactory.makeIntArray(bytes));
             }
         }
     }
@@ -196,13 +194,12 @@ public class NumberFactoryTest {
     @Test
     public void testMakeLongPrecondition1() {
         for (int i = 0; i <= 10; i++) {
-            try {
-                NumberFactory.makeLong(new byte[i]);
-                if (i != LONG_SIZE) {
-                    Assertions.fail("Exception expected");
-                }
-            } catch (IllegalArgumentException e) {
-                // Expected.
+            final byte[] bytes = new byte[i];
+            if (i != LONG_SIZE) {
+                Assertions.assertThrows(IllegalArgumentException.class,
+                    () -> NumberFactory.makeLong(bytes));
+            } else {
+                Assertions.assertEquals(0L, NumberFactory.makeLong(bytes));
             }
         }
     }
@@ -210,13 +207,12 @@ public class NumberFactoryTest {
     @Test
     public void testMakeLongArrayPrecondition1() {
         for (int i = 0; i <= 20; i++) {
-            try {
-                NumberFactory.makeLongArray(new byte[i]);
-                if (i != 0 && i % LONG_SIZE != 0) {
-                    Assertions.fail("Exception expected");
-                }
-            } catch (IllegalArgumentException e) {
-                // Expected.
+            final byte[] bytes = new byte[i];
+            if (i != 0 && i % LONG_SIZE != 0) {
+                Assertions.assertThrows(IllegalArgumentException.class,
+                    () -> NumberFactory.makeLongArray(bytes));
+            } else {
+                Assertions.assertArrayEquals(new long[i / LONG_SIZE], NumberFactory.makeLongArray(bytes));
             }
         }
     }
diff --git a/commons-rng-sampling/src/test/java/org/apache/commons/rng/sampling/CompositeSamplersTest.java b/commons-rng-sampling/src/test/java/org/apache/commons/rng/sampling/CompositeSamplersTest.java
index 441242c..dde1d1f 100644
--- a/commons-rng-sampling/src/test/java/org/apache/commons/rng/sampling/CompositeSamplersTest.java
+++ b/commons-rng-sampling/src/test/java/org/apache/commons/rng/sampling/CompositeSamplersTest.java
@@ -100,12 +100,9 @@ public class CompositeSamplersTest {
 
         final double[] bad = {-1, Double.NaN, Double.POSITIVE_INFINITY};
         for (final double weight : bad) {
-            try {
-                builder.add(sampler, weight);
-                Assertions.fail("Did not detect invalid weight: " + weight);
-            } catch (final IllegalArgumentException ex) {
-                // Expected
-            }
+            Assertions.assertThrows(IllegalArgumentException.class,
+                () -> builder.add(sampler, weight),
+                () -> "Did not detect invalid weight: " + weight);
         }
     }
 
diff --git a/commons-rng-sampling/src/test/java/org/apache/commons/rng/sampling/distribution/ContinuousUniformSamplerTest.java b/commons-rng-sampling/src/test/java/org/apache/commons/rng/sampling/distribution/ContinuousUniformSamplerTest.java
index e25b8db..a900fb7 100644
--- a/commons-rng-sampling/src/test/java/org/apache/commons/rng/sampling/distribution/ContinuousUniformSamplerTest.java
+++ b/commons-rng-sampling/src/test/java/org/apache/commons/rng/sampling/distribution/ContinuousUniformSamplerTest.java
@@ -112,18 +112,12 @@ public class ContinuousUniformSamplerTest {
         }) {
             final double low = interval[0];
             final double high = interval[1];
-            try {
-                ContinuousUniformSampler.of(rng, low, high, true);
-                Assertions.fail("(" + low + "," + high + ")");
-            } catch (IllegalArgumentException ex) {
-                // Expected
-            }
-            try {
-                ContinuousUniformSampler.of(rng, high, low, true);
-                Assertions.fail("(" + high + "," + low + ")");
-            } catch (IllegalArgumentException ex) {
-                // Expected
-            }
+            Assertions.assertThrows(IllegalArgumentException.class,
+                () -> ContinuousUniformSampler.of(rng, low, high, true),
+                () -> "(" + low + "," + high + ")");
+            Assertions.assertThrows(IllegalArgumentException.class,
+                () -> ContinuousUniformSampler.of(rng, high, low, true),
+                () -> "(" + high + "," + low + ")");
         }
 
         // Valid. This will overflow if the raw long bits are extracted and
diff --git a/commons-rng-sampling/src/test/java/org/apache/commons/rng/sampling/distribution/GuideTableDiscreteSamplerTest.java b/commons-rng-sampling/src/test/java/org/apache/commons/rng/sampling/distribution/GuideTableDiscreteSamplerTest.java
index 6f30c11..4864e53 100644
--- a/commons-rng-sampling/src/test/java/org/apache/commons/rng/sampling/distribution/GuideTableDiscreteSamplerTest.java
+++ b/commons-rng-sampling/src/test/java/org/apache/commons/rng/sampling/distribution/GuideTableDiscreteSamplerTest.java
@@ -75,7 +75,7 @@ public class GuideTableDiscreteSamplerTest {
     }
 
     /**
-     * Assert the factory constructor throws and {@link IllegalArgumentException}.
+     * Assert the factory constructor throws an {@link IllegalArgumentException}.
      *
      * @param probabilities the probabilities
      * @param alpha the alpha
diff --git a/commons-rng-sampling/src/test/java/org/apache/commons/rng/sampling/shape/BoxSamplerTest.java b/commons-rng-sampling/src/test/java/org/apache/commons/rng/sampling/shape/BoxSamplerTest.java
index a7ca761..623b002 100644
--- a/commons-rng-sampling/src/test/java/org/apache/commons/rng/sampling/shape/BoxSamplerTest.java
+++ b/commons-rng-sampling/src/test/java/org/apache/commons/rng/sampling/shape/BoxSamplerTest.java
@@ -54,13 +54,10 @@ public class BoxSamplerTest {
             {c2, c3},
             {c3, c2},
         }) {
-            try {
-                BoxSampler.of(rng, c[0], c[1]);
-                Assertions.fail(String.format("Did not detect dimension mismatch: %d,%d",
+            Assertions.assertThrows(IllegalArgumentException.class,
+                () -> BoxSampler.of(rng, c[0], c[1]),
+                () -> String.format("Did not detect dimension mismatch: %d,%d",
                     c[0].length, c[1].length));
-            } catch (IllegalArgumentException ex) {
-                // Expected
-            }
         }
     }
 
@@ -77,16 +74,15 @@ public class BoxSamplerTest {
         Assertions.assertNotNull(BoxSampler.of(rng, c[0],  c[1]));
         final double[] bad = {Double.POSITIVE_INFINITY, Double.NEGATIVE_INFINITY, Double.NaN};
         for (int i = 0; i < c.length; i++) {
+            final int ii = i;
             for (int j = 0; j < c[0].length; j++) {
+                final int jj = j;
                 for (final double d : bad) {
                     final double value = c[i][j];
                     c[i][j] = d;
-                    try {
-                        BoxSampler.of(rng, c[0], c[1]);
-                        Assertions.fail(String.format("Did not detect non-finite coordinate: %d,%d = %s", i, j, d));
-                    } catch (IllegalArgumentException ex) {
-                        // Expected
-                    }
+                    Assertions.assertThrows(IllegalArgumentException.class,
+                        () -> BoxSampler.of(rng, c[0], c[1]),
+                        () -> String.format("Did not detect non-finite coordinate: %d,%d = %s", ii, jj, d));
                     c[i][j] = value;
                 }
             }
diff --git a/commons-rng-sampling/src/test/java/org/apache/commons/rng/sampling/shape/CoordinatesTest.java b/commons-rng-sampling/src/test/java/org/apache/commons/rng/sampling/shape/CoordinatesTest.java
index bde6f0f..2e08d19 100644
--- a/commons-rng-sampling/src/test/java/org/apache/commons/rng/sampling/shape/CoordinatesTest.java
+++ b/commons-rng-sampling/src/test/java/org/apache/commons/rng/sampling/shape/CoordinatesTest.java
@@ -33,15 +33,14 @@ public class CoordinatesTest {
         Assertions.assertSame(c, Coordinates.requireFinite(c, message));
         final double[] bad = {Double.POSITIVE_INFINITY, Double.NEGATIVE_INFINITY, Double.NaN};
         for (int i = 0; i < c.length; i++) {
+            final int ii = i;
             for (final double d : bad) {
                 final double value = c[i];
                 c[i] = d;
-                try {
-                    Coordinates.requireFinite(c, message);
-                    Assertions.fail(String.format("Did not detect non-finite coordinate: %d = %s", i, d));
-                } catch (IllegalArgumentException ex) {
-                    Assertions.assertTrue(ex.getMessage().startsWith(message), "Missing message prefix");
-                }
+                final IllegalArgumentException ex = Assertions.assertThrows(IllegalArgumentException.class,
+                    () -> Coordinates.requireFinite(c, message),
+                    () -> String.format("Did not detect non-finite coordinate: %d = %s", ii, d));
+                Assertions.assertTrue(ex.getMessage().startsWith(message), "Missing message prefix");
                 c[i] = value;
             }
         }
@@ -56,18 +55,14 @@ public class CoordinatesTest {
         for (final double[] c : new double[][] {{0, 1}, {0, 1, 2}}) {
             final int length = c.length;
             Assertions.assertSame(c, Coordinates.requireLength(c, length, message));
-            try {
-                Coordinates.requireLength(c, length - 1, message);
-                Assertions.fail("Did not detect length was too long: " + (length - 1));
-            } catch (IllegalArgumentException ex) {
-                Assertions.assertTrue(ex.getMessage().startsWith(message), "Missing message prefix");
-            }
-            try {
-                Coordinates.requireLength(c, length + 1, message);
-                Assertions.fail("Did not detect length was too short: " + (length + 1));
-            } catch (IllegalArgumentException ex) {
-                Assertions.assertTrue(ex.getMessage().startsWith(message), "Missing message prefix");
-            }
+            IllegalArgumentException ex = Assertions.assertThrows(IllegalArgumentException.class,
+                () -> Coordinates.requireLength(c, length - 1, message),
+                () -> "Did not detect length was too long: " + (length - 1));
+            Assertions.assertTrue(ex.getMessage().startsWith(message), "Missing message prefix");
+            ex = Assertions.assertThrows(IllegalArgumentException.class,
+                () -> Coordinates.requireLength(c, length + 1, message),
+                () -> "Did not detect length was too short: " + (length + 1));
+            Assertions.assertTrue(ex.getMessage().startsWith(message), "Missing message prefix");
         }
     }
 }
diff --git a/commons-rng-sampling/src/test/java/org/apache/commons/rng/sampling/shape/LineSamplerTest.java b/commons-rng-sampling/src/test/java/org/apache/commons/rng/sampling/shape/LineSamplerTest.java
index 1f0aca1..f90f2e0 100644
--- a/commons-rng-sampling/src/test/java/org/apache/commons/rng/sampling/shape/LineSamplerTest.java
+++ b/commons-rng-sampling/src/test/java/org/apache/commons/rng/sampling/shape/LineSamplerTest.java
@@ -54,13 +54,10 @@ public class LineSamplerTest {
             {c2, c3},
             {c3, c2},
         }) {
-            try {
-                LineSampler.of(rng, c[0], c[1]);
-                Assertions.fail(String.format("Did not detect dimension mismatch: %d,%d",
+            Assertions.assertThrows(IllegalArgumentException.class,
+                () -> LineSampler.of(rng, c[0], c[1]),
+                () -> String.format("Did not detect dimension mismatch: %d,%d",
                     c[0].length, c[1].length));
-            } catch (IllegalArgumentException ex) {
-                // Expected
-            }
         }
     }
 
@@ -77,17 +74,16 @@ public class LineSamplerTest {
         Assertions.assertNotNull(LineSampler.of(rng, c[0],  c[1]));
         final double[] bad = {Double.POSITIVE_INFINITY, Double.NEGATIVE_INFINITY, Double.NaN};
         for (int i = 0; i < c.length; i++) {
+            final int ii = i;
             for (int j = 0; j < c[0].length; j++) {
+                final int jj = j;
                 for (final double d : bad) {
                     final double value = c[i][j];
                     c[i][j] = d;
-                    try {
-                        LineSampler.of(rng, c[0], c[1]);
-                        Assertions.fail(String.format("Did not detect non-finite coordinate: %d,%d = %s",
-                            i, j, d));
-                    } catch (IllegalArgumentException ex) {
-                        // Expected
-                    }
+                    Assertions.assertThrows(IllegalArgumentException.class,
+                        () -> LineSampler.of(rng, c[0], c[1]),
+                        () -> String.format("Did not detect non-finite coordinate: %d,%d = %s",
+                            ii, jj, d));
                     c[i][j] = value;
                 }
             }
diff --git a/commons-rng-sampling/src/test/java/org/apache/commons/rng/sampling/shape/TetrahedronSamplerTest.java b/commons-rng-sampling/src/test/java/org/apache/commons/rng/sampling/shape/TetrahedronSamplerTest.java
index 7a2281b..8ec8484 100644
--- a/commons-rng-sampling/src/test/java/org/apache/commons/rng/sampling/shape/TetrahedronSamplerTest.java
+++ b/commons-rng-sampling/src/test/java/org/apache/commons/rng/sampling/shape/TetrahedronSamplerTest.java
@@ -41,13 +41,11 @@ public class TetrahedronSamplerTest {
         final double[] bad = new double[2];
         final double[][] c = {ok, ok, ok, ok};
         for (int i = 0; i < c.length; i++) {
+            final int ii = i;
             c[i] = bad;
-            try {
-                TetrahedronSampler.of(rng, c[0], c[1], c[2], c[3]);
-                Assertions.fail(String.format("Did not detect invalid dimension for vertex: %d", i));
-            } catch (IllegalArgumentException ex) {
-                // Expected
-            }
+            Assertions.assertThrows(IllegalArgumentException.class,
+                () -> TetrahedronSampler.of(rng, c[0], c[1], c[2], c[3]),
+                () -> String.format("Did not detect invalid dimension for vertex: %d", ii));
             c[i] = ok;
         }
     }
@@ -65,16 +63,15 @@ public class TetrahedronSamplerTest {
         Assertions.assertNotNull(TetrahedronSampler.of(rng, c[0], c[1], c[2], c[3]));
         final double[] bad = {Double.POSITIVE_INFINITY, Double.NEGATIVE_INFINITY, Double.NaN};
         for (int i = 0; i < c.length; i++) {
+            final int ii = i;
             for (int j = 0; j < c[0].length; j++) {
+                final int jj = j;
                 for (final double d : bad) {
                     final double value = c[i][j];
                     c[i][j] = d;
-                    try {
-                        TetrahedronSampler.of(rng, c[0], c[1], c[2], c[3]);
-                        Assertions.fail(String.format("Did not detect non-finite coordinate: %d,%d = %s", i, j, d));
-                    } catch (IllegalArgumentException ex) {
-                        // Expected
-                    }
+                    Assertions.assertThrows(IllegalArgumentException.class,
+                        () -> TetrahedronSampler.of(rng, c[0], c[1], c[2], c[3]),
+                        () -> String.format("Did not detect non-finite coordinate: %d,%d = %s", ii, jj, d));
                     c[i][j] = value;
                 }
             }
diff --git a/commons-rng-sampling/src/test/java/org/apache/commons/rng/sampling/shape/TriangleSamplerTest.java b/commons-rng-sampling/src/test/java/org/apache/commons/rng/sampling/shape/TriangleSamplerTest.java
index b5a6495..9d2900d 100644
--- a/commons-rng-sampling/src/test/java/org/apache/commons/rng/sampling/shape/TriangleSamplerTest.java
+++ b/commons-rng-sampling/src/test/java/org/apache/commons/rng/sampling/shape/TriangleSamplerTest.java
@@ -116,13 +116,10 @@ public class TriangleSamplerTest {
             {c3, c3, c2},
             {c3, c2, c3},
         }) {
-            try {
-                TriangleSampler.of(rng, c[0], c[1], c[2]);
-                Assertions.fail(String.format("Did not detect dimension mismatch: %d,%d,%d",
-                        c[0].length, c[1].length, c[2].length));
-            } catch (IllegalArgumentException ex) {
-                // Expected
-            }
+            Assertions.assertThrows(IllegalArgumentException.class,
+                () -> TriangleSampler.of(rng, c[0], c[1], c[2]),
+                () -> String.format("Did not detect dimension mismatch: %d,%d,%d",
+                    c[0].length, c[1].length, c[2].length));
         }
     }
 
@@ -139,16 +136,15 @@ public class TriangleSamplerTest {
         Assertions.assertNotNull(TriangleSampler.of(rng, c[0],  c[1],  c[2]));
         final double[] bad = {Double.POSITIVE_INFINITY, Double.NEGATIVE_INFINITY, Double.NaN};
         for (int i = 0; i < c.length; i++) {
+            final int ii = i;
             for (int j = 0; j < c[0].length; j++) {
+                final int jj = j;
                 for (final double d : bad) {
                     final double value = c[i][j];
                     c[i][j] = d;
-                    try {
-                        TriangleSampler.of(rng, c[0], c[1], c[2]);
-                        Assertions.fail(String.format("Did not detect non-finite coordinate: %d,%d = %s", i, j, d));
-                    } catch (IllegalArgumentException ex) {
-                        // Expected
-                    }
+                    Assertions.assertThrows(IllegalArgumentException.class,
+                        () -> TriangleSampler.of(rng, c[0], c[1], c[2]),
+                        () -> String.format("Did not detect non-finite coordinate: %d,%d = %s", ii, jj, d));
                     c[i][j] = value;
                 }
             }
diff --git a/commons-rng-simple/src/test/java/org/apache/commons/rng/simple/ProvidersCommonParametricTest.java b/commons-rng-simple/src/test/java/org/apache/commons/rng/simple/ProvidersCommonParametricTest.java
index ed56283..80b2405 100644
--- a/commons-rng-simple/src/test/java/org/apache/commons/rng/simple/ProvidersCommonParametricTest.java
+++ b/commons-rng-simple/src/test/java/org/apache/commons/rng/simple/ProvidersCommonParametricTest.java
@@ -105,23 +105,17 @@ public class ProvidersCommonParametricTest {
         final RandomSource originalSource = data.getSource();
         final Object[] originalArgs = data.getArgs();
         if (originalArgs == null) {
-            try {
-                // Try passing arguments to a provider that does not require them
-                int arg1 = 123;
-                double arg2 = 456.0;
-                originalSource.create(arg1, arg2);
-                Assertions.fail("Source does not require arguments: " + originalSource);
-            } catch (IllegalArgumentException ex) {
-                // Expected
-            }
+            // Try passing arguments to a provider that does not require them
+            int arg1 = 123;
+            double arg2 = 456.0;
+            Assertions.assertThrows(IllegalArgumentException.class,
+                () -> originalSource.create(arg1, arg2),
+                () -> "Source does not require arguments: " + originalSource);
         } else {
-            try {
-                // Try no arguments for a provider that does require them
-                originalSource.create();
-                Assertions.fail("Source requires arguments: " + originalSource);
-            } catch (IllegalArgumentException ex) {
-                // Expected
-            }
+            // Try no arguments for a provider that does require them
+            Assertions.assertThrows(IllegalArgumentException.class,
+                () -> originalSource.create(),
+                () -> "Source requires arguments: " + originalSource);
         }
     }
 
diff --git a/commons-rng-simple/src/test/java/org/apache/commons/rng/simple/internal/RandomSourceInternalParametricTest.java b/commons-rng-simple/src/test/java/org/apache/commons/rng/simple/internal/RandomSourceInternalParametricTest.java
index 2e5ae23..a1f1b53 100644
--- a/commons-rng-simple/src/test/java/org/apache/commons/rng/simple/internal/RandomSourceInternalParametricTest.java
+++ b/commons-rng-simple/src/test/java/org/apache/commons/rng/simple/internal/RandomSourceInternalParametricTest.java
@@ -154,12 +154,9 @@ public class RandomSourceInternalParametricTest {
     @EnumSource
     public void testCannotConvertUnsupportedSeed(RandomSourceInternal randomSourceInternal) {
         for (final Object input : UNSUPPORTED_SEEDS) {
-            try {
-                randomSourceInternal.convertSeed(input);
-                Assertions.fail(input.getClass() + " input seed was not rejected as unsupported");
-            } catch (UnsupportedOperationException ex) {
-                // This is expected
-            }
+            Assertions.assertThrows(UnsupportedOperationException.class,
+                () -> randomSourceInternal.convertSeed(input),
+                () -> input.getClass() + " input seed was not rejected as unsupported");
         }
     }
 

[commons-rng] 07/13: RNG-163: Remove JUnit 4 support

Posted by ah...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

aherbert pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/commons-rng.git

commit ca203fcfcf09fca695b29b5ea90d135a103bffab
Author: Alex Herbert <ah...@apache.org>
AuthorDate: Sun Aug 15 21:46:50 2021 +0100

    RNG-163: Remove JUnit 4 support
    
    Drop the junit-vintage-engine dependency.
---
 pom.xml | 6 ------
 1 file changed, 6 deletions(-)

diff --git a/pom.xml b/pom.xml
index 815c8c3..728e44e 100644
--- a/pom.xml
+++ b/pom.xml
@@ -139,12 +139,6 @@
       <version>${rng.junit5.version}</version>
       <scope>test</scope>
     </dependency>
-    <dependency>
-      <groupId>org.junit.vintage</groupId>
-      <artifactId>junit-vintage-engine</artifactId>
-      <version>${rng.junit5.version}</version>
-      <scope>test</scope>
-    </dependency>
   </dependencies>
 
   <build>

[commons-rng] 13/13: Remove duplicate ConstantName module

Posted by ah...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

aherbert pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/commons-rng.git

commit 42a5151f9e2433ce84a6a77299cacbc389dcb870
Author: Alex Herbert <ah...@apache.org>
AuthorDate: Tue Aug 17 00:07:40 2021 +0100

    Remove duplicate ConstantName module
---
 src/main/resources/checkstyle/checkstyle.xml | 3 ---
 1 file changed, 3 deletions(-)

diff --git a/src/main/resources/checkstyle/checkstyle.xml b/src/main/resources/checkstyle/checkstyle.xml
index 42b2a8d..dc52a5b 100644
--- a/src/main/resources/checkstyle/checkstyle.xml
+++ b/src/main/resources/checkstyle/checkstyle.xml
@@ -206,9 +206,6 @@
     <!-- Switch statements should have independent cases -->
     <module name="FallThrough" />
 
-    <!-- Constant names should obey the traditional all uppercase naming convention -->
-    <module name="ConstantName" />
-
     <!-- No System.out.println() statements -->
     <module name="Regexp">
       <!-- no sysouts -->