@Test
    public void testSignificantOccurrence() {
        assertMetrics("significantOccurrence:0","a%0.2","x");
        assertMetrics("significantOccurrence:1","a%0.2","a");
        assertMetrics("significantOccurrence:0","a%0.2 a a","x");
        assertMetrics("significantOccurrence:1","a%0.2 a a","a");
        assertMetrics("significantOccurrence:1","a a a","a a a");
        assertMetrics("significantOccurrence:1","a%0.2 a a","a a a a");
        assertMetrics("significantOccurrence:0.3571","a%0.2","x x x a x x a x a x x x a a");
        assertMetrics("significantOccurrence:1","a%0.2","a a a a a a a a a a a a a a");
        assertMetrics("significantOccurrence:0.5","a b","a b b a a a a a b a a b a a");

        assertMetrics("significantOccurrence:0.5714","a%0.2 b","a b b a a a a a b a a b a a");
        assertMetrics("significantOccurrence:0.6753","a%1 b","a b b a a a a a b a a b a a");  // Should be higher
        assertMetrics("significantOccurrence:0.4286","a b%0.2","a b b a a a a a b a a b a a"); // Should be lower
        assertMetrics("significantOccurrence:0.3247","a b%1","a b b a a a a a b a a b a a"); // Should be even lower

        assertMetrics("significantOccurrence:0.30","a b",    "a a b b b b x x x x");
        assertMetrics("significantOccurrence:0.3333","a b%0.2","a a b b b b x x x x"); // More frequent is more important - higher
        assertMetrics("significantOccurrence:0.2667","a%0.2 b","a a b b b b x x x x"); // Less frequent is more important - lower
        assertMetrics("significantOccurrence:0.2667","a b%0.05", "a a b b b b x x x x"); // Same relative

        assertMetrics("significantOccurrence:0","a%0 b%0", "a a b b b b x x x x");

        // tests going beyond the occurrence limit
        FieldMatchMetricsParameters parameters=new FieldMatchMetricsParameters();
        parameters.setMaxOccurrences(10);
        parameters.freeze();
        FieldMatchMetricsComputer c=new FieldMatchMetricsComputer(parameters);
        assertMetrics("significantOccurrence:0.6","a b","a a a a a a a a a a b b",false,c);
        assertMetrics("significantOccurrence:0.6","a b","a a a a a a a a a a a b b",false,c); // Starting to cut off
        assertMetrics("significantOccurrence:0.6","a b","a a a a a a a a a a a a a a a a a a a a a b b",false,c); // Way beyond cutoff for a
        assertMetrics("significantOccurrence:1",  "a b","a a a a a a a a a a b b b b b b b b b b",false,c); // Exactly no cutoff
        assertMetrics("significantOccurrence:1",  "a b","a a a a a a a a a a a b b b b b b b b b b b",false,c); // Field is too large to consider field length

        assertMetrics("significantOccurrence:0.7333","a%0.2 b","a a a a a a a a a a b b",false,c);
        assertMetrics("significantOccurrence:0.4667","a b%0.2","a a a a a a a a a a b b",false,c);
        assertMetrics("significantOccurrence:0.7333","a%0.2 b","a a a a a a a a a a a b b",false,c); // Starting to cut off
        assertMetrics("significantOccurrence:0.7333","a%0.2 b","a a a a a a a a a a a a a a a a a a a a a b b",false,c); // Way beyond cutoff for a
        assertMetrics("significantOccurrence:1",     "a%0.2 b","a a a a a a a a a a b b b b b b b b b b",false,c); // Exactly no cutoff
        assertMetrics("significantOccurrence:1",     "a%0.2 b","a a a a a a a a a a a b b b b b b b b b b b",false,c); // Field is too large to consider field length
    }
Calculated the same way as weight
searchlib/src/test/java/com/yahoo/searchlib/ranking/features/fieldmatch/test/FieldMatchMetricsTestCase.java