### Question:
DefaultPluginTransformer implements PluginTransformer { public File transform(File pluginJar, List<HostComponentRegistration> regs) throws PluginTransformationException { return transform(new JarPluginArtifact(pluginJar), regs); } DefaultPluginTransformer(OsgiPersistentCache cache, SystemExports systemExports, Set<String> applicationKeys, String pluginDescriptorPath,
                                    OsgiContainerManager osgiContainerManager);  DefaultPluginTransformer(OsgiPersistentCache cache, SystemExports systemExports, Set<String> applicationKeys, String pluginDescriptorPath,
                                    OsgiContainerManager osgiContainerManager, List<TransformStage> stages); File transform(File pluginJar, List<HostComponentRegistration> regs); File transform(PluginArtifact pluginArtifact, List<HostComponentRegistration> regs);  }### Answer:
@Test public void testTransform() throws Exception { final File file = new PluginJarBuilder() .addFormattedJava("my.Foo", "package my;", "public class Foo {", " org.maera.plugin.osgi.factory.transform.Fooable bar;", "}") .addPluginInformation("foo", "foo", "1.1") .build(); final File copy = transformer.transform(new JarPluginArtifact(file), new ArrayList<HostComponentRegistration>() { { add(new StubHostComponentRegistration(Fooable.class)); } }); assertNotNull(copy); assertTrue(copy.getName().contains(String.valueOf(file.lastModified()))); assertTrue(copy.getName().endsWith(".jar")); assertEquals(tmpDir.getAbsolutePath(), copy.getParentFile().getParentFile().getAbsolutePath()); final JarFile jar = new JarFile(copy); final Attributes attrs = jar.getManifest().getMainAttributes(); assertEquals("1.1", attrs.getValue(Constants.BUNDLE_VERSION)); assertNotNull(jar.getEntry("META-INF/spring/maera-plugins-host-components.xml")); }