### Question:
Actionlog { public int getUnseenMessageCount() { return unseenMessages.size(); } Actionlog(DropMessageRepository dropMessageRepository); void addFilter(Function<PersistenceDropMessage, Boolean> filter); void addObserver(Consumer<PersistenceDropMessage> observer); int getUnseenMessageCount();  }### Answer:
@Test public void testActionlogKnowsUnseenMessages() throws Exception { repo.addMessage(msg, contact, identity, false); assertEquals(1, log.getUnseenMessageCount()); waitUntil(() -> notifications.size() == 1); assertEquals(repo.lastMessage, notifications.get(0)); }
@Test public void actionlogKnowsWhenMessageWasSeen() throws Exception { repo.addMessage(msg, contact, identity, false); waitUntil(() -> notifications.size() == 1); notifications.clear(); repo.lastMessage.setSeen(true); assertEquals(0, log.getUnseenMessageCount()); waitUntil(() -> notifications.size() == 1); }