Program: 41696
Project: 41696
Buggy source:
private void sentMessageWithCorrelationIdTestImpl(String stringCorrelationId,Object correlationIdForAmqpMessageClass,boolean appSpecific) throws Exception {
  try (TestAmqpPeer testPeer=new TestAmqpPeer(IntegrationTestFixture.PORT)){
    Connection connection=testFixture.establishConnecton(testPeer);
    testPeer.expectBegin(true);
    testPeer.expectSenderAttach();
    Session session=connection.createSession(false,Session.AUTO_ACKNOWLEDGE);
    String queueName="String_Node_Str";
    Queue queue=session.createQueue(queueName);
    MessageProducer producer=session.createProducer(queue);
    MessageHeaderSectionMatcher headersMatcher=new MessageHeaderSectionMatcher(true);
    MessageAnnotationsSectionMatcher msgAnnotationsMatcher=new MessageAnnotationsSectionMatcher(true);
    MessagePropertiesSectionMatcher propsMatcher=new MessagePropertiesSectionMatcher(true);
    propsMatcher.withCorrelationId(equalTo(correlationIdForAmqpMessageClass));
    if (appSpecific) {
      msgAnnotationsMatcher.withEntry(Symbol.valueOf(AmqpMessageSupport.JMS_APP_CORRELATION_ID),equalTo(Boolean.TRUE));
    }
    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(stringCorrelationId);
    producer.send(message);
    testPeer.waitForAllHandlersToComplete(3000);
    if (!appSpecific) {
      assertFalse(msgAnnotationsMatcher.keyExistsInReceivedAnnotations(Symbol.valueOf(AmqpMessageSupport.JMS_APP_CORRELATION_ID)));
    }
  }
 }

Fixed version (ground truth):
private void sentMessageWithCorrelationIdTestImpl(String stringCorrelationId,Object correlationIdForAmqpMessageClass,boolean appSpecific) throws Exception {
  try (TestAmqpPeer testPeer=new TestAmqpPeer(testFixture.getAvailablePort())){
    Connection connection=testFixture.establishConnecton(testPeer);
    testPeer.expectBegin(true);
    testPeer.expectSenderAttach();
    Session session=connection.createSession(false,Session.AUTO_ACKNOWLEDGE);
    String queueName="String_Node_Str";
    Queue queue=session.createQueue(queueName);
    MessageProducer producer=session.createProducer(queue);
    MessageHeaderSectionMatcher headersMatcher=new MessageHeaderSectionMatcher(true);
    MessageAnnotationsSectionMatcher msgAnnotationsMatcher=new MessageAnnotationsSectionMatcher(true);
    MessagePropertiesSectionMatcher propsMatcher=new MessagePropertiesSectionMatcher(true);
    propsMatcher.withCorrelationId(equalTo(correlationIdForAmqpMessageClass));
    if (appSpecific) {
      msgAnnotationsMatcher.withEntry(Symbol.valueOf(AmqpMessageSupport.JMS_APP_CORRELATION_ID),equalTo(Boolean.TRUE));
    }
    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(stringCorrelationId);
    producer.send(message);
    testPeer.waitForAllHandlersToComplete(3000);
    if (!appSpecific) {
      assertFalse(msgAnnotationsMatcher.keyExistsInReceivedAnnotations(Symbol.valueOf(AmqpMessageSupport.JMS_APP_CORRELATION_ID)));
    }
  }
 }