boolean (PsiArrayType type, PsiType bound) { if (type.getArrayDimensions() == bound.getArrayDimensions()) { final PsiType componentType = type.getComponentType(); final PsiType boundComponentType = ((PsiArrayType)bound).getComponentType(); if (boundComponentType instanceof PsiClassType && componentType instanceof PsiClassType) { return proveExtendsBoundsDistinct(boundComponentType, componentType, ((PsiClassType)boundComponentType).resolve(), ((PsiClassType)componentType).resolve()); } else { return !bound.equals(type); } } else if (bound.getArrayDimensions() + 1 == type.getArrayDimensions() && bound.getDeepComponentType() instanceof PsiClassType) { return !isSuperClassOfArrayType(((PsiClassType)bound.getDeepComponentType()).resolve()); } else if (bound.getArrayDimensions() == type.getArrayDimensions() + 1 && type.getDeepComponentType() instanceof PsiClassType) { return !isSuperClassOfArrayType(((PsiClassType)type.getDeepComponentType()).resolve()); } else if (bound instanceof PsiClassType) { return !isSuperClassOfArrayType(((PsiClassType)bound).resolve()); } else if (bound instanceof PsiWildcardType) { final PsiType boundBound = ((PsiWildcardType)bound).getBound(); if (boundBound != null && !boundBound.equals(type)) { if (boundBound instanceof PsiArrayType && !((PsiWildcardType)bound).isSuper()) { return proveArrayTypeDistinct(type, boundBound); } final PsiClass psiClass = PsiUtil.resolveClassInClassTypeOnly(boundBound); if (psiClass == null) { return true; } if (psiClass instanceof PsiTypeParameter) { return try2ProveTypeParameterDistinct(type, psiClass); } return !(((PsiWildcardType)bound).isExtends() && isSuperClassOfArrayType(psiClass)); } return false; } else if (bound instanceof PsiIntersectionType) { for (PsiType conjunctBound : ((PsiIntersectionType)bound).getConjuncts()) { if (!proveArrayTypeDistinct(type, conjunctBound)) return false; } } else if (bound instanceof PsiCapturedWildcardType) { return proveArrayTypeDistinct(type, ((PsiCapturedWildcardType)bound).getWildcard()); } return true; }