TextDiffType (boolean hasDeleted, boolean hasInserted) { if (hasDeleted && hasInserted) { return TextDiffType.MODIFIED; } else if (hasDeleted) { return TextDiffType.DELETED; } else if (hasInserted) { return TextDiffType.INSERTED; } else { LOG.error("Diff fragment should not be empty"); return TextDiffType.MODIFIED; } }