@Override
  public Object next() {
    if (_numberOfValuesPerEntry == 1) {
      return getNextNumber();
    }
    return MultiValueGeneratorHelper.generateMultiValueEntries(_numberOfValuesPerEntry, _random, this::getNextNumber);
  }
@Test
  public void testNext() {
    Random random = mock(Random.class);
    when(random.nextInt(anyInt())).thenReturn(10); // initial value
    int cardinality = 5;
    double numValuesPerEntry = 1.0;

    // long generator
    NumberGenerator generator = new NumberGenerator(cardinality, FieldSpec.DataType.LONG, numValuesPerEntry, random);
    long[] expectedValues = { //
        10L, 11L, 12L, 13L, 14L, //
        10L, 11L, 12L, 13L, 14L
    };
    for (long expected : expectedValues) {
      assertEquals(generator.next(), expected);
    }

    // timestamp generator
    generator = new NumberGenerator(cardinality, FieldSpec.DataType.TIMESTAMP, numValuesPerEntry, random);
    for (long expected : expectedValues) {
      assertEquals(generator.next(), expected);
    }

    // double generator
    generator = new NumberGenerator(cardinality, FieldSpec.DataType.FLOAT, numValuesPerEntry, random);
    float[] expectedValueFloat = { //
        10.5f, 11.5f, 12.5f, 13.5f, 14.5f, //
        10.5f, 11.5f, 12.5f, 13.5f, 14.5f
    };
    for (float expected : expectedValueFloat) {
      assertEquals(generator.next(), expected);
    }
  }