### Question:
DelegationClassLoader extends ClassLoader { public void setDelegateClassLoader(ClassLoader delegateClassLoader) { Validate.notNull(delegateClassLoader, "Can't set the delegation target to null"); if (log.isDebugEnabled()) { log.debug("Update class loader delegation from [" + this.delegateClassLoader + "] to [" + delegateClassLoader + "]"); } this.delegateClassLoader = delegateClassLoader; }  void setDelegateClassLoader(ClassLoader delegateClassLoader); Class loadClass(String name); URL getResource(String name); @Override Enumeration<URL> getResources(String name); InputStream getResourceAsStream(String name); synchronized void setDefaultAssertionStatus(boolean enabled); synchronized void setPackageAssertionStatus(String packageName, boolean enabled); synchronized void setClassAssertionStatus(String className, boolean enabled); synchronized void clearAssertionStatus();  }### Answer:
@Test public void testCanSetDelegate() { DelegationClassLoader dcl = new DelegationClassLoader(); dcl.setDelegateClassLoader(getClass().getClassLoader()); }
@Test(expected = IllegalArgumentException.class) public void testCantSetNullDelegate() { DelegationClassLoader dcl = new DelegationClassLoader(); dcl.setDelegateClassLoader(null); }