void (@NotNull PsiElement element) { final PsiJavaToken token = (PsiJavaToken)element; final PsiIfStatement firstStatement = (PsiIfStatement)token.getParent(); final PsiIfStatement secondStatement = (PsiIfStatement)PsiTreeUtil.skipWhitespacesForward(firstStatement); assert secondStatement != null; final CommentTracker tracker = new CommentTracker(); final String newStatementText = mergeIfStatements(firstStatement, secondStatement, tracker); PsiReplacementUtil.replaceStatement(firstStatement, newStatementText, tracker); secondStatement.delete(); }