boolean (@NotNull PendingChunk chunk1, @NotNull PendingChunk chunk2) { if (!chunk1.hasEqualWords && !chunk2.hasEqualWords) return true; // combine lines, that matched only by '\n' if (chunk1.isEqualIgnoreWhitespaces && chunk2.isEqualIgnoreWhitespaces) return true; // combine whitespace-only changed lines if (!chunk1.hasWordsInside || !chunk2.hasWordsInside) return true; // squash block without words in it return false; }