How to generate an dynamic array of N elements and each of the allowed integer needs to be repeated more than 8 times,

How do I write an parameterized UVM transaction class to generate a dynamic array of int type.
There will be 2 input parameters of the class:

  • the number of elements of this dynamic array: N
  • an array that contains all the integers allowed inside the dynamic array (like{0,1,2,3}or {3,4,5,8,9,}, assigned by outside sequence)

Each of the integers in the above queue should be replicated for more than 8 times inside the dynamic array.

No consecutive values in adjacent elements except for the first value mentioned in the above 2nd variable, eg. assume 2nd variable is {0,1,2,3,4}
- dyn_array=‘{0,1,1,2,3,4…}-- is Not allowed, the 2nd value repeated consecutively
- dyn_array=’{0,0,1,0,0,2,3,4…}-- is allowed, the 1st value repeated consecutively

Write down the complete code of the class including property field registering, constructor function.