### Question:
TextExtensionFragmentParser { public List<Extension> getExtensions(final URL url) { try (InputStream is = url.openStream()) { return getExtensions(is); } catch (Exception e) { LOG.log(Level.WARNING, e.getMessage(), e); return new ArrayList<>(); } } TextExtensionFragmentParser(ClassLoader loader); List<Extension> getExtensions(final URL url); List<Extension> getExtensions(InputStream is);  }### Answer:
@Test public void testGetExtensions() throws IOException { InputStream is = TextExtensionFragmentParserTest.class.getResourceAsStream("extension2.txt"); List<Extension> extensions = new TextExtensionFragmentParser(null).getExtensions(is); assertEquals("Unexpected number of Extension elements.", 3, extensions.size()); Extension e = extensions.get(0); assertFalse("Extension is deferred.", e.isDeferred()); assertEquals("Unexpected class name.", "org.apache.cxf.foo.FooImpl", e.getClassname()); assertEquals("Unexpected number of namespace elements.", 0, e.getNamespaces().size()); e = extensions.get(1); assertTrue("Extension is not deferred.", e.isDeferred()); assertEquals("Unexpected implementation class name.", "java.lang.Boolean", e.getClassname()); assertNull("Interface should be null", e.getInterfaceName()); assertEquals("Unexpected number of namespace elements.", 0, e.getNamespaces().size()); }