public static CompressingCodec randomInstance(Random random,int chunkSize,int maxDocsPerChunk,boolean withSegmentSuffix,int blockSize){
switch (random.nextInt(4)) {
case 0:
    return new FastCompressingCodec(chunkSize,maxDocsPerChunk,withSegmentSuffix,blockSize);
case 1:
  return new FastDecompressionCompressingCodec(chunkSize,maxDocsPerChunk,withSegmentSuffix,blockSize);
case 2:
return new HighCompressionCompressingCodec(chunkSize,maxDocsPerChunk,withSegmentSuffix,blockSize);
case 3:
return new DummyCompressingCodec(chunkSize,maxDocsPerChunk,withSegmentSuffix,blockSize);
default :
throw new AssertionError();
}
}

public static CompressingCodec randomInstance ( Random random , int chunkSize , int maxDocsPerChunk , boolean withSegmentSuffix , int blockSize ) { switch ( random . nextInt ( 4 ) ) { case 0 : return new FastCompressingCodec ( chunkSize , maxDocsPerChunk , withSegmentSuffix , blockSize ) ; case 1 : return new FastDecompressionCompressingCodec ( chunkSize , maxDocsPerChunk , withSegmentSuffix , blockSize ) ; case 2 : return new HighCompressionCompressingCodec ( chunkSize , maxDocsPerChunk , withSegmentSuffix , blockSize ) ; case 3 : return new DummyCompressingCodec ( chunkSize , maxDocsPerChunk , withSegmentSuffix , blockSize ) ; default : throw new AssertionError ( ) ; } }
create a random instance .
