### Question:
JarPluginArtifact implements PluginArtifact { public InputStream getResourceAsStream(String fileName) throws PluginParseException { Validate.notNull(fileName, "The file name must not be null"); final JarFile jar; try { jar = new JarFile(jarFile); } catch (IOException e) { throw new PluginParseException("Cannot open JAR file for reading: " + jarFile, e); } ZipEntry entry = jar.getEntry(fileName); if (entry == null) { return null; } InputStream descriptorStream; try { descriptorStream = new BufferedInputStream(jar.getInputStream(entry)) { public void close() throws IOException { super.close(); jar.close(); } }; } catch (IOException e) { throw new PluginParseException("Cannot retrieve " + fileName + " from plugin JAR [" + jarFile + "]", e); } return descriptorStream; } JarPluginArtifact(File jarFile); boolean doesResourceExist(String name); InputStream getResourceAsStream(String fileName); String getName(); @Override String toString(); InputStream getInputStream(); File toFile();  }### Answer:
@Test public void testGetResourceAsStream() throws IOException { File plugin = new PluginJarBuilder() .addResource("foo", "bar") .build(); JarPluginArtifact artifact = new JarPluginArtifact(plugin); assertNotNull(artifact.getResourceAsStream("foo")); assertNull(artifact.getResourceAsStream("bar")); }