### Question:
DuplicatedResourcesMerger { @SuppressWarnings("UnstableApiUsage") public AppBundle merge() throws IOException { TimeClock timeClock = new TimeClock(); List<BundleModule> mergedBundleModuleList = new ArrayList<>(); for (Map.Entry<BundleModuleName, BundleModule> moduleEntry : rawAppBundle.getModules().entrySet()) { mergedBundleModuleList.add(mergeBundleModule(moduleEntry.getValue())); } AppBundle mergedAppBundle = AppBundle.buildFromModules( mergedBundleModuleList.stream().collect(toImmutableList()), rawAppBundle.getBundleConfig(), rawAppBundle.getBundleMetadata() ); System.out.println(String.format( "merge duplicated resources done, coast %s\n" + "-----------------------------------------\n" + "Reduce file count: %s\n" + "Reduce file size: %s\n" + "-----------------------------------------", timeClock.getCoast(), mergeDuplicatedTotalCount, getNetFileSizeDescription(mergeDuplicatedTotalSize) )); return mergedAppBundle; } DuplicatedResourcesMerger(Path bundlePath, AppBundle appBundle, Path outputLogLocationDir); @SuppressWarnings("UnstableApiUsage") AppBundle merge(); static final String SUFFIX_FILE_DUPLICATED_LOGGER; }### Answer:
@Test public void test() throws IOException { Path outputDirPath = getTempDirPath(); Path bundlePath = loadResourceFile("demo/demo.aab").toPath(); AppBundle rawAppBundle = new AppBundleAnalyzer(bundlePath).analyze(); DuplicatedResourcesMerger merger = new DuplicatedResourcesMerger(bundlePath, rawAppBundle, outputDirPath); AppBundle appBundle = merger.merge(); assert appBundle != null; }