RandomAdaptor extends Random implements RandomGenerator { public static Random createAdaptor(RandomGenerator randomGenerator) { return new RandomAdaptor(randomGenerator); } @SuppressWarnings("unused") private  RandomAdaptor();  RandomAdaptor(RandomGenerator randomGenerator); static Random createAdaptor(RandomGenerator randomGenerator); @Override boolean nextBoolean(); @Override void nextBytes(byte[] bytes); @Override double nextDouble(); @Override float nextFloat(); @Override double nextGaussian(); @Override int nextInt(); @Override int nextInt(int n); @Override long nextLong(); void setSeed(int seed); void setSeed(int[] seed); @Override void setSeed(long seed);  }
@Test public void testAdaptor() { ConstantGenerator generator = new ConstantGenerator(); Random random = RandomAdaptor.createAdaptor(generator); checkConstant(random); RandomAdaptor randomAdaptor = new RandomAdaptor(generator); checkConstant(randomAdaptor); }