Example usage for org.apache.commons.collections4 ListUtils longestCommonSubsequence

List of usage examples for org.apache.commons.collections4 ListUtils longestCommonSubsequence

Introduction

In this page you can find the example usage for org.apache.commons.collections4 ListUtils longestCommonSubsequence.

Prototype

public static String longestCommonSubsequence(final CharSequence a, final CharSequence b) 

Source Link

Document

Returns the longest common subsequence (LCS) of two CharSequence objects.

Usage

From source file:com.flipkart.zjsonpatch.JsonDiff.java

private static List<JsonNode> getLCS(final JsonNode first, final JsonNode second) {

    Preconditions.checkArgument(first.isArray(), "LCS can only work on JSON arrays");
    Preconditions.checkArgument(second.isArray(), "LCS can only work on JSON arrays");

    return ListUtils.longestCommonSubsequence(Lists.newArrayList(first), Lists.newArrayList(second));
}