List<ClashingMethod> (@NotNull GrTypeDefinition typeDefinition) { Collection<HierarchicalMethodSignature> visibleSignatures = typeDefinition.getVisibleSignatures(); List<ClashingMethod> clashingMethods = new ArrayList<>(); for (HierarchicalMethodSignature signature : visibleSignatures) { PsiMethod method = signature.getMethod(); if (method instanceof GrTraitMethod && method.getContainingClass() == typeDefinition) { List<HierarchicalMethodSignature> superSignatures = signature.getSuperSignatures(); if (superSignatures.size() > 1) { List<GrTypeDefinition> traits = new ArrayList<>(); for (HierarchicalMethodSignature superSignature : superSignatures) { PsiMethod superMethod = superSignature.getMethod(); PsiClass superClass = superMethod.getContainingClass(); if (GrTraitUtil.isTrait(superClass) && !superMethod.getModifierList().hasExplicitModifier(PsiModifier.ABSTRACT)) { traits.add((GrTypeDefinition)superClass); } } if (traits.size() > 1) { clashingMethods.add(new ClashingMethod(signature, traits)); } } } } return clashingMethods; }