@Test public void testEquals() { final ImplicitTemplateMap m1 = new ImplicitTemplateMap(new Object[] {"a", "b"}); final ImplicitTemplateMap m2 = new ImplicitTemplateMap(new Object[] {"a", "b"}); final ImplicitTemplateMap m3 = new ImplicitTemplateMap(new Object[] {"c", "d"}); final ImplicitTemplateMap m4 = new ImplicitTemplateMap(new Object[] {"c", "d"}); assertEquals(m1, m1); assertEquals(m1.hashCode(), m2.hashCode()); assertEquals(m1, m2); assertEquals(m3, m4); assertNotEquals(m1, m3); assertNotEquals(m1, null); assertNotEquals(m1, new Object()); m4.get("foo"); assertNotEquals(m3, m4); }
@Override public boolean equals(final Object obj) { if (!(obj instanceof ImplicitTemplateMap)) { return false; } final ImplicitTemplateMap other = (ImplicitTemplateMap) obj; return super.equals(other) && Arrays.equals(templateValues, other.templateValues); }
ImplicitTemplateMap extends HashMap<String, Object> { @Override public boolean equals(final Object obj) { if (!(obj instanceof ImplicitTemplateMap)) { return false; } final ImplicitTemplateMap other = (ImplicitTemplateMap) obj; return super.equals(other) && Arrays.equals(templateValues, other.templateValues); } }
ImplicitTemplateMap extends HashMap<String, Object> { @Override public boolean equals(final Object obj) { if (!(obj instanceof ImplicitTemplateMap)) { return false; } final ImplicitTemplateMap other = (ImplicitTemplateMap) obj; return super.equals(other) && Arrays.equals(templateValues, other.templateValues); } ImplicitTemplateMap(final Object[] templateValues); }
ImplicitTemplateMap extends HashMap<String, Object> { @Override public boolean equals(final Object obj) { if (!(obj instanceof ImplicitTemplateMap)) { return false; } final ImplicitTemplateMap other = (ImplicitTemplateMap) obj; return super.equals(other) && Arrays.equals(templateValues, other.templateValues); } ImplicitTemplateMap(final Object[] templateValues); @Override Object get(final Object key); @Override int hashCode(); @Override boolean equals(final Object obj); }
ImplicitTemplateMap extends HashMap<String, Object> { @Override public boolean equals(final Object obj) { if (!(obj instanceof ImplicitTemplateMap)) { return false; } final ImplicitTemplateMap other = (ImplicitTemplateMap) obj; return super.equals(other) && Arrays.equals(templateValues, other.templateValues); } ImplicitTemplateMap(final Object[] templateValues); @Override Object get(final Object key); @Override int hashCode(); @Override boolean equals(final Object obj);  }