RecentEmojiManager implements RecentEmoji { @Override public void addEmoji(@NonNull final Emoji emoji) { emojiList.add(emoji); } RecentEmojiManager(@NonNull final Context context); @Override @SuppressWarnings({ "PMD.AvoidDeeplyNestedIfStmts", "checkstyle:nestedifdepth" }) @NonNull Collection<Emoji> getRecentEmojis(); @Override void addEmoji(@NonNull final Emoji emoji); @Override void persist();  }
@Test public void addEmoji() { recentEmojiManager.addEmoji(new Emoji(0x1f437, new String[]{"test"}, R.drawable.emoji_recent, false)); recentEmojiManager.addEmoji(new Emoji(0x1f43d, new String[]{"test"}, R.drawable.emoji_recent, false)); assertThat(recentEmojiManager.getRecentEmojis()).hasSize(2) .containsExactly( new Emoji(0x1f43d, new String[]{"test"}, R.drawable.emoji_recent, false), new Emoji(0x1f437, new String[]{"test"}, R.drawable.emoji_recent, false)); }