PsiIfStatement (PsiIfStatement ifStatement) { final PsiStatement thenBranch = ControlFlowUtils.stripBraces(ifStatement.getThenBranch()); if (!(thenBranch instanceof PsiSynchronizedStatement synchronizedStatement)) { return null; } final PsiCodeBlock body = synchronizedStatement.getBody(); final PsiStatement statement = ControlFlowUtils.getOnlyStatementInBlock(body); return (statement instanceof PsiIfStatement) ? (PsiIfStatement)statement : null; }