DependencySetupErrors { public void addMissingModule(@NotNull String dependencyName, @NotNull String dependentName, @Nullable String backupLibraryName) { Map<String, MissingModule> mapping = isNotEmpty(backupLibraryName) ? myMissingModulesWithBackupLibraries : myMissingModules; MissingModule missingModule = mapping.get(dependencyName); if (missingModule == null) { missingModule = new MissingModule(dependencyName, backupLibraryName); mapping.put(dependencyName, missingModule); } missingModule.addDependent(dependentName); }  void addMissingModule(@NotNull String dependencyName, @NotNull String dependentName, @Nullable String backupLibraryName); void addMissingName(@NotNull String dependentName); void addMissingBinaryPath(@NotNull String dependentName); @NotNull List<MissingModule> getMissingModules(); @NotNull List<MissingModule> getMissingModulesWithBackupLibraries(); @NotNull List<String> getMissingNames(); @NotNull List<String> getDependentsOnLibrariesWithoutBinaryPath();  }
@Test public void testAddMissingModule() { myErrors.addMissingModule(":lib2", "app2", "library2.jar"); myErrors.addMissingModule(":lib2", "app1", "library2.jar"); myErrors.addMissingModule(":lib3", "app1", "library3.jar"); myErrors.addMissingModule(":lib1", "app1", null); List<DependencySetupErrors.MissingModule> missingModules = myErrors.getMissingModules(); assertThat(missingModules).hasSize(1); DependencySetupErrors.MissingModule missingModule = missingModules.get(0); assertThat(missingModule.dependencyPath).isEqualTo(":lib1"); assertThat(missingModule.dependentNames).containsSequence("app1"); missingModules = myErrors.getMissingModulesWithBackupLibraries(); assertThat(missingModules).hasSize(2); missingModule = missingModules.get(0); assertThat(missingModule.dependencyPath).isEqualTo(":lib2"); assertThat(missingModule.dependentNames).containsSequence("app1", "app2"); missingModule = missingModules.get(1); assertThat(missingModule.dependencyPath).isEqualTo(":lib3"); assertThat(missingModule.dependentNames).containsSequence("app1"); }