### Question:
Extension { public Class<?> loadInterface(ClassLoader cl) { if (intf != null || notFound) { return intf; } synchronized (this) { if (intf == null) { intf = tryClass(interfaceName, cl); } } return intf; } Extension();  Extension(Class<?> cls, Class<?> inf);  Extension(Class<?> cls);  Extension(ClassLoader loader);  Extension(Extension ext); void setOptional(boolean b); boolean isOptional(); String getName(); Object getLoadedObject(); Extension cloneNoObject(); String toString(); String getClassname(); void setClassname(String i); String getInterfaceName(); void setInterfaceName(String i); boolean isDeferred(); void setDeferred(boolean d); Collection<String> getNamespaces(); void setArgs(Object[] a); Class<?> getClassObject(ClassLoader cl); Object load(ClassLoader cl, Bus b); Class<?> loadInterface(ClassLoader cl);  }### Answer:
@Test public void testLoadInterface() { Extension e = new Extension(); ClassLoader cl = Thread.currentThread().getContextClassLoader(); e.setInterfaceName("no.such.Extension"); try { e.loadInterface(cl); fail("Failure expected"); } catch (ExtensionException ex) { assertTrue("ExtensionException does not wrap ClassNotFoundException", ex.getCause() instanceof ClassNotFoundException); } e.setInterfaceName(Assert.class.getName()); Class<?> cls = e.loadInterface(cl); assertNotNull(cls); }