@Test
    public void testLongestSequence() {
        assertMetrics("longestSequence:1","a","a");
        assertMetrics("longestSequence:1","a","a b c");
        assertMetrics("longestSequence:1","b","a b c");
        assertMetrics("longestSequence:3","a b c","x x a b c x x a b x");
        assertMetrics("longestSequence:3 segments:1","a b c","x x a b x x a b c x");
        assertMetrics("longestSequence:2","a b c d","x x c d x x a b x");
        assertMetrics("longestSequence:2","a b c d","x x a b x c d x x");
        assertMetrics("longestSequence:2","a b c d","x x a b x x x x x x x x x x x x x x x x x c d x x");
        assertMetrics("longestSequence:4 segments:1","a b c d","x x a b x x x x x x x x x x x x x x x x x c d x x a b c d");
    }
Tests of calculation of all the string match metrics.
Add true as the fourth parameter to assertMetrics to see a trace of what the test is doing.

@author bratseth
searchlib/src/test/java/com/yahoo/searchlib/ranking/features/fieldmatch/test/FieldMatchMetricsTestCase.java