boolean (@NotNull GrTryCatchStatement statement1, @NotNull GrTryCatchStatement statement2) { final GrOpenBlock tryBlock1 = statement1.getTryBlock(); final GrOpenBlock tryBlock2 = statement2.getTryBlock(); if (!openBlocksAreEquivalent(tryBlock1, tryBlock2)) { return false; } final GrFinallyClause finallyBlock1 = statement1.getFinallyClause(); final GrFinallyClause finallyBlock2 = statement2.getFinallyClause(); if (finallyBlock1 != null) { if (finallyBlock2 == null || !openBlocksAreEquivalent(finallyBlock1.getBody(), finallyBlock2.getBody())) { return false; } } else if (finallyBlock2 != null) { return false; } final GrCatchClause[] catchBlocks1 = statement1.getCatchClauses(); final GrCatchClause[] catchBlocks2 = statement2.getCatchClauses(); return ArrayUtil.areEqual(catchBlocks1, catchBlocks2, (c1, c2) -> catchClausesAreEquivalent(c1, c2)); }