### Question:
Random { public byte[] randomBytes(int n) { byte[] buffer = new byte[n]; sodium().randombytes(buffer, n); return buffer; }  byte[] randomBytes(int n); byte[] randomBytes();  }### Answer:
@Test public void testProducesRandomBytes() throws Exception { final int size = 16; assertEquals("Invalid random bytes", size, new Random().randomBytes(size).length); }
@Test public void testProducesDefaultRandomBytes() throws Exception { final int size = 32; assertEquals("Invalid random bytes", size, new Random().randomBytes().length); }
@Test public void testProducesDifferentRandomBytes() throws Exception { final int size = 16; assertFalse("Should produce different random bytes", Arrays.equals(new Random().randomBytes(size), new Random().randomBytes(size))); }
@Test public void testProducesDifferentDefaultRandomBytes() throws Exception { final int size = 32; assertFalse("Should produce different random bytes", Arrays.equals(new Random().randomBytes(), new Random().randomBytes(size))); }