private List<Module> collectDependencies() {
    List<Module> result = new ArrayList<>();
    for (int i = 0; i < myDependenciesList.getItemsCount(); i++) {
      Module module = myDependenciesList.getItemAt(i);
      if (myDependenciesList.isItemSelected(module)) {
        result.add(module);
      }
    }
    return result;
  }
private List<Module> collectDependencies()