boolean (@NotNull PsiCodeBlock codeBlock, boolean returnAtTheEnd) { PsiJavaToken rBrace = codeBlock.getRBrace(); if (rBrace != null) { PsiStatement lastNonEmptyStatement = getPrevNonEmptyStatement(rBrace, removeCompletely); if (lastNonEmptyStatement == null) { return false; } if (moveTo(lastNonEmptyStatement, returnAtTheEnd)) { return true; } if (returnAtTheEnd) { insertBefore.add(rBrace); return true; } } return false; }