### Question:
Launcher { public void run(String[] args) throws IOException { opts = getOptions(args); setLogLevel(opts); log.info("Options:\n{}", opts.toString()); RuntimeStats stats = new RuntimeStats(); stats.begin(); vm = vmFactory.build( opts.getInFile(), opts.getOutputAPILevel(), opts.getMaxAddressVisits(), opts.getMaxCallDepth(), opts.getMaxMethodVisits(), opts.getMaxExecutionTime() ); ClassManager classManager = vm.getClassManager(); Map<String, Collection<VirtualMethod>> targetClassNameToMethods = collectTargetClassNameToMethods(classManager, opts); stats.startClasses(targetClassNameToMethods.keySet()); for (Map.Entry<String, Collection<VirtualMethod>> entry : targetClassNameToMethods.entrySet()) { stats.incrementCurrentClassIndex(); String className = entry.getKey(); Collection<VirtualMethod> methods = entry.getValue(); System.out.println("[" + stats.getCurrentClassIndex() + " / " + stats.getTotalClasses() + "] Processing top level class " + className); executeMethods(methods, classManager, stats); } stats.end(); System.out.println("Simplification complete:\n" + stats.getStats()); System.out.println(Optimizer.getTotalOptimizationCounts()); System.out.println("Writing output to " + opts.getOutFile()); classManager.getDexBuilder().writeTo(new FileDataStore(opts.getOutDexFile())); if (opts.isZip()) { Files.copy(opts.getInFile().toPath(), opts.getOutFile().toPath(), StandardCopyOption.REPLACE_EXISTING); updateZip(opts.getOutFile(), opts.getOutDexFile(), "classes.dex"); } } Launcher(VirtualMachineFactory vmFactory); void run(String[] args);  }### Answer:
@Test public void runsWithoutMajorFailureWithSmaliFolder() throws IOException, UnhandledVirtualException { Launcher launcher = new Launcher(new VirtualMachineFactory()); File outFile = File.createTempFile("simplify-test", ".tmp"); launcher.run(new String[] { "src/test/resources/obfuscated-example", "-it", "WhiteNoise", "-o", outFile.getAbsolutePath() }); assertTrue(outFile.exists()); Files.delete(outFile.toPath()); }
@Test public void runsWithoutMajorFailureWithDexFile() throws IOException, UnhandledVirtualException { Launcher launcher = new Launcher(new VirtualMachineFactory()); File outFile = File.createTempFile("simplify-test", ".tmp"); launcher.run(new String[] { "src/test/resources/obfuscated-example.zip", "-it", "WhiteNoise", "-o", outFile.getAbsolutePath() }); assertTrue(outFile.exists()); Files.delete(outFile.toPath()); }