in geode-benchmarks/src/main/java/org/apache/geode/benchmark/tasks/WeightedTasks.java [56:68]
public boolean test(final Map<Object, Object> context) throws Exception {
int weight = ThreadLocalRandom.current().nextInt(totalWeight) + 1;
for (final WeightedTask weightedTask : weightedTasks) {
weight -= weightedTask.weight;
if (weight > 0) {
continue;
}
return weightedTask.task.test(context);
}
return true;
}