boolean (PsiElement element) { if (!(element instanceof PsiJavaToken token)) { return false; } final IElementType tokenType = token.getTokenType(); if (!JavaTokenType.DO_KEYWORD.equals(tokenType)) { return false; } final PsiElement parent = element.getParent(); if (!(parent instanceof PsiDoWhileStatement doWhileStatement)) { return false; } return !(doWhileStatement.getCondition() == null || doWhileStatement.getBody() == null); }