@Test
public void testDistributionalSimilarity() {

    MetadataStore store = new DefaultMetadataStore();
    Schema schema = store.addSchema("schema", null, null);
    Table table1 = schema.addTable(store, "table1", null, null);
    Column column1 = table1.addColumn(store, "col1", null, 0);
    Column column2 = table1.addColumn(store, "col2", null, 1);
    Table table2 = schema.addTable(store, "table2", null, null);
    Column column3 = table2.addColumn(store, "col3", null, 0);
    Column column4 = table2.addColumn(store, "col4", null, 1);
    TableSample tableSample1 = new TableSample(table1.getId(),
            new String[][]{
                    new String[]{"a", "0"},
                    new String[]{"a", "1"},
                    new String[]{"a", "2"},
                    new String[]{"c", "3"},
                    new String[]{"a", "4"},
                    new String[]{"a", "5"},
                    new String[]{"a", "6"},
                    new String[]{"e", "7"}
            }
    );
    TableSample tableSample2 = new TableSample(table2.getId(),
            new String[][]{
                    new String[]{"a", "10"},
                    new String[]{"b", "100"},
                    new String[]{"c", "200"},
                    new String[]{"d", "300"},
                    new String[]{"e", "400"},
                    new String[]{"f", "500"},
                    new String[]{"g", "600"},
                    new String[]{"h", "700"}
            }
    );
    double result1 = ForeignKeys.estimateDistributionDistance(
            column1.getId(),
            tableSample1,
            column1.getId(),
            tableSample1,
            store.getIdUtils()
    );
    double result2 = ForeignKeys.estimateDistributionDistance(
            column1.getId(),
            tableSample1,
            column3.getId(),
            tableSample2,
            store.getIdUtils()
    );
    double result3 = ForeignKeys.estimateDistributionDistance(
            column2.getId(),
            tableSample1,
            column4.getId(),
            tableSample2,
            store.getIdUtils()
    );
    Assert.assertEquals(0d, result1, 0d);
    Assert.assertTrue(result2 > 0d);
    Assert.assertTrue(result3 > 0d);
    Assert.assertTrue(result2 < result3);
}