### Question:
MersenneTwisterGenerateRandom extends AbstractBoxMuller { @Override public double nextDouble() { return (((long) next(26) << 27) + next(27)) / (double) (1L << 53); } MersenneTwisterGenerateRandom();  MersenneTwisterGenerateRandom(final long seed);  MersenneTwisterGenerateRandom(final int[] array); void setSeed(final long seed); void setSeed(final int[] array); @Override double nextDouble(); long nextLong(); @Override boolean nextBoolean(); @Override float nextFloat(); @Override int nextInt();  }### Answer:
@Test public void testBasic() { final MersenneTwisterGenerateRandom rnd = new MersenneTwisterGenerateRandom(1); assertEquals(4.1702200468159925, rnd.nextDouble(10), AIFH.DEFAULT_PRECISION); }
@Test public void testBasic2() { final int[] seed = {1, 2, 3}; final MersenneTwisterGenerateRandom rnd = new MersenneTwisterGenerateRandom(seed); assertEquals(6.09861274980219, rnd.nextDouble(10), AIFH.DEFAULT_PRECISION); }
@Test public void testDoubleRange() { final MersenneTwisterGenerateRandom rnd = new MersenneTwisterGenerateRandom(1); for (final double aDOUBLE_RANGE_TEST : DOUBLE_RANGE_TEST) { final double g = rnd.nextDouble(-1, 1); assertEquals(g, aDOUBLE_RANGE_TEST, AIFH.DEFAULT_PRECISION); } }
@Test public void testDouble() { final MersenneTwisterGenerateRandom rnd = new MersenneTwisterGenerateRandom(1); for (final double aDOUBLE_TEST : DOUBLE_TEST) { final double g = rnd.nextDouble(); assertEquals(g, aDOUBLE_TEST, AIFH.DEFAULT_PRECISION); } }