private static List<@NlsSafe String> getTargetNamesFromPaths(TreePath[] paths) {
    if (paths == null || paths.length == 0) {
      return Collections.emptyList();
    }
    final List<String> targets = new ArrayList<>();
    for (final TreePath path : paths) {
      final Object userObject = ((DefaultMutableTreeNode)path.getLastPathComponent()).getUserObject();
      if (!(userObject instanceof AntTargetNodeDescriptor)) {
        continue;
      }
      final AntBuildTarget target = ((AntTargetNodeDescriptor)userObject).getTarget();
      if (target instanceof MetaTarget) {
        targets.addAll(target.getTargetNames());
      }
      else {
        targets.add(target.getName());
      }
    }
    return targets;
  }
private static List<@NlsSafe String> getTargetNamesFromPaths(TreePath[] paths)