Set<Object> (@NotNull PsiSwitchLabelStatementBase label) { final PsiCaseLabelElementList list = label.getCaseLabelElementList(); if (list == null) { return Collections.emptySet(); } Set<Object> constants = new HashSet<>(); for (PsiCaseLabelElement caseLabelElement : list.getElements()) { PsiExpression expression = ObjectUtils.tryCast(caseLabelElement, PsiExpression.class); Object constant = ExpressionUtils.computeConstantExpression(expression); if (constant instanceof Byte || constant instanceof Short) { constants.add(((Number)constant).intValue()); } else if (constant instanceof String || constant instanceof Integer) { constants.add(constant); } else if (constant instanceof Character) { constants.add((int)(char)constant); } else { return Collections.emptySet(); } } return constants; }