### Question:
BundleClassLoaderDelegator extends ClassLoader { @Override public URL getResource(String name) { URL resource = findResource(name); if (resource == null) { resource = classLoader.getResource(name); } return resource; } BundleClassLoaderDelegator(final Bundle bundle);  BundleClassLoaderDelegator(final Bundle bundle, final ClassLoader delegate); @Override URL getResource(String name);  }### Answer:
@Test public void getResourceFromBundle() throws Exception { final JavaArchive jar = ShrinkWrap.create(JavaArchive.class, "bundle.jar"); jar.addAsResource(folder.newFile("test.properties")); BundleClassLoaderDelegator bcl = new BundleClassLoaderDelegator(new MockBundle(jar), getClass().getClassLoader()); URL resource = bcl.getResource("test.properties"); assertNotNull(resource); }