### Question:
ResourceHandlerImpl extends ResourceHandler { @Override public Resource createResource(String resourceName) { return createResource(resourceName, null); }  @Override Resource createResource(String resourceName); @Override Resource createResource(String resourceName, String libraryName); @Override Resource createResource(String resourceName, String libraryName, String contentType); @Override String getRendererTypeForResourceName(String resourceName); @Override void handleResourceRequest(FacesContext facesContext); @Override boolean isResourceRequest(FacesContext facesContext); @Override boolean libraryExists(String libraryName); void setResourceHandlerSupport(ResourceHandlerSupport resourceHandlerSupport); @Override Resource createResourceFromId(String resourceId); @Override Resource createViewResource(FacesContext facesContext, String resourceName); @Override Stream<String> getViewResources(FacesContext facesContext, 
            String path, int maxDepth, ResourceVisitOption... options); @Override boolean isResourceRendered(FacesContext facesContext, String resourceName, String libraryName); @Override void markResourceRendered(FacesContext facesContext, String resourceName, String libraryName); static final Pattern LIBRARY_VERSION_CHECKER; static final Pattern RESOURCE_VERSION_CHECKER; final static String RENDERED_RESOURCES_SET; }### Answer:
@Test public void testCreateResource_ResourceNotNull() throws Exception { Resource resource = resourceHandler.createResource("testResource.xhtml"); Assert.assertNotNull(resource); }
@Test public void testCreateResource_cacheHonorsLocale() throws Exception { application.setMessageBundle("org/apache/myfaces/application/resourcehandler/messages"); application.setDefaultLocale(Locale.ENGLISH); Resource resourceEn = resourceHandler.createResource("testResource.xhtml"); URL urlEn = resourceEn.getURL(); application.setDefaultLocale(Locale.GERMAN); Resource resourceDe = resourceHandler.createResource("testResource.xhtml"); URL urlDe = resourceDe.getURL(); Assert.assertFalse("Resources must be different", urlEn.equals(urlDe)); }
@Test public void testCreateResourceNullResourceName() throws Exception { boolean didNPEOccur = false; try { resourceHandler.createResource(null); } catch (NullPointerException e) { didNPEOccur = true; } Assert.assertTrue(didNPEOccur); }