boolean (@NotNull PsiType selectorType, @NotNull Set<PsiClass> visitedCovered, @NotNull Set<PsiType> existedTypes, @NotNull Collection<PatternTypeTestDescription> toAdd) { boolean changed = false; for (PsiClass covered : visitedCovered) { PsiClassType classType = TypeUtils.getType(covered); if (!existedTypes.contains(classType)) { if (SwitchBlockHighlightingModel.oneOfUnconditional(selectorType, classType)) { toAdd.add(new PatternTypeTestDescription(classType)); changed = true; } //find something upper. let's change to selectorType if (SwitchBlockHighlightingModel.oneOfUnconditional(classType, selectorType)) { toAdd.add(new PatternTypeTestDescription(selectorType)); changed = true; break; } } } return changed; }