Utils { static List<Emoji> asListWithoutDuplicates(final Emoji[] emojis) { final List<Emoji> result = new ArrayList<>(emojis.length); for (final Emoji emoji : emojis) { if (!emoji.isDuplicate()) { result.add(emoji); } } return result; } private  Utils();   }
@Test public void asListFilter() { final Emoji[] emojis = new Emoji[] { new Emoji("\u1234".codePointAt(0), new String[]{"test"}, R.drawable.emoji_backspace, false), new Emoji("\u1234".codePointAt(0), new String[]{"test"}, R.drawable.emoji_backspace, true), }; final List<Emoji> filtered = Utils.asListWithoutDuplicates(emojis); assertThat(filtered).containsExactly(emojis[0]); }