Resource implements IResource { @Override public boolean equals(Object obj) { if (this == obj) return true; if (obj == null) return false; if (getClass() != obj.getClass()) return false; Resource other = (Resource) obj; if (m_libInfo == null) { if (other.m_libInfo != null) return false; } else if (!m_libInfo.equals(other.m_libInfo)) return false; if (m_urn == null) { if (other.m_urn != null) return false; } else if (!m_urn.equals(other.m_urn)) return false; return true; } Resource(IResourceUrn urn, URL physicalUrl, IResourceLocale locale, IResourceLibrary libraryInfo);  Resource(Resource resource); @Override boolean equals(Object obj); @Override byte[] getBinaryContent(IResourceContext context); @Override String getContent(IResourceContext context); @Override List<IResource> getDependencies(); @Override long getLastModified(); @Override IResourceLibrary getLibrary(); @Override IResourceLocale getLocale(); @Override byte[] getOriginalBinaryContent(); @Override byte[] getOriginalBinaryContent(ITemplateContext context); @Override String getOriginalContent(); @Override String getOriginalContent(ITemplateContext context); @Override URL getOriginalUrl(); @Override String getUrl(IResourceContext context); @Override IResourceUrn getUrn(); @Override int hashCode(); @Override void setDependencies(List<IResource> dependencies); void setHandler(IResourceHandler handler); @Override String toString();  }
@Test public void testArguments() throws NoSuchFieldException, SecurityException, IllegalArgumentException, IllegalAccessException { Resource resource = (Resource)ResourceFactory.createResource("/js/sample/sample.js"); Resource cloneResource = new Resource(resource); Assert.assertTrue(cloneResource.equals(resource)); Class<Resource> clazz = Resource.class; Field libInfo = clazz.getDeclaredField("m_libInfo"); libInfo.setAccessible(true); ResourceLibrary lib = new ResourceLibrary("testLib", "0.0.1-SNAPSHOT", LibraryType.JAR); ResourceLibrary lib1 = new ResourceLibrary("testLib", "0.0.2-SNAPSHOT", LibraryType.JAR); libInfo.set(cloneResource, lib); Assert.assertFalse(resource.equals(cloneResource)); libInfo.set(resource, lib1); Assert.assertFalse(resource.equals(cloneResource)); libInfo.set(resource, lib); Field urn = clazz.getDeclaredField("m_urn"); urn.setAccessible(true); urn.set(resource, null); Assert.assertFalse(resource.equals(cloneResource)); }