Match (@Nullable PsiCodeBlock block1, @Nullable PsiCodeBlock block2) { if (block1 == null || block2 == null) { return Match.exact(block1 == block2); } final List<PsiStatement> statements1 = collectStatements(block1, new SmartList<>()); final List<PsiStatement> statements2 = collectStatements(block2, new SmartList<>()); final int size = statements1.size(); if (size != statements2.size()) { return EXACT_MISMATCH; } for (int i = 0; i < size; i++) { if (!statementsMatch(statements2.get(i), statements1.get(i)).isExactMatch()) { return EXACT_MISMATCH; } } return EXACT_MATCH; }