public static <T> List<T> selectRandomItems(T[] items, float ratio) {
    // clamp ratio to [0.0,1.0]
    ratio = Math.max(Math.min(ratio, 1.0f), 0.0f);
    final int selectedNumber = (int) Math.ceil(items.length * ratio);
    final ReservoirSample<T> sample = new ReservoirSample<>(selectedNumber);
    sample.add(Arrays.stream(items));
    final List<T> shuffledItems = sample.getSamplingResult();
    Collections.shuffle(shuffledItems);
    return shuffledItems;
  }
Selects and returns ceil(ratio * items.length) random items from the given array
hbase-it/src/test/java/org/apache/hadoop/hbase/chaos/monkies/PolicyBasedChaosMonkey.java