Resource implements IResource { private String getExtFromPath(String path) { int index = path.lastIndexOf('.'); if (index >= 0) { return path.substring(index + 1); } return null; } 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 testGetExtFromPath() throws NoSuchMethodException, SecurityException, IllegalAccessException, IllegalArgumentException, InvocationTargetException { Resource resource = (Resource)ResourceFactory.createResource("/js/sample/sample.js"); Class<Resource> clazz = Resource.class; Method method = clazz.getDeclaredMethod("getExtFromPath", String.class); method.setAccessible(true); Assert.assertNull(method.invoke(resource, "testPath")); }