### Question:
ResourceConfigGenerator { public static String generateResourceConfig(CommandSpec[] specs, String[] bundles, String[] resourceRegex) { Visitor visitor = new Visitor(); visitor.bundles.addAll(Arrays.asList(bundles)); visitor.resources.addAll(Arrays.asList(resourceRegex)); for (CommandSpec spec : specs) { visitor.visitCommandSpec(spec); } return visitor.toString(); }  static void main(String... args); static String generateResourceConfig(CommandSpec[] specs, String[] bundles, String[] resourceRegex);  }### Answer:
@Test public void testMultipleBundlesAndResources() { String[] bundles = { "com.example.extra.bundle1", "com.example.extra.bundle2", }; String[] resources = { "ABCD", ".*\\.json", }; String actual = ResourceConfigGenerator.generateResourceConfig(new CommandSpec[0], bundles, resources); String expected = String.format("" + "{%n" + " \"bundles\" : [%n" + " {\"name\" : \"com.example.extra.bundle1\"},%n" + " {\"name\" : \"com.example.extra.bundle2\"}%n" + " ],%n" + " \"resources\" : [%n" + " {\"pattern\" : \"ABCD\"},%n" + " {\"pattern\" : \".*\\.json\"}%n" + " ]%n" + "}%n"); assertEquals(expected, actual); }