SecureRandomUtils { public static byte[] generateRandomBytes(int size) { byte[] bytes = new byte[size]; SecureRandomUtils.secureRandom().nextBytes(bytes); return bytes; } private  SecureRandomUtils(); static SecureRandom secureRandom(); static byte[] generateRandomBytes(int size);  }
@Test public void testGenerateRandomBytes() { assertThat(SecureRandomUtils.generateRandomBytes(0), is(new byte[]{})); assertThat(SecureRandomUtils.generateRandomBytes(10).length, is(10)); }