### Question:
ResourceFactoryRegistryImpl implements ResourceFactoryRegistry { @Override public Resource createResource(ResourceProperties properties) { for (ResourceFactory factory : factories) { if (factory.accepts(properties)) { return factory.create(properties); } } throw new UnsupportedResourcePropertiesException(); } ResourceFactoryRegistryImpl(); static ResourceFactoryRegistry getDefaultInstance(); @Override void addFactory(ResourceFactory factory); @Override void clearFactories(); @Override Collection<ResourceFactory> getFactories(); @Override Resource createResource(ResourceProperties properties); void discoverFromClasspath();  }### Answer:
@Test public void testGetQualifiedFileResource() throws Exception { final File file = new File("src/test/resources/unicode-text-utf8.txt"); final Resource res = registry.createResource(new SimpleResourceProperties("file: .replace('\\', '/'))); assertTrue(res.isExists()); assertEquals("unicode-text-utf8.txt", res.getName()); }
@Test public void testGetUnqualifiedRelativeFileResource() throws Exception { final Resource res = registry.createResource(new SimpleResourceProperties( "src/test/resources/unicode-text-utf8.txt")); assertTrue(res.isExists()); assertEquals("unicode-text-utf8.txt", res.getName()); }
@Test public void testGetInMemoryResource() throws Exception { final Resource res = registry.createResource(new SimpleResourceProperties("mem: assertTrue(res instanceof InMemoryResource); }
@Test public void testGetClasspathResource() throws Exception { final Resource res = registry.createResource(new SimpleResourceProperties("classpath: assertTrue(res.isExists()); assertTrue(res instanceof ClasspathResource); }
@Test public void testGetUrlResource() throws Exception { final Resource res = registry.createResource(new SimpleResourceProperties( "http: assertTrue(res.isExists()); assertTrue(res instanceof UrlResource); }