### Question:
JarFilter { JarFilter(final Collection<URI> listUris, final String jarPath) throws URISyntaxException, IOException { this.listUris = listUris; applicationJar = jarPath; final Path p = new Path(jarPath); if (p.isAbsolute()) { applicationJar = HadoopUriFinder.getFixedUri(p.toUri()).toString(); } } JarFilter(final Collection<URI> listUris, final String jarPath);   }### Answer:
@Test public void testJarFilter() throws URISyntaxException, IOException, OozieActionConfiguratorException { LinkedList<URI> listUris = new LinkedList<URI>(); String sparkVersion = "2.1.0"; String sparkYarnJar = "spark-yarn-" + sparkVersion + ".jar"; String applicationJarName = "oozie-examples.jar"; String renamedApplicationJar = "renamed-oozie-examples.jar"; URI sparkYarnJarUri = new URI("hdfs: URI applicationJarUri = new URI("hdfs: createSparkYarnJar(sparkYarnJar, sparkVersion); populateUris(listUris, sparkYarnJarUri, applicationJarUri); JarFilter jarFilter = new JarFilter(listUris, applicationJarUri.getPath()); jarFilter.filter(); assertEquals(applicationJarUri.toString(), jarFilter.getApplicationJar()); assertEquals(sparkYarnJarUri.toString(), jarFilter.getSparkYarnJar()); assertEquals(sparkVersion, jarFilter.getSparkVersion()); checkFilteredUris(listUris, sparkYarnJarUri.toString(), applicationJarUri.toString()); listUris.clear(); applicationJarUri = new URI("hdfs", "localhost", "/user/sparkdata/" + applicationJarName, renamedApplicationJar); populateUris(listUris, sparkYarnJarUri, applicationJarUri); jarFilter = new JarFilter(listUris, applicationJarUri.getPath()); jarFilter.filter(); assertEquals(renamedApplicationJar, jarFilter.getApplicationJar()); assertEquals(sparkYarnJarUri.toString(), jarFilter.getSparkYarnJar()); assertEquals(sparkVersion, jarFilter.getSparkVersion()); checkFilteredUris(listUris, sparkYarnJarUri.toString(), renamedApplicationJar); listUris.clear(); populateUris(listUris, sparkYarnJarUri, applicationJarUri); jarFilter = new JarFilter(listUris, renamedApplicationJar); jarFilter.filter(); assertEquals(renamedApplicationJar, jarFilter.getApplicationJar()); assertEquals(sparkYarnJarUri.toString(), jarFilter.getSparkYarnJar()); assertEquals(sparkVersion, jarFilter.getSparkVersion()); checkFilteredUris(listUris, sparkYarnJarUri.toString(), renamedApplicationJar); Files.deleteIfExists(new File(sparkYarnJar).toPath()); }