Program: 41699
Project: 41699
Buggy source:
private void recieveMessageIdSendCorrelationIdTestImpl(Object idForAmqpMessageClass) throws Exception {
  try (TestAmqpPeer testPeer=new TestAmqpPeer(IntegrationTestFixture.PORT)){
    Connection connection=testFixture.establishConnecton(testPeer);
    connection.start();
    testPeer.expectBegin(true);
    Session session=connection.createSession(false,Session.AUTO_ACKNOWLEDGE);
    Queue queue=session.createQueue("String_Node_Str");
    PropertiesDescribedType props=new PropertiesDescribedType();
    props.setMessageId(idForAmqpMessageClass);
    DescribedType amqpValueNullContent=new AmqpValueDescribedType(null);
    testPeer.expectReceiverAttach();
    testPeer.expectLinkFlowRespondWithTransfer(null,null,props,null,amqpValueNullContent);
    testPeer.expectDispositionThatIsAcceptedAndSettled();
    MessageConsumer messageConsumer=session.createConsumer(queue);
    Message receivedMessage=messageConsumer.receive(1000);
    testPeer.waitForAllHandlersToComplete(3000);
    assertNotNull(receivedMessage);
    String expectedBaseIdString=new AmqpMessageIdHelper().toBaseMessageIdString(idForAmqpMessageClass);
    String jmsMessageID=receivedMessage.getJMSMessageID();
    assertEquals("String_Node_Str" + expectedBaseIdString,jmsMessageID);
    testPeer.expectSenderAttach();
    MessageProducer producer=session.createProducer(queue);
    MessageHeaderSectionMatcher headersMatcher=new MessageHeaderSectionMatcher(true);
    MessageAnnotationsSectionMatcher msgAnnotationsMatcher=new MessageAnnotationsSectionMatcher(true);
    MessagePropertiesSectionMatcher propsMatcher=new MessagePropertiesSectionMatcher(true);
    propsMatcher.withCorrelationId(equalTo(idForAmqpMessageClass));
    TransferPayloadCompositeMatcher messageMatcher=new TransferPayloadCompositeMatcher();
    messageMatcher.setHeadersMatcher(headersMatcher);
    messageMatcher.setMessageAnnotationsMatcher(msgAnnotationsMatcher);
    messageMatcher.setPropertiesMatcher(propsMatcher);
    messageMatcher.setMessageContentMatcher(new EncodedAmqpValueMatcher(null));
    testPeer.expectTransfer(messageMatcher);
    Message message=session.createTextMessage();
    message.setJMSCorrelationID(jmsMessageID);
    producer.send(message);
    testPeer.waitForAllHandlersToComplete(3000);
  }
 }

Fixed version (ground truth):
private void recieveMessageIdSendCorrelationIdTestImpl(Object idForAmqpMessageClass) throws Exception {
  try (TestAmqpPeer testPeer=new TestAmqpPeer(testFixture.getAvailablePort())){
    Connection connection=testFixture.establishConnecton(testPeer);
    connection.start();
    testPeer.expectBegin(true);
    Session session=connection.createSession(false,Session.AUTO_ACKNOWLEDGE);
    Queue queue=session.createQueue("String_Node_Str");
    PropertiesDescribedType props=new PropertiesDescribedType();
    props.setMessageId(idForAmqpMessageClass);
    DescribedType amqpValueNullContent=new AmqpValueDescribedType(null);
    testPeer.expectReceiverAttach();
    testPeer.expectLinkFlowRespondWithTransfer(null,null,props,null,amqpValueNullContent);
    testPeer.expectDispositionThatIsAcceptedAndSettled();
    MessageConsumer messageConsumer=session.createConsumer(queue);
    Message receivedMessage=messageConsumer.receive(1000);
    testPeer.waitForAllHandlersToComplete(3000);
    assertNotNull(receivedMessage);
    String expectedBaseIdString=new AmqpMessageIdHelper().toBaseMessageIdString(idForAmqpMessageClass);
    String jmsMessageID=receivedMessage.getJMSMessageID();
    assertEquals("String_Node_Str" + expectedBaseIdString,jmsMessageID);
    testPeer.expectSenderAttach();
    MessageProducer producer=session.createProducer(queue);
    MessageHeaderSectionMatcher headersMatcher=new MessageHeaderSectionMatcher(true);
    MessageAnnotationsSectionMatcher msgAnnotationsMatcher=new MessageAnnotationsSectionMatcher(true);
    MessagePropertiesSectionMatcher propsMatcher=new MessagePropertiesSectionMatcher(true);
    propsMatcher.withCorrelationId(equalTo(idForAmqpMessageClass));
    TransferPayloadCompositeMatcher messageMatcher=new TransferPayloadCompositeMatcher();
    messageMatcher.setHeadersMatcher(headersMatcher);
    messageMatcher.setMessageAnnotationsMatcher(msgAnnotationsMatcher);
    messageMatcher.setPropertiesMatcher(propsMatcher);
    messageMatcher.setMessageContentMatcher(new EncodedAmqpValueMatcher(null));
    testPeer.expectTransfer(messageMatcher);
    Message message=session.createTextMessage();
    message.setJMSCorrelationID(jmsMessageID);
    producer.send(message);
    testPeer.waitForAllHandlersToComplete(3000);
  }
 }