@Test
    public void testEarliness() {
        assertMetrics("earliness:1",     "a","a");
        assertMetrics("earliness:0",     "a","x");
        assertMetrics("earliness:1",     "a","a a a");
        assertMetrics("earliness:1",     "a a a","a");
        assertMetrics("earliness:0.8",   "b","a b c");
        assertMetrics("earliness:0.8",     "b","a b");
        assertMetrics("earliness:0.9091","a b c","x b c x x x x x a x x x");
        assertMetrics("earliness:0.2",   "a b c","x b c a x x x x a x x x x x x x a b c x x");
    }
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