@Override
  public Collection<? extends Artifact> findArtifacts(@NotNull VirtualFile sourceFile) {
    final MultiValuesMap<VirtualFile, Artifact> map = getFileToArtifactsMap().getValue();
    if (map.isEmpty()) {
      return Collections.emptyList();
    }

    List<Artifact> result = null;
    VirtualFile file = sourceFile;
    while (file != null) {
      final Collection<Artifact> artifacts = map.get(file);
      if (artifacts != null) {
        if (result == null) {
          result = new SmartList<>();
        }
        result.addAll(artifacts);
      }
      file = file.getParent();
    }
    return result != null ? result : Collections.emptyList();
  }
@Override
  public Collection<? extends Artifact> findArtifacts(@NotNull VirtualFile sourceFile)