boolean (PsiElement element) { if (!(element instanceof PsiJavaToken token)) { return false; } final IElementType tokenType = token.getTokenType(); if (!JavaTokenType.SWITCH_KEYWORD.equals(tokenType)) { return false; } final PsiElement parent = element.getParent(); if (!(parent instanceof PsiSwitchStatement)) { return false; } return checkSwitchStatement((PsiSwitchStatement)parent); }