if (r.nextBoolean()) {
c.setMergePolicy(newTieredMergePolicy());
} else if (r.nextBoolean()) {
c.setMergePolicy(newLogMergePolicy());
} else {
c.setMergePolicy(new MockRandomMergePolicy(r));
}
if (r.nextBoolean()) {
c.setMergeScheduler(new SerialMergeScheduler());
}
if (r.nextBoolean()) {
if (rarely(r)) {
// crazy value
c.setMaxBufferedDocs(_TestUtil.nextInt(r, 2, 15));
} else {
// reasonable value
c.setMaxBufferedDocs(_TestUtil.nextInt(r, 16, 1000));
}
}
if (r.nextBoolean()) {
if (rarely(r)) {
// crazy value
c.setTermIndexInterval(r.nextBoolean() ? _TestUtil.nextInt(r, 1, 31) : _TestUtil.nextInt(r, 129, 1000));
} else {
// reasonable value
c.setTermIndexInterval(_TestUtil.nextInt(r, 32, 128));
}
}
if (r.nextBoolean()) {
if (rarely(r)) {
// crazy value
c.setMaxThreadStates(_TestUtil.nextInt(r, 5, 20));
} else {
// reasonable value
c.setMaxThreadStates(_TestUtil.nextInt(r, 1, 4));
}
}
if (rarely(r)) {
c.setMergePolicy(new MockRandomMergePolicy(r));
} else if (r.nextBoolean()) {
c.setMergePolicy(newTieredMergePolicy());
} else {
c.setMergePolicy(newLogMergePolicy());
}