Set<PsiElement> () { myCookedNumber = 0; final Set<PsiElement> set = new HashSet<>(); for (final PsiElement element : myVictims) { final PsiType originalType = Util.getType(element); final PsiType cookedType = getCookedType(element); if (cookedType != null && !originalType.equals(cookedType)) { set.add(element); myCookedNumber++; } } if (mySettings.dropObsoleteCasts()) { myCastsRemoved = 0; if (myBinding != null) { for (final Map.Entry<PsiTypeCastExpression,PsiType> entry : myCastToOperandType.entrySet()) { final PsiTypeCastExpression cast = entry.getKey(); final PsiType operandType = myBinding.apply(entry.getValue()); final PsiType castType = cast.getType(); if (!(operandType instanceof PsiTypeVariable) && castType != null && !isBottomArgument(operandType) && castType.isAssignableFrom(operandType)) { set.add(cast); } } } } return set; }