CacheTagImpl implements CacheTag, Serializable { @Override public boolean equals(Object obj) { if (obj instanceof CacheTagImpl) { CacheTagImpl tag = (CacheTagImpl) obj; return key.equals(tag.key) && value.equals(tag.value); } return super.equals(obj); } CacheTagImpl(String key);  CacheTagImpl(String key, String value); String getName(); String getValue(); @Override boolean equals(Object obj); @Override int hashCode(); @Override String toString(); void setMatchAny(); boolean matchesAny();  }
@Test public void testEqualsObject() { CacheTagImpl strictTag = null; strictTag = new CacheTagImpl(tagName, tagValue); assertTrue(tag.equals(strictTag)); strictTag = new CacheTagImpl(tagName, "othervalue"); assertFalse(tag.equals(strictTag)); strictTag = new CacheTagImpl("othername", tagValue); assertFalse(tag.equals(strictTag)); strictTag = new CacheTagImpl(tagName); assertFalse(tag.equals(strictTag)); }