### Question:
BundleJarUtil { public static void createJar(File input, File output) throws IOException { try (JarOutputStream jarOut = new JarOutputStream(new FileOutputStream(output))) { addToArchive(input, jarOut); } } private  BundleJarUtil(); @Nullable static Manifest getManifest(Location jarLocation); @Nullable static Manifest getManifest(URL url); @Nullable static Manifest getManifest(File file); static void createJar(File input, File output); static void addToArchive(File input, ZipOutputStream output); static void addToArchive(final File input, final boolean includeDirName,
                                  final ZipOutputStream output); static File unJar(Location jarLocation, File destinationFolder); static File unJar(File jarFile, File destinationFolder);  }### Answer:
@Test public void testRecursive() throws IOException { File dir = TEMP_FOLDER.newFolder(); File subDir = new File(dir, "subdir"); subDir.mkdirs(); String message = Strings.repeat("0123456789", 40); File file1 = new File(subDir, "file1"); Files.write(message, file1, Charsets.UTF_8); final File target = new File(TEMP_FOLDER.newFolder(), "target.jar"); BundleJarUtil.createJar(dir, target); JarFile jarFile = new JarFile(target); Assert.assertTrue(jarFile.getJarEntry("subdir/").isDirectory()); JarEntry jarEntry = jarFile.getJarEntry("subdir/file1"); Assert.assertNotNull(jarEntry); try (Reader reader = new InputStreamReader(jarFile.getInputStream(jarEntry), Charsets.UTF_8)) { Assert.assertEquals(message, CharStreams.toString(reader)); } }