Buggy code:
@ Configuration public class PolynomialFunctionTests { private static final Logger logger = LoggerFactory . getLogger ( PolynomialFunctionTests . class ) ; private static final Random r = new Random ( 0 ) ; private static final int INPUT_LENGTH = 32 ; private static final int OUTPUT_LENGTH = 32 ; private static final int PIPELINE_LENGTH = 2 ; @ Timed public void builderTest ( ) { } @ Timed public void denseRandomMVQTest ( ) { } @ Timed public void identityTest ( ) { } @ Timed public void monomialSetProductTest ( ) { } @ Timed public void productTest ( ) { } @ Timed public void quadraticComposeTest ( ) { } @ Timed public void bucketTest ( ) { } @ Timed public void mvqCompostTest ( ) { OptimizedPolynomialFunctionGF2 outer = ( ( OptimizedPolynomialFunctionGF2 ) ( denseRandomFunction ( ) ) ) ; SimplePolynomialFunction inner = linearFunction ( ) ; Stopwatch watch = Stopwatch . createStarted ( ) ; SimplePolynomialFunction composed = outer . mvqCompose ( inner ) ; PolynomialFunctionTests . logger . info ( "Compose<seq2seq4repair_space>took<seq2seq4repair_space>{}<seq2seq4repair_space>ms." , watch . elapsed ( TimeUnit . MILLISECONDS ) ) ; for ( int i = 0 ; i < 25 ; ++ i ) { <START_BUG> BitVector randomInput = BitVectors . randomVector ( ( 256 << 1 ) ) ; <END_BUG> BitVector innerResult = inner . apply ( randomInput ) ; BitVector outerResult = outer . apply ( innerResult ) ; BitVector composedResult = composed . apply ( randomInput ) ; PolynomialFunctionTests . logger . trace ( "Random<seq2seq4repair_space>input:<seq2seq4repair_space>{}" , randomInput ) ; PolynomialFunctionTests . logger . trace ( "Inner<seq2seq4repair_space>result:<seq2seq4repair_space>{}" , innerResult ) ; PolynomialFunctionTests . logger . trace ( "Outer<seq2seq4repair_space>result:<seq2seq4repair_space>{}" , outerResult ) ; PolynomialFunctionTests . logger . trace ( "Composed<seq2seq4repair_space>result:<seq2seq4repair_space>{}" , composedResult ) ; Assert . assertEquals ( outerResult , composedResult ) ; } } @ Timed public void generalComposeTest ( ) { } @ Timed public void testGeneralComposeParameterized ( ) { } @ Timed public void partialComposeTest ( ) { } @ Timed public void testConcatenateOutputs ( ) { } @ Timed public void testInterleaveFunctions ( ) { } @ Timed public void testToFromString ( ) { } @ Timed public void testRandomlyPartitionMVQ ( ) { } @ Timed public void testPipelineStage ( ) { } @ Timed public void testCombination ( ) { } @ Timed public void testUnitPipeline ( ) { } @ Timed public void testParallelization ( ) { } @ Timed public void testTestAssumptions ( ) { } @ Bean @ Scope ( ConfigurableBeanFactory . SCOPE_PROTOTYPE ) @ Timed public SimplePolynomialFunction randomFunction ( ) { } @ Bean @ Timed public SimplePolynomialFunction identity ( ) { } @ Bean @ Timed public SimplePolynomialFunction optimizedIdentity ( ) { } @ Bean @ Scope ( ConfigurableBeanFactory . SCOPE_PROTOTYPE ) @ Timed public SimplePolynomialFunction denseRandomFunction ( ) { } @ Bean @ Timed public SimplePolynomialFunction singletonDenseRandomFunction ( ) { } @ Bean @ Scope ( ConfigurableBeanFactory . SCOPE_PROTOTYPE ) @ Timed public SimplePolynomialFunction linearFunction ( ) { } @ Bean @ Scope ( ConfigurableBeanFactory . SCOPE_PROTOTYPE ) @ Timed public SimplePolynomialFunction optimizedLinearFunction ( ) { } @ Bean @ Scope ( ConfigurableBeanFactory . SCOPE_PROTOTYPE ) @ Timed public BitVector randomVector ( ) { } @ Timed public void addTest ( ) { } @ Timed public void testRowProduct ( ) { } @ Timed public void mostFrequentFactorTest ( ) { } @ Timed public void testConcatenateInputsAndOutputs ( ) { } @ Timed public void testNonlinearPipeline ( ) { } }

Fix:
BitVector randomInput = BitVectors . randomVector ( ( ( PolynomialFunctionTests . INPUT_LENGTH ) << 1 ) ) ;