public static List<Object> generateMultiValueEntries(double numberOfValuesPerEntry, Random rand,
      Supplier<Object> nextItemFunc) {
    List<Object> entries = new ArrayList<>();
    int i = 0;
    for (; i < numberOfValuesPerEntry - 1; i++) {
      entries.add(nextItemFunc.get());
    }
    // last item
    if (rand.nextDouble() < numberOfValuesPerEntry - i) {
      entries.add(nextItemFunc.get());
    }
    return entries;
  }
@Test
  public void testGenerateMultiValueEntries() {

    Random rand = mock(Random.class);
    when(rand.nextInt()).thenReturn(10, 20, 30, 40, 50, 60, 70);
    when(rand.nextDouble()).thenReturn(0.4);
    Supplier<Object> next = rand::nextInt;

    double numberOfValuesPerEntry = 3.3;
    assertEquals(MultiValueGeneratorHelper.generateMultiValueEntries(numberOfValuesPerEntry, rand, next),
        Arrays.asList(10, 20, 30));

    numberOfValuesPerEntry = 3.5;
    assertEquals(MultiValueGeneratorHelper.generateMultiValueEntries(numberOfValuesPerEntry, rand, next),
        Arrays.asList(40, 50, 60, 70));
  }