@Override
  public ExplodedPlugin explode(PluginInfo pluginInfo) {
    File tempDir = new File(fs.getTempDir(), TEMP_RELATIVE_PATH);
    File toDir = new File(tempDir, pluginInfo.getKey());
    try {
      org.sonar.core.util.FileUtils.cleanDirectory(toDir);

      File jarSource = pluginInfo.getNonNullJarFile();
      File jarTarget = new File(toDir, jarSource.getName());
      FileUtils.copyFile(jarSource, jarTarget);
      ZipUtils.unzip(jarSource, toDir, newLibFilter());
      return explodeFromUnzippedDir(pluginInfo, jarTarget, toDir);
    } catch (Exception e) {
      throw new IllegalStateException(String.format(
        "Fail to unzip plugin [%s] %s to %s", pluginInfo.getKey(), pluginInfo.getNonNullJarFile().getAbsolutePath(), toDir.getAbsolutePath()), e);
    }
  }
@Test
  public void plugins_do_not_overlap() {
    PluginInfo info1 = PluginInfo.create(plugin1Jar());
    PluginInfo info2 = PluginInfo.create(plugin2Jar());

    ExplodedPlugin exploded1 = underTest.explode(info1);
    ExplodedPlugin exploded2 = underTest.explode(info2);

    assertThat(exploded1.getKey()).isEqualTo("test");
    assertThat(exploded1.getMain()).isFile().exists().hasName("sonar-test-plugin-0.1-SNAPSHOT.jar");
    assertThat(exploded2.getKey()).isEqualTo("test2");
    assertThat(exploded2.getMain()).isFile().exists().hasName("sonar-test2-plugin-0.1-SNAPSHOT.jar");
  }