BasicTagList implements TagList { @Override public boolean equals(Object obj) { return this == obj || (obj instanceof BasicTagList) && tagMap.equals(((BasicTagList) obj).tagMap); } BasicTagList(SmallTagMap tagMap);  BasicTagList(Iterable<Tag> entries); Tag getTag(String key); String getValue(String key); boolean containsKey(String key); boolean isEmpty(); int size(); Iterator<Tag> iterator(); Map<String, String> asMap(); BasicTagList copy(TagList tags); BasicTagList copy(String key, String value); @Override boolean equals(Object obj); @Override int hashCode(); @Override String toString(); static BasicTagList concat(TagList t1, TagList t2); static BasicTagList concat(TagList t1, Tag... t2); static BasicTagList of(String... tags); static BasicTagList of(Tag... tags); @Deprecated static BasicTagList copyOf(Tag... tags); @Deprecated static BasicTagList copyOf(String... tags); static BasicTagList copyOf(Iterable<String> tags); static BasicTagList copyOf(Map<String, String> tags); static final TagList EMPTY; }
@Test public void testEquals() throws Exception { BasicTagList t1 = BasicTagList.of("foo", "bar"); BasicTagList t2 = BasicTagList.of("foo", "bar2"); BasicTagList t3 = BasicTagList.of("foo", "bar"); assertNotNull(t1); assertFalse(t1.toString().equals(t2.toString())); assertTrue(t1.equals(t1)); assertFalse(t1.equals(t2)); assertTrue(t1.equals(t3)); }