test_class.declarator: testOutBaseDir = new File("target/test-out/OpearPackageMojoTest")
test_class.modifier: private final
test_class.original_string: private final File testOutBaseDir = new File("target/test-out/OpearPackageMojoTest");
test_class.type: File
test_class.var_name: testOutBaseDir
test_class.declarator: srcDir = new File("src/test/resources/OpearPackageMojoTest")
test_class.modifier: private final
test_class.original_string: private final File srcDir = new File("src/test/resources/OpearPackageMojoTest");
test_class.type: File
test_class.var_name: srcDir
test_class.file: maven/src/test/java/net/adamcin/oakpal/maven/mojo/OpearPackageMojoTest.java
test_class.identifier: OpearPackageMojoTest
test_case.body: @Test
      public void testShrinkWrapPlans_nodefault() throws Exception {
          final File testOutDir = new File(testOutBaseDir, "testShrinkWrapPlans_nodefault");
          FileUtils.deleteDirectory(testOutDir);
          testOutDir.mkdirs();
          final File copyTarget = new File(testOutDir, "copied");
          copyTarget.mkdirs();
  
          final String preInstallFilename = "tmp_foo_bar.zip";
          final File preInstallPackage = TestPackageUtil.prepareTestPackage(preInstallFilename);
  
          final OpearPackageMojo mojo = newMojo();
          final MavenProject project = mock(MavenProject.class);
          mojo.project = project;
  
          final String expectFilename = "sample-plan.json";
          final File samplePlanFile = new File(srcDir, expectFilename);
          mojo.planFile = new File(testOutDir, "no-plan.json");
          final int addPlans = 10;
          for (int i = 0; i < addPlans; i++) {
              mojo.additionalPlans.add(samplePlanFile);
          }
  
          List<String> expectedPlanNames = new ArrayList<>();
          expectedPlanNames.add(expectFilename);
          for (int i = 1; i < addPlans; i++) {
              expectedPlanNames.add("sample-plan_" + i + ".json");
          }
  
          Result<List<String>> planNamesResult = mojo.shrinkWrapPlans(copyTarget);
          assertTrue("is success: " + planNamesResult, planNamesResult.isSuccess());
          assertEquals("expect plan names",
                  expectedPlanNames,
                  planNamesResult.getOrDefault(Collections.emptyList()));
          assertTrue("preinstall is file", new File(copyTarget, preInstallFilename).isFile());
      }
test_case.class_method_signature: OpearPackageMojoTest.testShrinkWrapPlans_nodefault()
test_case.full_signature: @Test public void testShrinkWrapPlans_nodefault()
test_case.identifier: testShrinkWrapPlans_nodefault
test_case.invocations: deleteDirectory mkdirs mkdirs prepareTestPackage newMojo mock add add add shrinkWrapPlans assertTrue isSuccess assertEquals getOrDefault emptyList assertTrue isFile
test_case.modifiers: @Test public
test_case.parameters: ()
test_case.return: void
test_case.signature: void testShrinkWrapPlans_nodefault()
focal_class.declarator: OPEAR = "opear"
focal_class.modifier: public static final
focal_class.original_string: public static final String OPEAR = "opear";
focal_class.type: String
focal_class.var_name: OPEAR
focal_class.declarator: OAKPAL_GROUP_ID = "net.adamcin.oakpal"
focal_class.modifier: static final
focal_class.original_string: static final String OAKPAL_GROUP_ID = "net.adamcin.oakpal";
focal_class.type: String
focal_class.var_name: OAKPAL_GROUP_ID
focal_class.declarator: OAKPAL_API_ARTIFACT_ID = "oakpal-api"
focal_class.modifier: static final
focal_class.original_string: static final String OAKPAL_API_ARTIFACT_ID = "oakpal-api";
focal_class.type: String
focal_class.var_name: OAKPAL_API_ARTIFACT_ID
focal_class.declarator: OAKPAL_CORE_ARTIFACT_ID = "oakpal-core"
focal_class.modifier: static final
focal_class.original_string: static final String OAKPAL_CORE_ARTIFACT_ID = "oakpal-core";
focal_class.type: String
focal_class.var_name: OAKPAL_CORE_ARTIFACT_ID
focal_class.declarator: TEST_IS_OAKPAL_API =
              composeTest1(Artifact::getGroupId, OAKPAL_GROUP_ID::equals)
                      .and(composeTest1(Artifact::getArtifactId, OAKPAL_API_ARTIFACT_ID::equals))
focal_class.modifier: private static final
focal_class.original_string: private static final Predicate<Artifact> TEST_IS_OAKPAL_API =
              composeTest1(Artifact::getGroupId, OAKPAL_GROUP_ID::equals)
                      .and(composeTest1(Artifact::getArtifactId, OAKPAL_API_ARTIFACT_ID::equals));
focal_class.type: Predicate<Artifact>
focal_class.var_name: TEST_IS_OAKPAL_API
focal_class.declarator: TEST_IS_OAKPAL_CORE =
              composeTest1(Artifact::getGroupId, OAKPAL_GROUP_ID::equals)
                      .and(composeTest1(Artifact::getArtifactId, OAKPAL_CORE_ARTIFACT_ID::equals))
focal_class.modifier: private static final
focal_class.original_string: private static final Predicate<Artifact> TEST_IS_OAKPAL_CORE =
              composeTest1(Artifact::getGroupId, OAKPAL_GROUP_ID::equals)
                      .and(composeTest1(Artifact::getArtifactId, OAKPAL_CORE_ARTIFACT_ID::equals));
focal_class.type: Predicate<Artifact>
focal_class.var_name: TEST_IS_OAKPAL_CORE
focal_class.declarator: artifactHandlerManager
focal_class.modifier: @Component
focal_class.original_string: @Component
      ArtifactHandlerManager artifactHandlerManager;
focal_class.type: ArtifactHandlerManager
focal_class.var_name: artifactHandlerManager
focal_class.declarator: finalName
focal_class.modifier: @Parameter(defaultValue = "${project.build.finalName}", required = true)
focal_class.original_string: @Parameter(defaultValue = "${project.build.finalName}", required = true)
      String finalName;
focal_class.type: String
focal_class.var_name: finalName
focal_class.declarator: planFile
focal_class.modifier: @Parameter(defaultValue = "${project.build.directory}/oakpal-plugin/opear-plans/plan.json", required = true)
focal_class.original_string: @Parameter(defaultValue = "${project.build.directory}/oakpal-plugin/opear-plans/plan.json", required = true)
      File planFile;
focal_class.type: File
focal_class.var_name: planFile
focal_class.declarator: additionalPlans = new ArrayList<>()
focal_class.modifier: @Parameter
focal_class.original_string: @Parameter
      List<File> additionalPlans = new ArrayList<>();
focal_class.type: List<File>
focal_class.var_name: additionalPlans
focal_class.declarator: outputDirectory
focal_class.modifier: @Parameter(defaultValue = "${project.build.directory}", required = true)
focal_class.original_string: @Parameter(defaultValue = "${project.build.directory}", required = true)
      File outputDirectory;
focal_class.type: File
focal_class.var_name: outputDirectory
focal_class.file: maven/src/main/java/net/adamcin/oakpal/maven/mojo/OpearPackageMojo.java
focal_class.identifier: OpearPackageMojo
focal_class.class_method_signature: OpearPackageMojo.execute()
focal_class.full_signature: @Override public void execute()
focal_class.identifier: execute
focal_class.modifiers: @Override public
focal_class.parameters: ()
focal_class.return: void
focal_class.signature: void execute()
focal_class.class_method_signature: OpearPackageMojo.attachArtifact(final @NotNull File finalFile)
focal_class.full_signature:  Artifact attachArtifact(final @NotNull File finalFile)
focal_class.identifier: attachArtifact
focal_class.parameters: (final @NotNull File finalFile)
focal_class.return: Artifact
focal_class.signature: Artifact attachArtifact(final @NotNull File finalFile)
focal_class.class_method_signature: OpearPackageMojo.getOwnVersion()
focal_class.full_signature:  String getOwnVersion()
focal_class.identifier: getOwnVersion
focal_class.parameters: ()
focal_class.return: String
focal_class.signature: String getOwnVersion()
focal_class.class_method_signature: OpearPackageMojo.getBundleSymbolicName()
focal_class.full_signature:  String getBundleSymbolicName()
focal_class.identifier: getBundleSymbolicName
focal_class.parameters: ()
focal_class.return: String
focal_class.signature: String getBundleSymbolicName()
focal_class.class_method_signature: OpearPackageMojo.getOakpalCoreVersion()
focal_class.full_signature:  String getOakpalCoreVersion()
focal_class.identifier: getOakpalCoreVersion
focal_class.parameters: ()
focal_class.return: String
focal_class.signature: String getOakpalCoreVersion()
focal_class.class_method_signature: OpearPackageMojo.getEmbeddedLibraries()
focal_class.full_signature:  List<File> getEmbeddedLibraries()
focal_class.identifier: getEmbeddedLibraries
focal_class.parameters: ()
focal_class.return: List<File>
focal_class.signature: List<File> getEmbeddedLibraries()
focal_class.class_method_signature: OpearPackageMojo.assembleOpear()
focal_class.full_signature:  File assembleOpear()
focal_class.identifier: assembleOpear
focal_class.parameters: ()
focal_class.return: File
focal_class.signature: File assembleOpear()
focal_class.class_method_signature: OpearPackageMojo.mapDestFileNames(final @NotNull Map<String, T> acc,
                                                 final @NotNull List<T> files,
                                                 final @NotNull Function<T, String> namer)
focal_class.full_signature: static Map<String, T> mapDestFileNames(final @NotNull Map<String, T> acc,
                                                 final @NotNull List<T> files,
                                                 final @NotNull Function<T, String> namer)
focal_class.identifier: mapDestFileNames
focal_class.modifiers: static
focal_class.parameters: (final @NotNull Map<String, T> acc,
                                                 final @NotNull List<T> files,
                                                 final @NotNull Function<T, String> namer)
focal_class.return: Map<String, T>
focal_class.signature: Map<String, T> mapDestFileNames(final @NotNull Map<String, T> acc,
                                                 final @NotNull List<T> files,
                                                 final @NotNull Function<T, String> namer)
focal_class.class_method_signature: OpearPackageMojo.shrinkWrapPlans(final @NotNull File toDir)
focal_class.full_signature:  Result<List<String>> shrinkWrapPlans(final @NotNull File toDir)
focal_class.identifier: shrinkWrapPlans
focal_class.parameters: (final @NotNull File toDir)
focal_class.return: Result<List<String>>
focal_class.signature: Result<List<String>> shrinkWrapPlans(final @NotNull File toDir)
focal_class.class_method_signature: OpearPackageMojo.rewritePlan(final @NotNull File toDir,
                                    final @NotNull Map<URL, String> renamed,
                                    final @NotNull OakpalPlan plan,
                                    final @NotNull String filename)
focal_class.full_signature: static OakpalPlan rewritePlan(final @NotNull File toDir,
                                    final @NotNull Map<URL, String> renamed,
                                    final @NotNull OakpalPlan plan,
                                    final @NotNull String filename)
focal_class.identifier: rewritePlan
focal_class.modifiers: static
focal_class.parameters: (final @NotNull File toDir,
                                    final @NotNull Map<URL, String> renamed,
                                    final @NotNull OakpalPlan plan,
                                    final @NotNull String filename)
focal_class.return: OakpalPlan
focal_class.signature: OakpalPlan rewritePlan(final @NotNull File toDir,
                                    final @NotNull Map<URL, String> renamed,
                                    final @NotNull OakpalPlan plan,
                                    final @NotNull String filename)
focal_class.class_method_signature: OpearPackageMojo.copyPlans(final @NotNull File toDir, final @NotNull List<OakpalPlan> plans)
focal_class.full_signature: static Result<Map<String, OakpalPlan>> copyPlans(final @NotNull File toDir, final @NotNull List<OakpalPlan> plans)
focal_class.identifier: copyPlans
focal_class.modifiers: static
focal_class.parameters: (final @NotNull File toDir, final @NotNull List<OakpalPlan> plans)
focal_class.return: Result<Map<String, OakpalPlan>>
focal_class.signature: Result<Map<String, OakpalPlan>> copyPlans(final @NotNull File toDir, final @NotNull List<OakpalPlan> plans)
focal_class.class_method_signature: OpearPackageMojo.copyUrlStreams(final @NotNull File toDir,
                                                     final @NotNull List<URL> urls)
focal_class.full_signature: static Result<Map<URL, String>> copyUrlStreams(final @NotNull File toDir,
                                                     final @NotNull List<URL> urls)
focal_class.identifier: copyUrlStreams
focal_class.modifiers: static
focal_class.parameters: (final @NotNull File toDir,
                                                     final @NotNull List<URL> urls)
focal_class.return: Result<Map<URL, String>>
focal_class.signature: Result<Map<URL, String>> copyUrlStreams(final @NotNull File toDir,
                                                     final @NotNull List<URL> urls)
focal_class.superclass: extends AbstractCommonMojo
focal_method.body: Result<List<String>> shrinkWrapPlans(final @NotNull File toDir) {
          final Result<List<OakpalPlan>> initialResult =
                  !(planFile != null && planFile.isFile())
                          ? Result.success(new ArrayList<>())
                          : Result.success(planFile)
                          .flatMap(compose1(File::toURI, result1(URI::toURL)))
                          .flatMap(OakpalPlan::fromJson)
                          .map(compose1(Collections::singletonList, ArrayList::new));
  
          final Result<List<OakpalPlan>> addedResult = initialResult.flatMap(plans ->
                  additionalPlans.stream()
                          .map(compose1(File::toURI, result1(URI::toURL)))
                          .collect(Result.tryCollect(Collectors.toList()))
                          .flatMap(planUrls -> planUrls.stream()
                                  .map(OakpalPlan::fromJson)
                                  .collect(Result.logAndRestream())
                                  .collect(Result.tryCollect(Collectors.toList()))));
  
  
          final Result<List<OakpalPlan>> allPlansResult = initialResult.flatMap(initial ->
                  addedResult.map(added -> {
                      initial.addAll(added);
                      return initial;
                  }));
  
          final Result<Map<URL, String>> renamedResult = allPlansResult
                  .flatMap(plans -> copyUrlStreams(toDir, plans.stream()
                          .flatMap(plan -> Stream.concat(
                                  plan.getPreInstallUrls().stream(),
                                  plan.getRepoInitUrls().stream()))
                          .collect(Collectors.toList())));
          final Result<Map<String, OakpalPlan>> rewrittenResult = renamedResult.flatMap(renamed ->
                  allPlansResult.map(allPlans -> allPlans.stream()
                          .map(plan -> rewritePlan(toDir, renamed, plan, plan.getName()))
                          .collect(Collectors.toList()))
                          .flatMap(allPlans -> copyPlans(toDir, allPlans)));
  
          return rewrittenResult.map(compose1(Map::keySet, ArrayList::new));
      }
focal_method.class_method_signature: OpearPackageMojo.shrinkWrapPlans(final @NotNull File toDir)
focal_method.full_signature:  Result<List<String>> shrinkWrapPlans(final @NotNull File toDir)
focal_method.identifier: shrinkWrapPlans
focal_method.invocations: isFile success map flatMap flatMap success compose1 result1 compose1 flatMap flatMap collect map stream compose1 result1 tryCollect toList collect collect map stream logAndRestream tryCollect toList flatMap map addAll flatMap copyUrlStreams collect flatMap stream concat stream getPreInstallUrls stream getRepoInitUrls toList flatMap flatMap map collect map stream rewritePlan getName toList copyPlans map compose1
focal_method.parameters: (final @NotNull File toDir)
focal_method.return: Result<List<String>>
focal_method.signature: Result<List<String>> shrinkWrapPlans(final @NotNull File toDir)