### Question:
ActionlogController extends AbstractController implements Initializable, Observer { void sendDropMessage(Contact c, String text) throws QblDropPayloadSizeException, QblNetworkInvalidResponseException, PersistenceException { text = EmojiParser.parseToUnicode(text); DropMessage d = new DropMessage(identity, new TextMessage(text).toJson(), DropMessageRepository.PAYLOAD_TYPE_MESSAGE); d.setDropMessageMetadata(new DropMessageMetadata(identity)); dropConnector.send(c, d); dropMessageRepository.addMessage(d, identity, c, true); }  @Override void initialize(URL location, ResourceBundle resources); List<PersistenceDropMessage> getReceivedDropMessages(); @Override synchronized void update(Observable o, Object arg); synchronized void setContact(Contact contact); void handleAccept(); void handleIgnore(); void selectEmoji(); @FXML
    public BorderPane chat; @FXML
    public ImageView emojiSelector; }### Answer:
@Test public void switchBetweenIdentitesTest() throws Exception { clientConfiguration.selectIdentity(i); controller.sendDropMessage(c, "msg1"); i = identityBuilderFactory.factory().withAlias("NewIdentity").build(); c = new Contact(i.getAlias(), i.getDropUrls(), i.getEcPublicKey()); clientConfiguration.selectIdentity(i); controller.sendDropMessage(c, "msg2"); List<PersistenceDropMessage> lst = dropMessageRepository.loadConversation(c, i); assertEquals(1, lst.size()); DropMessage dropMessage = lst.get(0).dropMessage; assertEquals("msg2", TextMessage.fromJson(dropMessage.getDropPayload()).getText()); }
@Test public void showsMessagesOfCurrentConversation() throws Exception { clientConfiguration.selectIdentity(i); contactRepository.save(c, i); controller.sendDropMessage(c, "you won't see this"); receiveMessageFromC(); runLaterAndWait(() -> {}); assertEquals(2, controller.messages.getChildren().size()); }
@Test public void addDropMessageMetadata() throws Exception { controller.sendDropMessage(c, "msg2"); List<PersistenceDropMessage> lst = dropMessageRepository.loadConversation(c, i); DropMessageMetadata metadata = lst.get(0).dropMessage.getDropMessageMetadata(); assertEquals(metadata, new DropMessageMetadata(i)); }
@Test public void convertsEmojiAliasesToUnicode() throws Exception { controller.sendDropMessage(c, "contains :smiley:"); List<PersistenceDropMessage> lst = dropMessageRepository.loadConversation(c, i); String message = TextMessage.fromJson(lst.get(0).dropMessage.getDropPayload()).getText(); assertEquals("contains \uD83D\uDE03", message); }