### Question:
MoodManager extends Manager { public static void addMoodToMessage(Message message, Mood mood) { addMoodToMessage(message, mood, null); } private  MoodManager(XMPPConnection connection); static synchronized MoodManager getInstanceFor(XMPPConnection connection); void setMood(Mood mood); void setMood(Mood mood, String text); void setMood(Mood mood, MoodConcretisation concretisation); void setMood(Mood mood, MoodConcretisation concretisation, String text); void clearMood(); static void addMoodToMessage(Message message, Mood mood); static void addMoodToMessage(Message message, Mood mood, MoodConcretisation concretisation); boolean addMoodListener(PepEventListener<MoodElement> listener); boolean removeMoodListener(PepEventListener<MoodElement> listener); static final String MOOD_NODE; }### Answer:
@Test public void addMessageTest() { Message message = StanzaBuilder.buildMessage().build(); MoodManager.addMoodToMessage(message, Mood.sad); assertTrue(message.hasExtension(MoodElement.ELEMENT, MoodElement.NAMESPACE)); assertTrue(MoodElement.hasMoodElement(message)); MoodElement element = MoodElement.fromMessage(message); assertNotNull(element); assertEquals(Mood.sad, element.getMood()); assertFalse(element.hasConcretisation()); assertFalse(element.hasText()); message = StanzaBuilder.buildMessage().build(); MoodManager.addMoodToMessage(message, Mood.happy, new MoodConcretisationTest.EcstaticMoodConcretisation()); element = MoodElement.fromMessage(message); assertTrue(element.hasConcretisation()); }