@Override
  public Object next() {
    if (_numberOfValuesPerEntry == 1) {
      return getNextNumber();
    }
    return MultiValueGeneratorHelper.generateMultiValueEntries(_numberOfValuesPerEntry, _random, this::getNextNumber);
  }
@Test
  public void testNextMultiValued() {
    Random random = mock(Random.class);
    when(random.nextInt(anyInt())).thenReturn(10); // initial value
    when(random.nextDouble()).thenReturn(0.0, 0.1, 0.2, 0.3, 0.4, 0.5, 0.6, 0.7, 0.8, 0.9); // for MV generation
    int cardinality = 5;
    double numValuesPerEntry = 2.4;
    NumberGenerator generator = new NumberGenerator(cardinality, FieldSpec.DataType.INT, numValuesPerEntry, random);
    int[][] expectedValues = { //
        {10, 11, 12}, // rnd < 0.4
        {13, 14, 10}, // rnd < 0.4
        {11, 12, 13}, // rnd < 0.4
        {14, 10, 11}, // rnd < 0.4
        {12, 13}, // rnd >= 0.4
        {14, 10}, // rnd >= 0.4
        {11, 12}, // rnd >= 0.4
        {13, 14}, // rnd >= 0.4
        {10, 11}, // rnd >= 0.4
        {12, 13}, // rnd >= 0.4
    };
    for (int[] expected : expectedValues) {
      List<Integer> actual = (List<Integer>) generator.next();
      assertEquals(actual.toArray(), expected);
    }
  }