@@ -43,7 +43,7 @@ void batchCompressByteArrayTest() {
4343 final int batchSize = RANDOM .nextInt (500 , 1000 );
4444 final int numberOfBatches = RANDOM .nextInt (500 , 1000 );
4545 final int totalElements = batchSize * numberOfBatches ;
46- final List <byte []> fullSource = new ArrayList <>();
46+ final List <byte []> fullSource = new ArrayList <>(totalElements );
4747 final byte [][] destination = new byte [totalElements * 2 ][]; // Half empty.
4848 final FourBitAsciiCompressor compressor = new FourBitAsciiCompressor (true , true );
4949 final ManagedBulkCompressor managed = new ManagedBulkCompressor (compressor , destination );
@@ -82,7 +82,7 @@ void batchCompressStringArrayTest() {
8282 final int batchSize = RANDOM .nextInt (500 , 1000 );
8383 final int numberOfBatches = RANDOM .nextInt (500 , 1000 );
8484 final int totalElements = batchSize * numberOfBatches ;
85- final List <String > fullSource = new ArrayList <>();
85+ final List <String > fullSource = new ArrayList <>(totalElements );
8686 final byte [][] destination = new byte [totalElements * 2 ][]; // Half empty.
8787 final FiveBitAsciiCompressor compressor = new FiveBitAsciiCompressor (true , true );
8888 final ManagedBulkCompressor managed = new ManagedBulkCompressor (compressor , destination );
@@ -121,7 +121,7 @@ void batchCompressStringListTest() {
121121 final int batchSize = RANDOM .nextInt (500 , 1000 );
122122 final int numberOfBatches = RANDOM .nextInt (500 , 1000 );
123123 final int totalElements = batchSize * numberOfBatches ;
124- final List <String > fullSource = new ArrayList <>();
124+ final List <String > fullSource = new ArrayList <>(totalElements );
125125 final byte [][] destination = new byte [totalElements * 2 ][]; // Half empty.
126126 final SixBitAsciiCompressor compressor = new SixBitAsciiCompressor (true , true );
127127 final ManagedBulkCompressor managed = new ManagedBulkCompressor (compressor , destination );
0 commit comments