@Test
public void ApplyConversationReference() {

    Activity activity = createActivity();
    ConversationReference conversationReference = new ConversationReference() {
        {
            setChannelId("123");
            setServiceUrl("serviceUrl");
            setConversation(new ConversationAccount() {
                {
                    setId("456");
                }
            });
            setUser(new ChannelAccount() {
                {
                    setId("abc");
                }
            });
            setBot(new ChannelAccount() {
                {
                    setId("def");
                }
            });
            setActivityId("12345");
            setLocale("en-uS"); // Intentionally oddly-cased to check that it isn't defaulted somewhere, but
                                // tests stay in English
        }
    };
    activity.applyConversationReference(conversationReference, false);
    Assert.assertEquals(conversationReference.getChannelId(), activity.getChannelId());
    Assert.assertEquals(conversationReference.getLocale(), activity.getLocale());
    Assert.assertEquals(conversationReference.getServiceUrl(), activity.getServiceUrl());
    Assert.assertEquals(conversationReference.getConversation().getId(), activity.getConversation().getId());
    Assert.assertEquals(conversationReference.getBot().getId(), activity.getFrom().getId());
    Assert.assertEquals(conversationReference.getUser().getId(), activity.getRecipient().getId());
    Assert.assertEquals(conversationReference.getActivityId(), activity.getReplyToId());
}