Program: 130497
Project: 130497
Buggy source:
@NotNull public static PsiElement[] fiterOverridedAndHiddedElements(@NotNull PsiElement scopeElement,@NotNull Collection<PsiElement> elements){
  List<PsiElement> copyElements=new ArrayList<PsiElement>(elements);
  for (  PsiElement element : elements) {
    if (!copyElements.contains(element)) {
      continue;
    }
    if (element instanceof DotNetVirtualImplementOwner) {
      if (element instanceof CSharpMethodDeclaration && ((CSharpMethodDeclaration)element).isDelegate()) {
        continue;
      }
      DotNetType typeForImplement=((DotNetVirtualImplementOwner)element).getTypeForImplement();
      for (      PsiElement tempIterateElement : elements) {
        if (tempIterateElement == element) {
          continue;
        }
        if (CSharpElementCompareUtil.isEqual(tempIterateElement,element,scopeElement)) {
          copyElements.remove(tempIterateElement);
        }
      }
      if (typeForImplement != null) {
        copyElements.remove(element);
      }
    }
  }
  List<PsiElement> groupElements=new SmartList<PsiElement>();
  List<PsiElement> elseElements=new SmartList<PsiElement>();
  for (  PsiElement copyElement : copyElements) {
    if (copyElement instanceof DotNetLikeMethodDeclaration) {
      groupElements.add(copyElement);
    }
 else {
      elseElements.add(copyElement);
    }
  }
  if (elseElements.isEmpty() && groupElements.isEmpty()) {
    return PsiElement.EMPTY_ARRAY;
  }
 else   if (elseElements.isEmpty()) {
    return new PsiElement[]{new CSharpElementGroupImpl<PsiElement>(scopeElement.getProject(),"String_Node_Str",groupElements)};
  }
 else   if (groupElements.isEmpty()) {
    return ContainerUtil.toArray(elseElements,PsiElement.ARRAY_FACTORY);
  }
 else {
    elseElements.add(new CSharpElementGroupImpl<PsiElement>(scopeElement.getProject(),"String_Node_Str",groupElements));
    return ContainerUtil.toArray(elseElements,PsiElement.ARRAY_FACTORY);
  }
}

Fixed version (ground truth):
@NotNull public static PsiElement[] fiterOverridedAndHiddedElements(@NotNull PsiElement scopeElement,@NotNull Collection<PsiElement> elements){
  List<PsiElement> copyElements=new ArrayList<PsiElement>(elements);
  for (  PsiElement element : elements) {
    if (!copyElements.contains(element)) {
      continue;
    }
    if (element instanceof DotNetVirtualImplementOwner) {
      if (element instanceof CSharpMethodDeclaration && ((CSharpMethodDeclaration)element).isDelegate()) {
        continue;
      }
      DotNetType typeForImplement=((DotNetVirtualImplementOwner)element).getTypeForImplement();
      for (      PsiElement tempIterateElement : elements) {
        if (tempIterateElement == element) {
          continue;
        }
        if (CSharpElementCompareUtil.isEqual(tempIterateElement,element,CSharpElementCompareUtil.CHECK_RETURN_TYPE,scopeElement)) {
          copyElements.remove(tempIterateElement);
        }
      }
      if (typeForImplement != null) {
        copyElements.remove(element);
      }
    }
  }
  List<PsiElement> groupElements=new SmartList<PsiElement>();
  List<PsiElement> elseElements=new SmartList<PsiElement>();
  for (  PsiElement copyElement : copyElements) {
    if (copyElement instanceof DotNetLikeMethodDeclaration) {
      groupElements.add(copyElement);
    }
 else {
      elseElements.add(copyElement);
    }
  }
  if (elseElements.isEmpty() && groupElements.isEmpty()) {
    return PsiElement.EMPTY_ARRAY;
  }
 else   if (elseElements.isEmpty()) {
    return new PsiElement[]{new CSharpElementGroupImpl<PsiElement>(scopeElement.getProject(),"String_Node_Str",groupElements)};
  }
 else   if (groupElements.isEmpty()) {
    return ContainerUtil.toArray(elseElements,PsiElement.ARRAY_FACTORY);
  }
 else {
    elseElements.add(new CSharpElementGroupImpl<PsiElement>(scopeElement.getProject(),"String_Node_Str",groupElements));
    return ContainerUtil.toArray(elseElements,PsiElement.ARRAY_FACTORY);
  }
}