### Question:
JarMerger implements Closeable { public void addJar(@NonNull Path file) throws IOException { addJar(file, filter, null); } JarMerger(@NonNull Path jarFile);  JarMerger(@NonNull Path jarFile, @Nullable Predicate<String> filter); void addDirectory(@NonNull Path directory); void addDirectory(
            @NonNull Path directory,
            @Nullable Predicate<String> filterOverride,
            @Nullable Transformer transformer,
            @Nullable Relocator relocator); void addJar(@NonNull Path file); void addJar(
            @NonNull Path file,
            @Nullable Predicate<String> filterOverride,
            @Nullable Relocator relocator); void addFile(@NonNull String entryPath, @NonNull Path file); void addEntry(@NonNull String entryPath, @NonNull InputStream input); @Override void close(); void setManifestProperties(Map<String, String> properties); static final Predicate<String> CLASSES_ONLY; static final Predicate<String> EXCLUDE_CLASSES; static final String MODULE_PATH; static final FileTime ZERO_TIME; }### Answer:
@Test public void basicJar() throws Exception { Path out = Jimfs.newFileSystem(Configuration.unix()).getPath("/out/output.jar"); Path dir = createJarWithClass(); try (JarMerger merger = new JarMerger(out)) { merger.addJar(dir); } assertThat(getEntries(out)) .containsExactly("com/example/lib/LibClass.class", LIBCLASS_CONTENT); }