public static @NotNull List<@Nullable GrExpression> getAllPatternsForCaseSection(@NotNull GrCaseSection section) {
    PsiElement parent = section.getParent();
    if (!(parent instanceof GrSwitchElement)) {
      return emptyList();
    }
    if (section.getArrow() != null) {
      return Arrays.asList(section.getExpressions());
    }
    GrCaseSection[] allSections = ((GrSwitchElement)parent).getCaseSections();
    int indexOfCaseSection = ArrayUtil.indexOf(allSections, section);
    SmartList<GrExpression> patterns = new SmartList<>(section.getExpressions());
    if (indexOfCaseSection < 0) {
      return patterns;
    }
    indexOfCaseSection -= 1;
    while (indexOfCaseSection >= 0 && allSections[indexOfCaseSection].getStatements().length == 0) {
      // does not support fall-through currently todo
      patterns.addAll(Arrays.asList(allSections[indexOfCaseSection].getExpressions()));
      --indexOfCaseSection;
    }
    return patterns;
  }
public static @NotNull List<@Nullable GrExpression> getAllPatternsForCaseSection(@NotNull GrCaseSection section)