Dictionary implements Iterable<StringList> { @Override public boolean equals(Object obj) { boolean result; if (obj == this) { result = true; } else if (obj instanceof Dictionary) { Dictionary dictionary = (Dictionary) obj; result = entrySet.equals(dictionary.entrySet); } else { result = false; } return result; } Dictionary();  Dictionary(boolean caseSensitive);  Dictionary(InputStream in);  Dictionary(InputStream in, boolean caseSensitive); void put(StringList tokens); int getMinTokenCount(); int getMaxTokenCount(); boolean contains(StringList tokens); void remove(StringList tokens); Iterator<StringList> iterator(); int size(); void serialize(OutputStream out); @Override boolean equals(Object obj); @Override int hashCode(); @Override String toString(); static Dictionary parseOneEntryPerLine(Reader in); Set<String> asStringSet();  }
@Test public void testEquals() { StringList entry1 = new StringList(new String[]{"1a", "1b"}); StringList entry2 = new StringList(new String[]{"2a", "2b"}); Dictionary dictA = getCaseInsensitive(); dictA.put(entry1); dictA.put(entry2); Dictionary dictB = getCaseInsensitive(); dictB.put(entry1); dictB.put(entry2); Dictionary dictC = getCaseSensitive(); dictC.put(entry1); dictC.put(entry2); assertTrue(dictA.equals(dictB)); assertTrue(dictC.equals(dictA)); assertTrue(dictB.equals(dictC)); }