private static boolean afterArrowInCase(@Nullable PsiElement leaf) {
    if (leaf == null) return false;
    PsiElement prevLeaf = PsiTreeUtil.prevVisibleLeaf(leaf);
    if (prevLeaf == null) return false;
    if (prevLeaf.getNode().getElementType() != JavaTokenType.ARROW) return false;
    PsiElement parent = prevLeaf.getParent();
    if (parent == null) return false;
    if (!BasicJavaAstTreeUtil.is(parent.getNode().getElementType(), BASIC_SWITCH_LABELED_RULE)) return false;
    if (StringUtil.isEmptyOrSpaces(leaf.getText())) {
      leaf = PsiTreeUtil.nextVisibleLeaf(leaf);
    }
    PsiElement body = BasicJavaAstTreeUtil.getParentOfType(leaf, Set.of(BASIC_EXPRESSION_STATEMENT, BASIC_THROW_STATEMENT), false);
    if (body == null) return false;
    return PsiTreeUtil.isAncestor(parent, body, false);
  }
private static boolean afterArrowInCase(@Nullable PsiElement leaf)