public MockDirectoryWrapper(Random random, Directory delegate) { super(delegate); // must make a private random since our methods are // called from different threads; else test failures may // not be reproducible from the original seed this.randomState = new Random(random.nextInt()); this.throttledOutput = new ThrottledIndexOutput(ThrottledIndexOutput .mBitsToBytes(40 + randomState.nextInt(10)), 5 + randomState.nextInt(5), null); // force wrapping of lockfactory this.lockFactory = new MockLockFactoryWrapper(this, delegate.getLockFactory()); init(); }