### Question:
VerySecureRandom { @Nonnull public static SecureRandom getInstance () { final int nReSeedInterval = getReSeedInterval (); if (nReSeedInterval > 0) if ((s_aCounter.incrementAndGet () % nReSeedInterval) == 0) { if (LOGGER.isDebugEnabled ()) LOGGER.debug ("Re-seeding VerySecureRandom started"); final TimeValue aDuration = StopWatch.runMeasured ( () -> s_aSecureRandom.setSeed (s_aSecureRandom.generateSeed (SEED_BYTE_COUNT))); if (aDuration.getAsMillis () > WARNING_MILLISECONDS_THRESHOLD) if (LOGGER.isWarnEnabled ()) LOGGER.warn ("Re-seeding VerySecureRandom took too long (" + aDuration.getAsMillis () + " milliseconds) - you may consider using '/dev/urandom'"); } return s_aSecureRandom; } private  VerySecureRandom(); static void setReSeedInterval(@Nonnegative final int nReseedInterval); @Nonnegative static int getReSeedInterval(); @Nonnull static SecureRandom getInstance(); static final int DEFAULT_RE_SEED_INTERVAL; }### Answer:
@Test public void testRandomGen () { final SecureRandom aRandom = VerySecureRandom.getInstance (); for (int j = 0; j < 2; ++j) { LOGGER.info ("Round " + (j + 1) + " with int"); final ICommonsSet <Integer> aInts = new CommonsHashSet <> (); int nDuplicates = 0; for (int i = 0; i < MAX_RUNS; ++i) { final int n1 = aRandom.nextInt (); final int n2 = aRandom.nextInt (); assertNotEquals (n1, n2); if (!aInts.add (Integer.valueOf (n1))) nDuplicates++; if (!aInts.add (Integer.valueOf (n2))) nDuplicates++; } assertTrue (nDuplicates <= MAX_DUP); LOGGER.info ("Round " + (j + 1) + " with long"); nDuplicates = 0; final ICommonsSet <Long> aLongs = new CommonsHashSet <> (); for (int i = 0; i < MAX_RUNS; ++i) { final long n1 = aRandom.nextLong (); final long n2 = aRandom.nextLong (); assertNotEquals (n1, n2); if (!aLongs.add (Long.valueOf (n1))) nDuplicates++; if (!aLongs.add (Long.valueOf (n2))) nDuplicates++; } assertTrue (nDuplicates <= MAX_DUP); } }