DictEntry implements Comparable<DictEntry>, Serializable { @Override public final boolean equals(Object other) { if (!(other instanceof DictEntry)) { return false; } final DictEntry o = (DictEntry) other; return equals(getJapanese(), o.getJapanese()) && equals(english, o.english); } DictEntry(final String kanji, final String reading, final String english);  DictEntry(final String kanji, final String reading, final String english, final Boolean isCommon); final boolean isValid(); static DictEntry newErrorMsg(final Throwable t); static DictEntry newErrorMsg(final String errorMsg); static Collection<? extends DictEntry> removeInvalid(final Collection<? extends DictEntry> edictEntries); String formatJapanese(final RomanizationEnum romanize); final String getJapanese(); final int compareTo(DictEntry another); @Override final int hashCode(); @Override final boolean equals(Object other); static String getJapaneseWord(Collection<? extends DictEntry> entries); final String toExternal(); static DictEntry fromExternal(final String external); static String toExternalList(final List<? extends DictEntry> entries); static List<DictEntry> fromExternalList(final String external); @Override String toString(); final int getCommonality(); final String kanji; final String reading; final String english; final Boolean isCommon; }
@Test public void testEquals() { assertCorrectEquals(new DictEntry("kanji", "reading", "english"), new DictEntry("kanji", "reading2", "english"), new DictEntry("kanji2", "reading", "english"), new EdictEntry("CHEAT", "CHEAT", "CHEAT", false)); assertCorrectEquals(new DictEntry(null, "reading", "english"), new DictEntry(null, "reading", "english"), new DictEntry(null, "reading", "english2"), new EdictEntry("CHEAT", "CHEAT", "CHEAT", false)); }