public static List<TimeSynchronizationSample> createRandomTolerableSamplesWithDifferentKeyPairsAroundMean(final int count,final long mean){
  final SecureRandom random=new SecureRandom();
  final List<TimeSynchronizationSample> samples=new ArrayList<>();
  if (count % 2 == 1) {
    samples.add(createTimeSynchronizationSampleWithKeyPair(new KeyPair(),mean));
  }
  for (int i=0; i < count / 2; i++) {
    final int value=random.nextInt(1000);
    samples.add(createTimeSynchronizationSampleWithKeyPair(new KeyPair(),mean + value));
    samples.add(createTimeSynchronizationSampleWithKeyPair(new KeyPair(),mean - value));
  }
  return samples;
}

public static List < TimeSynchronizationSample > createRandomTolerableSamplesWithDifferentKeyPairsAroundMean ( final int count , final long mean ) { final SecureRandom random = new SecureRandom ( ) ; final List < TimeSynchronizationSample > samples = new ArrayList < > ( ) ; if ( count % 2 == 1 ) { samples . add ( createTimeSynchronizationSampleWithKeyPair ( new KeyPair ( ) , mean ) ) ; } for ( int i = 0 ; i < count / 2 ; i ++ ) { final int value = random . nextInt ( 1000 ) ; samples . add ( createTimeSynchronizationSampleWithKeyPair ( new KeyPair ( ) , mean + value ) ) ; samples . add ( createTimeSynchronizationSampleWithKeyPair ( new KeyPair ( ) , mean - value ) ) ; } return samples ; }
creates a synchronization sample with a given time offset .
