### Question:
AddBundleOverridesStage implements TransformStage { public void execute(TransformContext context) throws PluginTransformationException { Element pluginInfo = context.getDescriptorDocument().getRootElement().element("plugin-info"); if (pluginInfo != null) { Element instructionRoot = pluginInfo.element("bundle-instructions"); if (instructionRoot != null) { List<Element> instructionsElement = instructionRoot.elements(); for (Element instructionElement : instructionsElement) { String name = instructionElement.getName(); String value = instructionElement.getTextTrim(); context.getBndInstructions().put(name, value); } } } }  void execute(TransformContext context);  }### Answer:
@Test public void testTransform() throws Exception { final File plugin = new PluginJarBuilder("plugin").addFormattedResource("maera-plugin.xml", "<maera-plugin name='Test Bundle instruction plugin 2' key='test.plugin'>", " <plugin-info>", " <version>1.0</version>", " <bundle-instructions>", " <Export-Package>!*.internal.*,*</Export-Package>", " </bundle-instructions>", " </plugin-info>", "</maera-plugin>").build(); final AddBundleOverridesStage stage = new AddBundleOverridesStage(); OsgiContainerManager osgiContainerManager = mock(OsgiContainerManager.class); when(osgiContainerManager.getRegisteredServices()).thenReturn(new ServiceReference[0]); final TransformContext context = new TransformContext(Collections.<HostComponentRegistration>emptyList(), SystemExports.NONE, new JarPluginArtifact(plugin), null, PluginAccessor.Descriptor.FILENAME, osgiContainerManager); stage.execute(context); assertEquals("!*.internal.*,*", context.getBndInstructions().get("Export-Package")); }