@Test
public void testAggregateResourceBundlesInstructionMultiple()
	throws Exception {

	ResourceBundleLoaderAnalyzerPlugin resourceBundleLoaderAnalyzerPlugin =
		new ResourceBundleLoaderAnalyzerPlugin();
	InputStream inputStream =
		ResourceBundleLoaderAnalyzerPluginTest.class.getResourceAsStream(
			"dependencies/resources.test1.jar");
	try (Jar jar = new Jar("dot", inputStream);
		Analyzer analyzer = new Analyzer()) {
		analyzer.setBundleSymbolicName("resources.test");
		analyzer.setJar(jar);
		analyzer.setProperty(
			"-liferay-aggregate-resource-bundles",
			"resources.lang1,resources.lang2,resources.lang3");
		Assert.assertTrue(
			resourceBundleLoaderAnalyzerPlugin.analyzeJar(analyzer));
		Parameters requireCapabilityHeaders = new Parameters(
			analyzer.getProperty(Constants.REQUIRE_CAPABILITY));
		Collection<Attrs> requires = requireCapabilityHeaders.values();
		Assert.assertEquals(requires.toString(), 3, requires.size());
		String provideCapabilityProperty = analyzer.getProperty(
			Constants.PROVIDE_CAPABILITY);
		Assert.assertFalse(
			provideCapabilityProperty.contains("service.ranking:"));
		Parameters provideCapabilityHeaders = new Parameters(
			provideCapabilityProperty);
		List<Map.Entry<String, Attrs>> provides = new ArrayList<>(
			provideCapabilityHeaders.entrySet());
		Assert.assertEquals(provides.toString(), 2, provides.size());
		Map.Entry<String, Attrs> aggregateEntry = provides.get(0);
		Assert.assertEquals(
			ResourceBundleLoaderAnalyzerPlugin.LIFERAY_RESOURCE_BUNDLE,
			aggregateEntry.getKey());
		Attrs aggregateEntryAttrs = aggregateEntry.getValue();
		Assert.assertEquals(6, aggregateEntryAttrs.size());
		Assert.assertEquals("true", aggregateEntryAttrs.get("aggregate"));
		StringBuilder sb = new StringBuilder();
		sb.append(
			"(&(bundle.symbolic.name=resources.test)(!(aggregate=true))),");
		sb.append("(bundle.symbolic.name=resources.lang1),");
		sb.append("(bundle.symbolic.name=resources.lang2),");
		sb.append("(bundle.symbolic.name=resources.lang3)");
		Assert.assertEquals(
			sb.toString(),
			aggregateEntryAttrs.get("resource.bundle.aggregate"));
		Assert.assertEquals(
			"resources.test",
			aggregateEntryAttrs.get("bundle.symbolic.name"));
		Assert.assertEquals(
			"content.Language",
			aggregateEntryAttrs.get("resource.bundle.base.name"));
		Assert.assertEquals(
			"resources.test",
			aggregateEntryAttrs.get("servlet.context.name"));
		Map.Entry<String, Attrs> liferayResourceBundleEntry = provides.get(
			1);
		Assert.assertEquals(
			ResourceBundleLoaderAnalyzerPlugin.LIFERAY_RESOURCE_BUNDLE +
				"~",
			liferayResourceBundleEntry.getKey());
		Attrs liferayResourceBundleAttrs =
			liferayResourceBundleEntry.getValue();
		Assert.assertEquals(2, liferayResourceBundleAttrs.size());
		Assert.assertEquals(
			"resources.test",
			liferayResourceBundleAttrs.get("bundle.symbolic.name"));
		Assert.assertEquals(
			"content.Language",
			liferayResourceBundleAttrs.get("resource.bundle.base.name"));
	}
}