ResourceArgumentsUrn extends ResourceUrn implements IResourceArgumentsUrn { @Override public boolean equals(Object obj) { if (this == obj) return true; if (!super.equals(obj)) return false; if (getClass() != obj.getClass()) return false; ResourceArgumentsUrn other = (ResourceArgumentsUrn) obj; if (m_argument == null) { if (other.m_argument != null) return false; } else if (!m_argument.equals(other.m_argument)) return false; return true; } ResourceArgumentsUrn(String type, String namespace, String resourcePath, Map<String, Object> arguments); @Override boolean equals(Object obj); @Override Map<String, Object> getArgument(); @Override int hashCode();  }
@Test public void testEquals() { Map<String, Object> arguments = new HashMap<String, Object>(); arguments.put("key1", "value1"); arguments.put("key2", "value2"); ResourceArgumentsUrn urn = new ResourceArgumentsUrn("js", "local", "/js/sample/sample.js", arguments); Assert.assertTrue(urn.equals(urn)); ResourceArgumentsUrn cloneUrn = new ResourceArgumentsUrn("js", "local", "/js/sample/sample.js", arguments); Assert.assertTrue(urn.equals(cloneUrn)); ResourceArgumentsUrn urn1 = new ResourceArgumentsUrn("js", "local", "/js/sample/sample.js", null); Assert.assertFalse(urn1.equals(urn)); Assert.assertFalse(urn.equals(urn1)); MockResourceArgumentsUrn mockUrn = new MockResourceArgumentsUrn("js", "local", "/js/sample/sample.js", arguments); Assert.assertFalse(urn.equals(mockUrn)); }