Code example for Random

0
 * @since 11.07.12 
 */ 
@Test 
public class UnsafeByteArrayComparatorSpeedTest extends OrientMonoThreadTest { 
  private final OUnsafeByteArrayComparator unsafeByteArrayComparator = new OUnsafeByteArrayComparator();
  private final Random                     random                    = new Random();
  private final byte[]                     bytesOne                  = new byte[256];
  private final byte[]                     bytesTwo                  = new byte[256];
 
  public UnsafeByteArrayComparatorSpeedTest() { 
    super(10000000); 
  } 
 
  @Override 
  @Test(enabled = false) 
  public void beforeCycle() throws Exception { 
    int eqBorder = random.nextInt(bytesOne.length);
 
    for (int i = 0; i < eqBorder; i++) {
      bytesOne[i] = (byte) i;
      bytesTwo[i] = (byte) i;