PsiElement (@NotNull PsiEnumConstant last) { PsiElement current = last.getNextSibling(); while (current instanceof PsiWhiteSpace || current instanceof PsiComment || (current instanceof PsiJavaToken && (((PsiJavaToken)current).getTokenType() == JavaTokenType.COMMA)) ) { current = current.getNextSibling(); } return current; }