/*
 * ARX Data Anonymization Tool
 * Copyright 2012 - 2023 Fabian Prasser and contributors
 * 
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 * 
 * http://www.apache.org/licenses/LICENSE-2.0
 * 
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

package org.deidentifier.arx.test;

import java.io.IOException;
import java.nio.charset.StandardCharsets;
import java.util.Arrays;
import java.util.Collection;

import org.deidentifier.arx.ARXConfiguration;
import org.deidentifier.arx.AttributeType.Hierarchy;
import org.deidentifier.arx.Data;
import org.deidentifier.arx.DataHandle;
import org.deidentifier.arx.criteria.HierarchicalDistanceTCloseness;
import org.deidentifier.arx.criteria.KAnonymity;
import org.deidentifier.arx.criteria.RecursiveCLDiversity;
import org.deidentifier.arx.metric.Metric;
import org.deidentifier.arx.metric.Metric.AggregateFunction;
import org.junit.runner.RunWith;
import org.junit.runners.Parameterized;
import org.junit.runners.Parameterized.Parameters;

/**
 * Tests for the NDS metric.
 *
 * @author Fabian Prasser
 * @author Florian Kohlmayer
 */
@RunWith(Parameterized.class)
public class TestUtilityMetricsLoss extends AbstractAnonymizationTest {
    
    /**
     * Returns the test cases
     * 
     * @return
     * @throws IOException
     */
    @Parameters(name = "{index}:[{0}]")
    public static Collection<Object[]> cases() throws IOException {
        return Arrays.asList(new Object[][] {
                                              /* 0 */{ new ARXAnonymizationTestCase(ARXConfiguration.create(1.0d, Metric.createLossMetric(AggregateFunction.RANK)).addPrivacyModel(new KAnonymity(5)).addPrivacyModel(new HierarchicalDistanceTCloseness("occupation", 0.2, Hierarchy.create("./data/adult_hierarchy_occupation.csv", StandardCharsets.UTF_8, ';'))), "occupation", "./data/adult.csv", "[0.8630926331, 0.838230697, 0.8357221006, 0.8169882633, 0.7735229759, 0.7735229759, 0.7735229759, 0.7735229759]", new int[] { 0, 3, 0, 0, 2, 1, 1, 0 }, false) },
                                              { new ARXAnonymizationTestCase(ARXConfiguration.create(1.0d, Metric.createLossMetric(AggregateFunction.RANK)).addPrivacyModel(new KAnonymity(5)), "occupation", "./data/adult.csv", "[0.297248193, 0.29678055, 0.1297659306, 0.1297659306, 0.1297659306, 0.1297659306, 0.1297659306, 0.1297659306]", new int[] { 0, 3, 0, 0, 1, 0, 0, 0 }, false) },
                                              { new ARXAnonymizationTestCase(ARXConfiguration.create(1.0d, Metric.createLossMetric(AggregateFunction.RANK)).addPrivacyModel(new HierarchicalDistanceTCloseness("occupation", 0.2, Hierarchy.create("./data/adult_hierarchy_occupation.csv", StandardCharsets.UTF_8, ';'))), "occupation", "./data/adult.csv", "[0.8630926331, 0.838230697, 0.8357221006, 0.8169882633, 0.7735229759, 0.7735229759, 0.7735229759, 0.7735229759]", new int[] { 0, 3, 0, 0, 2, 1, 1, 0 }, false) },
                                              { new ARXAnonymizationTestCase(ARXConfiguration.create(1.0d, Metric.createLossMetric(AggregateFunction.RANK)).addPrivacyModel(new RecursiveCLDiversity("occupation", 4.0, 5)), "occupation", "./data/adult.csv", "[0.4133583411, 0.4042130826, 0.3444444444, 0.3363245879, 0.1787016776, 0.1787016776, 0.1787016776, 0.1787016776]", new int[] { 0, 3, 0, 0, 1, 1, 1, 0 }, false) },
                                              { new ARXAnonymizationTestCase(ARXConfiguration.create(0.05d, Metric.createLossMetric(AggregateFunction.RANK)).addPrivacyModel(new KAnonymity(5)).addPrivacyModel(new HierarchicalDistanceTCloseness("occupation", 0.2, Hierarchy.create("./data/adult_hierarchy_occupation.csv", StandardCharsets.UTF_8, ';'))), "occupation", "./data/adult.csv", "[1.0, 1.0, 1.0, 1.0, 1.0, 0.3077954048, 0.0458855513, 0.0458855513]", new int[] { 1, 4, 0, 0, 3, 1, 2, 1 }, false) },
                                              { new ARXAnonymizationTestCase(ARXConfiguration.create(0.05d, Metric.createLossMetric(AggregateFunction.RANK)).addPrivacyModel(new RecursiveCLDiversity("occupation", 4.0, 5)), "occupation", "./data/adult.csv", "[1.0, 1.0, 0.3028098269, 0.2240420249, 0.0397520058, 0.0397520058, 0.0397520058, 0.0397520058]", new int[] { 0, 3, 0, 0, 3, 1, 2, 0 }, false) },
                                              { new ARXAnonymizationTestCase(ARXConfiguration.create(0.05d, Metric.createLossMetric(AggregateFunction.RANK)).addPrivacyModel(new KAnonymity(5)).addPrivacyModel(new HierarchicalDistanceTCloseness("occupation", 0.2, Hierarchy.create("./data/adult_hierarchy_occupation.csv", StandardCharsets.UTF_8, ';'))), "occupation", "./data/adult.csv", "[1.0, 1.0, 1.0, 1.0, 1.0, 0.3077954048, 0.0458855513, 0.0458855513]", new int[] { 1, 4, 0, 0, 3, 1, 2, 1 }, false) },
                                              { new ARXAnonymizationTestCase(ARXConfiguration.create(0.05d, Metric.createLossMetric(AggregateFunction.RANK)).addPrivacyModel(new RecursiveCLDiversity("occupation", 4.0, 5)), "occupation", "./data/adult.csv", "[1.0, 1.0, 0.3028098269, 0.2240420249, 0.0397520058, 0.0397520058, 0.0397520058, 0.0397520058]", new int[] { 0, 3, 0, 0, 3, 1, 2, 0 }, false) },
                                              { new ARXAnonymizationTestCase(ARXConfiguration.create(0.05d, Metric.createLossMetric(AggregateFunction.RANK)).addPrivacyModel(new HierarchicalDistanceTCloseness("occupation", 0.2, Hierarchy.create("./data/adult_hierarchy_occupation.csv", StandardCharsets.UTF_8, ';'))), "occupation", "./data/adult.csv", "[1.0, 1.0, 1.0, 1.0, 1.0, 0.3077954048, 0.0458855513, 0.0458855513]", new int[] { 1, 4, 0, 0, 3, 1, 2, 1 }, false) },
                                              { new ARXAnonymizationTestCase(ARXConfiguration.create(0.05d, Metric.createLossMetric(AggregateFunction.RANK)).addPrivacyModel(new HierarchicalDistanceTCloseness("occupation", 0.2, Hierarchy.create("./data/adult_hierarchy_occupation.csv", StandardCharsets.UTF_8, ';'))), "occupation", "./data/adult.csv", "[1.0, 1.0, 1.0, 1.0, 1.0, 0.3077954048, 0.0458855513, 0.0458855513]", new int[] { 1, 4, 0, 0, 3, 1, 2, 1 }, false) },
                                              /* 10 */{ new ARXAnonymizationTestCase(ARXConfiguration.create(1.0d, Metric.createLossMetric(0.0d, AggregateFunction.RANK)).addPrivacyModel(new KAnonymity(5)).addPrivacyModel(new HierarchicalDistanceTCloseness("occupation", 0.2, Hierarchy.create("./data/adult_hierarchy_occupation.csv", StandardCharsets.UTF_8, ';'))), "occupation", "./data/adult.csv", "[0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0]", new int[] { 0, 0, 0, 0, 0, 0, 0, 0 }, false) },
                                              { new ARXAnonymizationTestCase(ARXConfiguration.create(1.0d, Metric.createLossMetric(0.0d, AggregateFunction.RANK)).addPrivacyModel(new KAnonymity(5)), "occupation", "./data/adult.csv", "[0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0]", new int[] { 0, 0, 0, 0, 0, 0, 0, 0 }, false) },
                                              { new ARXAnonymizationTestCase(ARXConfiguration.create(1.0d, Metric.createLossMetric(0.0d, AggregateFunction.RANK)).addPrivacyModel(new HierarchicalDistanceTCloseness("occupation", 0.2, Hierarchy.create("./data/adult_hierarchy_occupation.csv", StandardCharsets.UTF_8, ';'))), "occupation", "./data/adult.csv", "[0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0]", new int[] { 0, 0, 0, 0, 0, 0, 0, 0 }, false) },
                                              { new ARXAnonymizationTestCase(ARXConfiguration.create(1.0d, Metric.createLossMetric(0.0d, AggregateFunction.RANK)).addPrivacyModel(new RecursiveCLDiversity("occupation", 4.0, 5)), "occupation", "./data/adult.csv", "[0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0]", new int[] { 0, 0, 0, 0, 0, 0, 0, 0 }, false) },
                                              { new ARXAnonymizationTestCase(ARXConfiguration.create(0.05d, Metric.createLossMetric(0.0d, AggregateFunction.RANK)).addPrivacyModel(new KAnonymity(5)).addPrivacyModel(new HierarchicalDistanceTCloseness("occupation", 0.2, Hierarchy.create("./data/adult_hierarchy_occupation.csv", StandardCharsets.UTF_8, ';'))), "occupation", "./data/adult.csv", "[1.0, 1.0, 1.0, 1.0, 1.0, 0.2728756382, 0.0, 0.0]", new int[] { 1, 4, 0, 0, 3, 1, 2, 1 }, false) },
                                              { new ARXAnonymizationTestCase(ARXConfiguration.create(0.05d, Metric.createLossMetric(0.0d, AggregateFunction.RANK)).addPrivacyModel(new RecursiveCLDiversity("occupation", 4.0, 5)), "occupation", "./data/adult.csv", "[1.0, 1.0, 0.2728756382, 0.1919191919, 0.0, 0.0, 0.0, 0.0]", new int[] { 0, 3, 0, 0, 3, 1, 2, 0 }, false) },
                                              { new ARXAnonymizationTestCase(ARXConfiguration.create(0.05d, Metric.createLossMetric(0.0d, AggregateFunction.RANK)).addPrivacyModel(new KAnonymity(5)).addPrivacyModel(new HierarchicalDistanceTCloseness("occupation", 0.2, Hierarchy.create("./data/adult_hierarchy_occupation.csv", StandardCharsets.UTF_8, ';'))), "occupation", "./data/adult.csv", "[1.0, 1.0, 1.0, 1.0, 1.0, 0.2728756382, 0.0, 0.0]", new int[] { 1, 4, 0, 0, 3, 1, 2, 1 }, false) },
                                              { new ARXAnonymizationTestCase(ARXConfiguration.create(0.05d, Metric.createLossMetric(0.0d, AggregateFunction.RANK)).addPrivacyModel(new RecursiveCLDiversity("occupation", 4.0, 5)), "occupation", "./data/adult.csv", "[1.0, 1.0, 0.2728756382, 0.1919191919, 0.0, 0.0, 0.0, 0.0]", new int[] { 0, 3, 0, 0, 3, 1, 2, 0 }, false) },
                                              { new ARXAnonymizationTestCase(ARXConfiguration.create(0.05d, Metric.createLossMetric(0.0d, AggregateFunction.RANK)).addPrivacyModel(new HierarchicalDistanceTCloseness("occupation", 0.2, Hierarchy.create("./data/adult_hierarchy_occupation.csv", StandardCharsets.UTF_8, ';'))), "occupation", "./data/adult.csv", "[1.0, 1.0, 1.0, 1.0, 1.0, 0.2728756382, 0.0, 0.0]", new int[] { 1, 4, 0, 0, 3, 1, 2, 1 }, false) },
                                              { new ARXAnonymizationTestCase(ARXConfiguration.create(0.05d, Metric.createLossMetric(0.0d, AggregateFunction.RANK)).addPrivacyModel(new HierarchicalDistanceTCloseness("occupation", 0.2, Hierarchy.create("./data/adult_hierarchy_occupation.csv", StandardCharsets.UTF_8, ';'))), "occupation", "./data/adult.csv", "[1.0, 1.0, 1.0, 1.0, 1.0, 0.2728756382, 0.0, 0.0]", new int[] { 1, 4, 0, 0, 3, 1, 2, 1 }, false) },
                                              /* 20 */{ new ARXAnonymizationTestCase(ARXConfiguration.create(1.0d, Metric.createLossMetric(0.33d, AggregateFunction.RANK)).addPrivacyModel(new KAnonymity(5)).addPrivacyModel(new HierarchicalDistanceTCloseness("occupation", 0.2, Hierarchy.create("./data/adult_hierarchy_occupation.csv", StandardCharsets.UTF_8, ';'))), "occupation", "./data/adult.csv", "[0.6348915854, 0.6195185995, 0.6195185995, 0.6195185995, 0.6195185995, 0.6195185995, 0.6195185995, 0.6195185995]", new int[] { 0, 1, 0, 0, 0, 0, 0, 0 }, false) },
                                              { new ARXAnonymizationTestCase(ARXConfiguration.create(1.0d, Metric.createLossMetric(0.33d, AggregateFunction.RANK)).addPrivacyModel(new KAnonymity(5)), "occupation", "./data/adult.csv", "[0.2300344804, 0.1976148796, 0.1976148796, 0.1976148796, 0.1976148796, 0.1976148796, 0.1976148796, 0.1976148796]", new int[] { 0, 1, 0, 0, 0, 0, 0, 0 }, false) },
                                              { new ARXAnonymizationTestCase(ARXConfiguration.create(1.0d, Metric.createLossMetric(0.33d, AggregateFunction.RANK)).addPrivacyModel(new HierarchicalDistanceTCloseness("occupation", 0.2, Hierarchy.create("./data/adult_hierarchy_occupation.csv", StandardCharsets.UTF_8, ';'))), "occupation", "./data/adult.csv", "[0.6348915854, 0.6195185995, 0.6195185995, 0.6195185995, 0.6195185995, 0.6195185995, 0.6195185995, 0.6195185995]", new int[] { 0, 1, 0, 0, 0, 0, 0, 0 }, false) },
                                              { new ARXAnonymizationTestCase(ARXConfiguration.create(1.0d, Metric.createLossMetric(0.33d, AggregateFunction.RANK)).addPrivacyModel(new RecursiveCLDiversity("occupation", 4.0, 5)), "occupation", "./data/adult.csv", "[0.3414163517, 0.2755579868, 0.2755579868, 0.2755579868, 0.2755579868, 0.2755579868, 0.2755579868, 0.2755579868]", new int[] { 0, 2, 0, 0, 0, 0, 0, 0 }, false) },
                                              { new ARXAnonymizationTestCase(ARXConfiguration.create(0.05d, Metric.createLossMetric(0.33d, AggregateFunction.RANK)).addPrivacyModel(new KAnonymity(5)).addPrivacyModel(new HierarchicalDistanceTCloseness("occupation", 0.2, Hierarchy.create("./data/adult_hierarchy_occupation.csv", StandardCharsets.UTF_8, ';'))), "occupation", "./data/adult.csv", "[1.0, 1.0, 1.0, 1.0, 1.0, 0.2959226841, 0.0302844638, 0.0302844638]", new int[] { 1, 4, 0, 0, 3, 1, 2, 1 }, false) },
                                              { new ARXAnonymizationTestCase(ARXConfiguration.create(0.05d, Metric.createLossMetric(0.33d, AggregateFunction.RANK)).addPrivacyModel(new RecursiveCLDiversity("occupation", 4.0, 5)), "occupation", "./data/adult.csv", "[1.0, 1.0, 0.2926322027, 0.2131202616, 0.0262363238, 0.0262363238, 0.0262363238, 0.0262363238]", new int[] { 0, 3, 0, 0, 3, 1, 2, 0 }, false) },
                                              { new ARXAnonymizationTestCase(ARXConfiguration.create(0.05d, Metric.createLossMetric(0.33d, AggregateFunction.RANK)).addPrivacyModel(new KAnonymity(5)).addPrivacyModel(new HierarchicalDistanceTCloseness("occupation", 0.2, Hierarchy.create("./data/adult_hierarchy_occupation.csv", StandardCharsets.UTF_8, ';'))), "occupation", "./data/adult.csv", "[1.0, 1.0, 1.0, 1.0, 1.0, 0.2959226841, 0.0302844638, 0.0302844638]", new int[] { 1, 4, 0, 0, 3, 1, 2, 1 }, false) },
                                              { new ARXAnonymizationTestCase(ARXConfiguration.create(0.05d, Metric.createLossMetric(0.33d, AggregateFunction.RANK)).addPrivacyModel(new RecursiveCLDiversity("occupation", 4.0, 5)), "occupation", "./data/adult.csv", "[1.0, 1.0, 0.2926322027, 0.2131202616, 0.0262363238, 0.0262363238, 0.0262363238, 0.0262363238]", new int[] { 0, 3, 0, 0, 3, 1, 2, 0 }, false) },
                                              { new ARXAnonymizationTestCase(ARXConfiguration.create(0.05d, Metric.createLossMetric(0.33d, AggregateFunction.RANK)).addPrivacyModel(new HierarchicalDistanceTCloseness("occupation", 0.2, Hierarchy.create("./data/adult_hierarchy_occupation.csv", StandardCharsets.UTF_8, ';'))), "occupation", "./data/adult.csv", "[1.0, 1.0, 1.0, 1.0, 1.0, 0.2959226841, 0.0302844638, 0.0302844638]", new int[] { 1, 4, 0, 0, 3, 1, 2, 1 }, false) },
                                              { new ARXAnonymizationTestCase(ARXConfiguration.create(0.05d, Metric.createLossMetric(0.33d, AggregateFunction.RANK)).addPrivacyModel(new HierarchicalDistanceTCloseness("occupation", 0.2, Hierarchy.create("./data/adult_hierarchy_occupation.csv", StandardCharsets.UTF_8, ';'))), "occupation", "./data/adult.csv", "[1.0, 1.0, 1.0, 1.0, 1.0, 0.2959226841, 0.0302844638, 0.0302844638]", new int[] { 1, 4, 0, 0, 3, 1, 2, 1 }, false) },
                                              /* 30 */{ new ARXAnonymizationTestCase(ARXConfiguration.create(1.0d, Metric.createLossMetric(0.66d, AggregateFunction.RANK)).addPrivacyModel(new KAnonymity(5)).addPrivacyModel(new HierarchicalDistanceTCloseness("occupation", 0.2, Hierarchy.create("./data/adult_hierarchy_occupation.csv", StandardCharsets.UTF_8, ';'))), "occupation", "./data/adult.csv", "[0.6778091018, 0.6746031746, 0.6657963446, 0.650273224, 0.6296296296, 0.5151515151, 0.2796355377, 0.0]", new int[] { 0, 4, 1, 1, 3, 2, 2, 1 }, false) },
                                              { new ARXAnonymizationTestCase(ARXConfiguration.create(1.0d, Metric.createLossMetric(0.66d, AggregateFunction.RANK)).addPrivacyModel(new KAnonymity(5)), "occupation", "./data/adult.csv", "[0.2366229645, 0.2359393534, 0.1843930011, 0.1821869476, 0.0624295471, 0.0624295471, 0.0624295471, 0.0624295471]", new int[] { 0, 3, 0, 0, 1, 1, 1, 0 }, false) },
                                              { new ARXAnonymizationTestCase(ARXConfiguration.create(1.0d, Metric.createLossMetric(0.66d, AggregateFunction.RANK)).addPrivacyModel(new HierarchicalDistanceTCloseness("occupation", 0.2, Hierarchy.create("./data/adult_hierarchy_occupation.csv", StandardCharsets.UTF_8, ';'))), "occupation", "./data/adult.csv", "[0.6778091018, 0.6746031746, 0.6657963446, 0.650273224, 0.6296296296, 0.5151515151, 0.2796355377, 0.0]", new int[] { 0, 4, 1, 1, 3, 2, 2, 1 }, false) },
                                              { new ARXAnonymizationTestCase(ARXConfiguration.create(1.0d, Metric.createLossMetric(0.66d, AggregateFunction.RANK)).addPrivacyModel(new RecursiveCLDiversity("occupation", 4.0, 5)), "occupation", "./data/adult.csv", "[0.3312926227, 0.3308323873, 0.2890526059, 0.2855399209, 0.1787016776, 0.1787016776, 0.1787016776, 0.1787016776]", new int[] { 0, 3, 0, 0, 1, 1, 1, 0 }, false) },
                                              { new ARXAnonymizationTestCase(ARXConfiguration.create(0.05d, Metric.createLossMetric(0.66d, AggregateFunction.RANK)).addPrivacyModel(new KAnonymity(5)).addPrivacyModel(new HierarchicalDistanceTCloseness("occupation", 0.2, Hierarchy.create("./data/adult_hierarchy_occupation.csv", StandardCharsets.UTF_8, ';'))), "occupation", "./data/adult.csv", "[0.6778091018, 0.6746031746, 0.6657963446, 0.650273224, 0.6296296296, 0.5151515151, 0.2796355377, 0.0]", new int[] { 0, 4, 1, 1, 3, 2, 2, 1 }, false) },
                                              { new ARXAnonymizationTestCase(ARXConfiguration.create(0.05d, Metric.createLossMetric(0.66d, AggregateFunction.RANK)).addPrivacyModel(new RecursiveCLDiversity("occupation", 4.0, 5)), "occupation", "./data/adult.csv", "[0.5350842822, 0.5350842822, 0.3064993339, 0.275396064, 0.2192655108, 0.2182427523, 0.165847957, 0.0411113321]", new int[] { 1, 3, 0, 1, 2, 1, 1, 1 }, false) },
                                              { new ARXAnonymizationTestCase(ARXConfiguration.create(0.05d, Metric.createLossMetric(0.66d, AggregateFunction.RANK)).addPrivacyModel(new KAnonymity(5)).addPrivacyModel(new HierarchicalDistanceTCloseness("occupation", 0.2, Hierarchy.create("./data/adult_hierarchy_occupation.csv", StandardCharsets.UTF_8, ';'))), "occupation", "./data/adult.csv", "[0.6778091018, 0.6746031746, 0.6657963446, 0.650273224, 0.6296296296, 0.5151515151, 0.2796355377, 0.0]", new int[] { 0, 4, 1, 1, 3, 2, 2, 1 }, false) },
                                              { new ARXAnonymizationTestCase(ARXConfiguration.create(0.05d, Metric.createLossMetric(0.66d, AggregateFunction.RANK)).addPrivacyModel(new RecursiveCLDiversity("occupation", 4.0, 5)), "occupation", "./data/adult.csv", "[0.5350842822, 0.5350842822, 0.3064993339, 0.275396064, 0.2192655108, 0.2182427523, 0.165847957, 0.0411113321]", new int[] { 1, 3, 0, 1, 2, 1, 1, 1 }, false) },
                                              { new ARXAnonymizationTestCase(ARXConfiguration.create(0.05d, Metric.createLossMetric(0.66d, AggregateFunction.RANK)).addPrivacyModel(new HierarchicalDistanceTCloseness("occupation", 0.2, Hierarchy.create("./data/adult_hierarchy_occupation.csv", StandardCharsets.UTF_8, ';'))), "occupation", "./data/adult.csv", "[0.6778091018, 0.6746031746, 0.6657963446, 0.650273224, 0.6296296296, 0.5151515151, 0.2796355377, 0.0]", new int[] { 0, 4, 1, 1, 3, 2, 2, 1 }, false) },
                                              { new ARXAnonymizationTestCase(ARXConfiguration.create(0.05d, Metric.createLossMetric(0.66d, AggregateFunction.RANK)).addPrivacyModel(new HierarchicalDistanceTCloseness("occupation", 0.2, Hierarchy.create("./data/adult_hierarchy_occupation.csv", StandardCharsets.UTF_8, ';'))), "occupation", "./data/adult.csv", "[0.6778091018, 0.6746031746, 0.6657963446, 0.650273224, 0.6296296296, 0.5151515151, 0.2796355377, 0.0]", new int[] { 0, 4, 1, 1, 3, 2, 2, 1 }, false) },
                                              /* 40 */{ new ARXAnonymizationTestCase(ARXConfiguration.create(1.0d, Metric.createLossMetric(1.0d, AggregateFunction.RANK)).addPrivacyModel(new KAnonymity(5)).addPrivacyModel(new HierarchicalDistanceTCloseness("occupation", 0.2, Hierarchy.create("./data/adult_hierarchy_occupation.csv", StandardCharsets.UTF_8, ';'))), "occupation", "./data/adult.csv", "[0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0]", new int[] { 1, 4, 0, 2, 3, 2, 2, 1 }, false) },
                                              { new ARXAnonymizationTestCase(ARXConfiguration.create(1.0d, Metric.createLossMetric(1.0d, AggregateFunction.RANK)).addPrivacyModel(new KAnonymity(5)), "occupation", "./data/adult.csv", "[0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0]", new int[] { 1, 4, 0, 2, 3, 2, 2, 0 }, false) },
                                              { new ARXAnonymizationTestCase(ARXConfiguration.create(1.0d, Metric.createLossMetric(1.0d, AggregateFunction.RANK)).addPrivacyModel(new HierarchicalDistanceTCloseness("occupation", 0.2, Hierarchy.create("./data/adult_hierarchy_occupation.csv", StandardCharsets.UTF_8, ';'))), "occupation", "./data/adult.csv", "[0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0]", new int[] { 1, 4, 0, 2, 3, 2, 2, 1 }, false) },
                                              { new ARXAnonymizationTestCase(ARXConfiguration.create(1.0d, Metric.createLossMetric(1.0d, AggregateFunction.RANK)).addPrivacyModel(new RecursiveCLDiversity("occupation", 4.0, 5)), "occupation", "./data/adult.csv", "[0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0]", new int[] { 1, 4, 0, 2, 3, 2, 2, 0 }, false) },
                                              { new ARXAnonymizationTestCase(ARXConfiguration.create(0.05d, Metric.createLossMetric(1.0d, AggregateFunction.RANK)).addPrivacyModel(new KAnonymity(5)).addPrivacyModel(new HierarchicalDistanceTCloseness("occupation", 0.2, Hierarchy.create("./data/adult_hierarchy_occupation.csv", StandardCharsets.UTF_8, ';'))), "occupation", "./data/adult.csv", "[0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0]", new int[] { 1, 4, 0, 2, 3, 2, 2, 1 }, false) },
                                              { new ARXAnonymizationTestCase(ARXConfiguration.create(0.05d, Metric.createLossMetric(1.0d, AggregateFunction.RANK)).addPrivacyModel(new RecursiveCLDiversity("occupation", 4.0, 5)), "occupation", "./data/adult.csv", "[0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0]", new int[] { 1, 4, 0, 2, 3, 2, 2, 0 }, false) },
                                              { new ARXAnonymizationTestCase(ARXConfiguration.create(0.05d, Metric.createLossMetric(1.0d, AggregateFunction.RANK)).addPrivacyModel(new KAnonymity(5)).addPrivacyModel(new HierarchicalDistanceTCloseness("occupation", 0.2, Hierarchy.create("./data/adult_hierarchy_occupation.csv", StandardCharsets.UTF_8, ';'))), "occupation", "./data/adult.csv", "[0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0]", new int[] { 1, 4, 0, 2, 3, 2, 2, 1 }, false) },
                                              { new ARXAnonymizationTestCase(ARXConfiguration.create(0.05d, Metric.createLossMetric(1.0d, AggregateFunction.RANK)).addPrivacyModel(new RecursiveCLDiversity("occupation", 4.0, 5)), "occupation", "./data/adult.csv", "[0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0]", new int[] { 1, 4, 0, 2, 3, 2, 2, 0 }, false) },
                                              { new ARXAnonymizationTestCase(ARXConfiguration.create(0.05d, Metric.createLossMetric(1.0d, AggregateFunction.RANK)).addPrivacyModel(new HierarchicalDistanceTCloseness("occupation", 0.2, Hierarchy.create("./data/adult_hierarchy_occupation.csv", StandardCharsets.UTF_8, ';'))), "occupation", "./data/adult.csv", "[0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0]", new int[] { 1, 4, 0, 2, 3, 2, 2, 1 }, false) },
                                              { new ARXAnonymizationTestCase(ARXConfiguration.create(0.05d, Metric.createLossMetric(1.0d, AggregateFunction.RANK)).addPrivacyModel(new HierarchicalDistanceTCloseness("occupation", 0.2, Hierarchy.create("./data/adult_hierarchy_occupation.csv", StandardCharsets.UTF_8, ';'))), "occupation", "./data/adult.csv", "[0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0]", new int[] { 1, 4, 0, 2, 3, 2, 2, 1 }, false) },
                                              /* 50 */{ weight(new ARXAnonymizationTestCase(ARXConfiguration.create(1.0d, Metric.createLossMetric(AggregateFunction.RANK)).addPrivacyModel(new KAnonymity(5)).addPrivacyModel(new HierarchicalDistanceTCloseness("occupation", 0.2, Hierarchy.create("./data/adult_hierarchy_occupation.csv", StandardCharsets.UTF_8, ';'))), "occupation", "./data/adult.csv", "[0.4444444444444444, 0.3789536502, 0.3663848550666667, 0.33608022844444446, 0.3333333333333333, 0.2947417279333333, 0.2222222222222222, 0.1111111111111111]", new int[] { 1, 4, 1, 2, 2, 1, 0, 0 }, false)) },
                                              { weight(new ARXAnonymizationTestCase(ARXConfiguration.create(1.0d, Metric.createLossMetric(AggregateFunction.RANK)).addPrivacyModel(new KAnonymity(5)), "occupation", "./data/adult.csv", "[0.1485312645, 0.11552431683333335, 0.1111111111111111, 0.099020843, 0.08251736916666667, 0.06932099024444444, 0.06601389533333334, 0.0495104215]", new int[] { 1, 3, 0, 0, 0, 0, 0, 0 }, false)) },
                                              { weight(new ARXAnonymizationTestCase(ARXConfiguration.create(1.0d, Metric.createLossMetric(AggregateFunction.RANK)).addPrivacyModel(new HierarchicalDistanceTCloseness("occupation", 0.2, Hierarchy.create("./data/adult_hierarchy_occupation.csv", StandardCharsets.UTF_8, ';'))), "occupation", "./data/adult.csv", "[0.4444444444444444, 0.3789536502, 0.3663848550666667, 0.33608022844444446, 0.3333333333333333, 0.2947417279333333, 0.2222222222222222, 0.1111111111111111]", new int[] { 1, 4, 1, 2, 2, 1, 0, 0 }, false)) },
                                              { weight(new ARXAnonymizationTestCase(ARXConfiguration.create(1.0d, Metric.createLossMetric(AggregateFunction.RANK)).addPrivacyModel(new RecursiveCLDiversity("occupation", 4.0, 5)), "occupation", "./data/adult.csv", "[0.2222222222222222, 0.19350814244444445, 0.1844373715, 0.14345128894444445, 0.12295824766666666, 0.1111111111111111, 0.0819721651111111, 0.06147912383333333]", new int[] { 1, 4, 0, 0, 1, 0, 0, 0 }, false)) },
                                              { weight(new ARXAnonymizationTestCase(ARXConfiguration.create(0.05d, Metric.createLossMetric(AggregateFunction.RANK)).addPrivacyModel(new KAnonymity(5)).addPrivacyModel(new HierarchicalDistanceTCloseness("occupation", 0.2, Hierarchy.create("./data/adult_hierarchy_occupation.csv", StandardCharsets.UTF_8, ';'))), "occupation", "./data/adult.csv", "[1.0, 0.7777777777777778, 0.3333333333333333, 0.2222222222222222, 0.22178016483333335, 0.20600362977777778, 0.2052615874, 0.1111111111111111]", new int[] { 1, 4, 1, 1, 2, 1, 2, 1 }, false)) },
                                              { weight(new ARXAnonymizationTestCase(ARXConfiguration.create(0.05d, Metric.createLossMetric(AggregateFunction.RANK)).addPrivacyModel(new RecursiveCLDiversity("occupation", 4.0, 5)), "occupation", "./data/adult.csv", "[0.24683008046666668, 0.2222222222222222, 0.21898169633333336, 0.20640884897777778, 0.20387905306666665, 0.1111111111111111, 0.0442941449, 0.014764714966666665]", new int[] { 1, 4, 0, 1, 2, 1, 1, 0 }, false)) },
                                              { weight(new ARXAnonymizationTestCase(ARXConfiguration.create(0.05d, Metric.createLossMetric(AggregateFunction.RANK)).addPrivacyModel(new KAnonymity(5)).addPrivacyModel(new HierarchicalDistanceTCloseness("occupation", 0.2, Hierarchy.create("./data/adult_hierarchy_occupation.csv", StandardCharsets.UTF_8, ';'))), "occupation", "./data/adult.csv", "[1.0, 0.7777777777777778, 0.3333333333333333, 0.2222222222222222, 0.22178016483333335, 0.20600362977777778, 0.2052615874, 0.1111111111111111]", new int[] { 1, 4, 1, 1, 2, 1, 2, 1 }, false)) },
                                              { weight(new ARXAnonymizationTestCase(ARXConfiguration.create(0.05d, Metric.createLossMetric(AggregateFunction.RANK)).addPrivacyModel(new RecursiveCLDiversity("occupation", 4.0, 5)), "occupation", "./data/adult.csv", "[0.24683008046666668, 0.2222222222222222, 0.21898169633333336, 0.20640884897777778, 0.20387905306666665, 0.1111111111111111, 0.0442941449, 0.014764714966666665]", new int[] { 1, 4, 0, 1, 2, 1, 1, 0 }, false)) },
                                              { weight(new ARXAnonymizationTestCase(ARXConfiguration.create(0.05d, Metric.createLossMetric(AggregateFunction.RANK)).addPrivacyModel(new HierarchicalDistanceTCloseness("occupation", 0.2, Hierarchy.create("./data/adult_hierarchy_occupation.csv", StandardCharsets.UTF_8, ';'))), "occupation", "./data/adult.csv", "[1.0, 0.7777777777777778, 0.3333333333333333, 0.2222222222222222, 0.22178016483333335, 0.20600362977777778, 0.2052615874, 0.1111111111111111]", new int[] { 1, 4, 1, 1, 2, 1, 2, 1 }, false)) },
                                              { weight(new ARXAnonymizationTestCase(ARXConfiguration.create(0.05d, Metric.createLossMetric(AggregateFunction.RANK)).addPrivacyModel(new HierarchicalDistanceTCloseness("occupation", 0.2, Hierarchy.create("./data/adult_hierarchy_occupation.csv", StandardCharsets.UTF_8, ';'))), "occupation", "./data/adult.csv", "[1.0, 0.7777777777777778, 0.3333333333333333, 0.2222222222222222, 0.22178016483333335, 0.20600362977777778, 0.2052615874, 0.1111111111111111]", new int[] { 1, 4, 1, 1, 2, 1, 2, 1 }, false)) },
                                              /* 60 */{ weight(new ARXAnonymizationTestCase(ARXConfiguration.create(1.0d, Metric.createLossMetric(0.0d, AggregateFunction.RANK)).addPrivacyModel(new KAnonymity(5)).addPrivacyModel(new HierarchicalDistanceTCloseness("occupation", 0.2, Hierarchy.create("./data/adult_hierarchy_occupation.csv", StandardCharsets.UTF_8, ';'))), "occupation", "./data/adult.csv", "[0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0]", new int[] { 0, 0, 0, 0, 0, 0, 0, 0 }, false)) },
                                              { weight(new ARXAnonymizationTestCase(ARXConfiguration.create(1.0d, Metric.createLossMetric(0.0d, AggregateFunction.RANK)).addPrivacyModel(new KAnonymity(5)), "occupation", "./data/adult.csv", "[0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0]", new int[] { 0, 0, 0, 0, 0, 0, 0, 0 }, false)) },
                                              { weight(new ARXAnonymizationTestCase(ARXConfiguration.create(1.0d, Metric.createLossMetric(0.0d, AggregateFunction.RANK)).addPrivacyModel(new HierarchicalDistanceTCloseness("occupation", 0.2, Hierarchy.create("./data/adult_hierarchy_occupation.csv", StandardCharsets.UTF_8, ';'))), "occupation", "./data/adult.csv", "[0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0]", new int[] { 0, 0, 0, 0, 0, 0, 0, 0 }, false)) },
                                              { weight(new ARXAnonymizationTestCase(ARXConfiguration.create(1.0d, Metric.createLossMetric(0.0d, AggregateFunction.RANK)).addPrivacyModel(new RecursiveCLDiversity("occupation", 4.0, 5)), "occupation", "./data/adult.csv", "[0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0]", new int[] { 0, 0, 0, 0, 0, 0, 0, 0 }, false)) },
                                              { weight(new ARXAnonymizationTestCase(ARXConfiguration.create(0.05d, Metric.createLossMetric(0.0d, AggregateFunction.RANK)).addPrivacyModel(new KAnonymity(5)).addPrivacyModel(new HierarchicalDistanceTCloseness("occupation", 0.2, Hierarchy.create("./data/adult_hierarchy_occupation.csv", StandardCharsets.UTF_8, ';'))), "occupation", "./data/adult.csv", "[1.0, 0.7777777777777778, 0.3333333333333333, 0.2222222222222222, 0.2037626446666667, 0.1925159692888889, 0.18191709213333332, 0.1111111111111111]", new int[] { 1, 4, 1, 1, 2, 1, 2, 1 }, false)) },
                                              { weight(new ARXAnonymizationTestCase(ARXConfiguration.create(0.05d, Metric.createLossMetric(0.0d, AggregateFunction.RANK)).addPrivacyModel(new RecursiveCLDiversity("occupation", 4.0, 5)), "occupation", "./data/adult.csv", "[0.2222222222222222, 0.22217064885555557, 0.2037626446666667, 0.1925159692888889, 0.18191709213333332, 0.1111111111111111, 0.0, 0.0]", new int[] { 1, 4, 0, 1, 2, 1, 1, 0 }, false)) },
                                              { weight(new ARXAnonymizationTestCase(ARXConfiguration.create(0.05d, Metric.createLossMetric(0.0d, AggregateFunction.RANK)).addPrivacyModel(new KAnonymity(5)).addPrivacyModel(new HierarchicalDistanceTCloseness("occupation", 0.2, Hierarchy.create("./data/adult_hierarchy_occupation.csv", StandardCharsets.UTF_8, ';'))), "occupation", "./data/adult.csv", "[1.0, 0.7777777777777778, 0.3333333333333333, 0.2222222222222222, 0.2037626446666667, 0.1925159692888889, 0.18191709213333332, 0.1111111111111111]", new int[] { 1, 4, 1, 1, 2, 1, 2, 1 }, false)) },
                                              { weight(new ARXAnonymizationTestCase(ARXConfiguration.create(0.05d, Metric.createLossMetric(0.0d, AggregateFunction.RANK)).addPrivacyModel(new RecursiveCLDiversity("occupation", 4.0, 5)), "occupation", "./data/adult.csv", "[0.2222222222222222, 0.22217064885555557, 0.2037626446666667, 0.1925159692888889, 0.18191709213333332, 0.1111111111111111, 0.0, 0.0]", new int[] { 1, 4, 0, 1, 2, 1, 1, 0 }, false)) },
                                              { weight(new ARXAnonymizationTestCase(ARXConfiguration.create(0.05d, Metric.createLossMetric(0.0d, AggregateFunction.RANK)).addPrivacyModel(new HierarchicalDistanceTCloseness("occupation", 0.2, Hierarchy.create("./data/adult_hierarchy_occupation.csv", StandardCharsets.UTF_8, ';'))), "occupation", "./data/adult.csv", "[1.0, 0.7777777777777778, 0.3333333333333333, 0.2222222222222222, 0.2037626446666667, 0.1925159692888889, 0.18191709213333332, 0.1111111111111111]", new int[] { 1, 4, 1, 1, 2, 1, 2, 1 }, false)) },
                                              { weight(new ARXAnonymizationTestCase(ARXConfiguration.create(0.05d, Metric.createLossMetric(0.0d, AggregateFunction.RANK)).addPrivacyModel(new HierarchicalDistanceTCloseness("occupation", 0.2, Hierarchy.create("./data/adult_hierarchy_occupation.csv", StandardCharsets.UTF_8, ';'))), "occupation", "./data/adult.csv", "[1.0, 0.7777777777777778, 0.3333333333333333, 0.2222222222222222, 0.2037626446666667, 0.1925159692888889, 0.18191709213333332, 0.1111111111111111]", new int[] { 1, 4, 1, 1, 2, 1, 2, 1 }, false)) },
                                              /* 70 */{ weight(new ARXAnonymizationTestCase(ARXConfiguration.create(1.0d, Metric.createLossMetric(0.33d, AggregateFunction.RANK)).addPrivacyModel(new KAnonymity(5)).addPrivacyModel(new HierarchicalDistanceTCloseness("occupation", 0.2, Hierarchy.create("./data/adult_hierarchy_occupation.csv", StandardCharsets.UTF_8, ';'))), "occupation", "./data/adult.csv", "[0.3347921225, 0.3333333333333333, 0.3221498721666667, 0.2937121764444444, 0.26039387305555556, 0.22319474833333333, 0.2222222222222222, 0.1111111111111111]", new int[] { 1, 4, 1, 1, 2, 0, 0, 0 }, false)) },
                                              { weight(new ARXAnonymizationTestCase(ARXConfiguration.create(1.0d, Metric.createLossMetric(0.33d, AggregateFunction.RANK)).addPrivacyModel(new KAnonymity(5)), "occupation", "./data/adult.csv", "[0.1111111111111111, 0.0980306345, 0.07624604905555556, 0.06535375633333333, 0.06025241473333332, 0.054461463611111115, 0.04356917088888889, 0.032676878166666666]", new int[] { 1, 3, 0, 0, 0, 0, 0, 0 }, false)) },
                                              { weight(new ARXAnonymizationTestCase(ARXConfiguration.create(1.0d, Metric.createLossMetric(0.33d, AggregateFunction.RANK)).addPrivacyModel(new HierarchicalDistanceTCloseness("occupation", 0.2, Hierarchy.create("./data/adult_hierarchy_occupation.csv", StandardCharsets.UTF_8, ';'))), "occupation", "./data/adult.csv", "[0.3347921225, 0.3333333333333333, 0.3221498721666667, 0.2937121764444444, 0.26039387305555556, 0.22319474833333333, 0.2222222222222222, 0.1111111111111111]", new int[] { 1, 4, 1, 1, 2, 0, 0, 0 }, false)) },
                                              { weight(new ARXAnonymizationTestCase(ARXConfiguration.create(1.0d, Metric.createLossMetric(0.33d, AggregateFunction.RANK)).addPrivacyModel(new RecursiveCLDiversity("occupation", 4.0, 5)), "occupation", "./data/adult.csv", "[0.17589341011111112, 0.1484026258, 0.11542426451111111, 0.1111111111111111, 0.09893508386666666, 0.06929789015555556, 0.06595672257777777, 0.04946754193333333]", new int[] { 1, 3, 0, 0, 1, 0, 0, 0 }, false)) },
                                              { weight(new ARXAnonymizationTestCase(ARXConfiguration.create(0.05d, Metric.createLossMetric(0.33d, AggregateFunction.RANK)).addPrivacyModel(new KAnonymity(5)).addPrivacyModel(new HierarchicalDistanceTCloseness("occupation", 0.2, Hierarchy.create("./data/adult_hierarchy_occupation.csv", StandardCharsets.UTF_8, ';'))), "occupation", "./data/adult.csv", "[1.0, 0.7777777777777778, 0.3333333333333333, 0.2222222222222222, 0.21565420800000001, 0.20141782519999998, 0.19732445899999998, 0.1111111111111111]", new int[] { 1, 4, 1, 1, 2, 1, 2, 1 }, false)) },
                                              { weight(new ARXAnonymizationTestCase(ARXConfiguration.create(0.05d, Metric.createLossMetric(0.33d, AggregateFunction.RANK)).addPrivacyModel(new RecursiveCLDiversity("occupation", 4.0, 5)), "occupation", "./data/adult.csv", "[0.23844587371111114, 0.2222222222222222, 0.21380721877777778, 0.2016852699111111, 0.19641198633333334, 0.1111111111111111, 0.0292341356, 0.009744711866666665]", new int[] { 1, 4, 0, 1, 2, 1, 1, 0 }, false)) },
                                              { weight(new ARXAnonymizationTestCase(ARXConfiguration.create(0.05d, Metric.createLossMetric(0.33d, AggregateFunction.RANK)).addPrivacyModel(new KAnonymity(5)).addPrivacyModel(new HierarchicalDistanceTCloseness("occupation", 0.2, Hierarchy.create("./data/adult_hierarchy_occupation.csv", StandardCharsets.UTF_8, ';'))), "occupation", "./data/adult.csv", "[1.0, 0.7777777777777778, 0.3333333333333333, 0.2222222222222222, 0.21565420800000001, 0.20141782519999998, 0.19732445899999998, 0.1111111111111111]", new int[] { 1, 4, 1, 1, 2, 1, 2, 1 }, false)) },
                                              { weight(new ARXAnonymizationTestCase(ARXConfiguration.create(0.05d, Metric.createLossMetric(0.33d, AggregateFunction.RANK)).addPrivacyModel(new RecursiveCLDiversity("occupation", 4.0, 5)), "occupation", "./data/adult.csv", "[0.23844587371111114, 0.2222222222222222, 0.21380721877777778, 0.2016852699111111, 0.19641198633333334, 0.1111111111111111, 0.0292341356, 0.009744711866666665]", new int[] { 1, 4, 0, 1, 2, 1, 1, 0 }, false)) },
                                              { weight(new ARXAnonymizationTestCase(ARXConfiguration.create(0.05d, Metric.createLossMetric(0.33d, AggregateFunction.RANK)).addPrivacyModel(new HierarchicalDistanceTCloseness("occupation", 0.2, Hierarchy.create("./data/adult_hierarchy_occupation.csv", StandardCharsets.UTF_8, ';'))), "occupation", "./data/adult.csv", "[1.0, 0.7777777777777778, 0.3333333333333333, 0.2222222222222222, 0.21565420800000001, 0.20141782519999998, 0.19732445899999998, 0.1111111111111111]", new int[] { 1, 4, 1, 1, 2, 1, 2, 1 }, false)) },
                                              { weight(new ARXAnonymizationTestCase(ARXConfiguration.create(0.05d, Metric.createLossMetric(0.33d, AggregateFunction.RANK)).addPrivacyModel(new HierarchicalDistanceTCloseness("occupation", 0.2, Hierarchy.create("./data/adult_hierarchy_occupation.csv", StandardCharsets.UTF_8, ';'))), "occupation", "./data/adult.csv", "[1.0, 0.7777777777777778, 0.3333333333333333, 0.2222222222222222, 0.21565420800000001, 0.20141782519999998, 0.19732445899999998, 0.1111111111111111]", new int[] { 1, 4, 1, 1, 2, 1, 2, 1 }, false)) },
                                              /* 80 */{ weight(new ARXAnonymizationTestCase(ARXConfiguration.create(1.0d, Metric.createLossMetric(0.66d, AggregateFunction.RANK)).addPrivacyModel(new KAnonymity(5)).addPrivacyModel(new HierarchicalDistanceTCloseness("occupation", 0.2, Hierarchy.create("./data/adult_hierarchy_occupation.csv", StandardCharsets.UTF_8, ';'))), "occupation", "./data/adult.csv", "[0.3464209077, 0.3371457514222222, 0.3188449041, 0.2965677142, 0.26842763033333333, 0.24924011159999998, 0.1734528950888889, 0.07441588708888888]", new int[] { 1, 4, 1, 2, 2, 1, 1, 0 }, false)) },
                                              { weight(new ARXAnonymizationTestCase(ARXConfiguration.create(1.0d, Metric.createLossMetric(0.66d, AggregateFunction.RANK)).addPrivacyModel(new KAnonymity(5)), "occupation", "./data/adult.csv", "[0.12176904994444444, 0.1045686625, 0.08133118194444446, 0.06971244166666667, 0.06287238585555556, 0.04912232613333333, 0.04647496111111111, 0.03485622083333333]", new int[] { 1, 3, 0, 0, 1, 0, 0, 0 }, false)) },
                                              { weight(new ARXAnonymizationTestCase(ARXConfiguration.create(1.0d, Metric.createLossMetric(0.66d, AggregateFunction.RANK)).addPrivacyModel(new HierarchicalDistanceTCloseness("occupation", 0.2, Hierarchy.create("./data/adult_hierarchy_occupation.csv", StandardCharsets.UTF_8, ';'))), "occupation", "./data/adult.csv", "[0.3464209077, 0.3371457514222222, 0.3188449041, 0.2965677142, 0.26842763033333333, 0.24924011159999998, 0.1734528950888889, 0.07441588708888888]", new int[] { 1, 4, 1, 2, 2, 1, 1, 0 }, false)) },
                                              { weight(new ARXAnonymizationTestCase(ARXConfiguration.create(1.0d, Metric.createLossMetric(0.66d, AggregateFunction.RANK)).addPrivacyModel(new RecursiveCLDiversity("occupation", 4.0, 5)), "occupation", "./data/adult.csv", "[0.17255542997777776, 0.15402124916666668, 0.15379561604444444, 0.14714623919999997, 0.14022870031111112, 0.05962527379999999, 0.0442941449, 0.014764714966666665]", new int[] { 1, 4, 0, 1, 2, 1, 1, 0 }, false)) },
                                              { weight(new ARXAnonymizationTestCase(ARXConfiguration.create(0.05d, Metric.createLossMetric(0.66d, AggregateFunction.RANK)).addPrivacyModel(new KAnonymity(5)).addPrivacyModel(new HierarchicalDistanceTCloseness("occupation", 0.2, Hierarchy.create("./data/adult_hierarchy_occupation.csv", StandardCharsets.UTF_8, ';'))), "occupation", "./data/adult.csv", "[0.5151515151, 0.5057680631111111, 0.4497354497333333, 0.36988685811111116, 0.2098765432, 0.15062424484444442, 0.12428246119999999, 0.0]", new int[] { 0, 4, 1, 1, 3, 2, 2, 1 }, false)) },
                                              { weight(new ARXAnonymizationTestCase(ARXConfiguration.create(0.05d, Metric.createLossMetric(0.66d, AggregateFunction.RANK)).addPrivacyModel(new RecursiveCLDiversity("occupation", 4.0, 5)), "occupation", "./data/adult.csv", "[0.17255542997777776, 0.15402124916666668, 0.15379561604444444, 0.14714623919999997, 0.14022870031111112, 0.05962527379999999, 0.0442941449, 0.014764714966666665]", new int[] { 1, 4, 0, 1, 2, 1, 1, 0 }, false)) },
                                              { weight(new ARXAnonymizationTestCase(ARXConfiguration.create(0.05d, Metric.createLossMetric(0.66d, AggregateFunction.RANK)).addPrivacyModel(new KAnonymity(5)).addPrivacyModel(new HierarchicalDistanceTCloseness("occupation", 0.2, Hierarchy.create("./data/adult_hierarchy_occupation.csv", StandardCharsets.UTF_8, ';'))), "occupation", "./data/adult.csv", "[0.5151515151, 0.5057680631111111, 0.4497354497333333, 0.36988685811111116, 0.2098765432, 0.15062424484444442, 0.12428246119999999, 0.0]", new int[] { 0, 4, 1, 1, 3, 2, 2, 1 }, false)) },
                                              { weight(new ARXAnonymizationTestCase(ARXConfiguration.create(0.05d, Metric.createLossMetric(0.66d, AggregateFunction.RANK)).addPrivacyModel(new RecursiveCLDiversity("occupation", 4.0, 5)), "occupation", "./data/adult.csv", "[0.17255542997777776, 0.15402124916666668, 0.15379561604444444, 0.14714623919999997, 0.14022870031111112, 0.05962527379999999, 0.0442941449, 0.014764714966666665]", new int[] { 1, 4, 0, 1, 2, 1, 1, 0 }, false)) },
                                              { weight(new ARXAnonymizationTestCase(ARXConfiguration.create(0.05d, Metric.createLossMetric(0.66d, AggregateFunction.RANK)).addPrivacyModel(new HierarchicalDistanceTCloseness("occupation", 0.2, Hierarchy.create("./data/adult_hierarchy_occupation.csv", StandardCharsets.UTF_8, ';'))), "occupation", "./data/adult.csv", "[0.5151515151, 0.5057680631111111, 0.4497354497333333, 0.36988685811111116, 0.2098765432, 0.15062424484444442, 0.12428246119999999, 0.0]", new int[] { 0, 4, 1, 1, 3, 2, 2, 1 }, false)) },
                                              { weight(new ARXAnonymizationTestCase(ARXConfiguration.create(0.05d, Metric.createLossMetric(0.66d, AggregateFunction.RANK)).addPrivacyModel(new HierarchicalDistanceTCloseness("occupation", 0.2, Hierarchy.create("./data/adult_hierarchy_occupation.csv", StandardCharsets.UTF_8, ';'))), "occupation", "./data/adult.csv", "[0.5151515151, 0.5057680631111111, 0.4497354497333333, 0.36988685811111116, 0.2098765432, 0.15062424484444442, 0.12428246119999999, 0.0]", new int[] { 0, 4, 1, 1, 3, 2, 2, 1 }, false)) },
                                              /* 90 */{ weight(new ARXAnonymizationTestCase(ARXConfiguration.create(1.0d, Metric.createLossMetric(1.0d, AggregateFunction.RANK)).addPrivacyModel(new KAnonymity(5)).addPrivacyModel(new HierarchicalDistanceTCloseness("occupation", 0.2, Hierarchy.create("./data/adult_hierarchy_occupation.csv", StandardCharsets.UTF_8, ';'))), "occupation", "./data/adult.csv", "[0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0]", new int[] { 1, 4, 0, 2, 3, 2, 2, 1 }, false)) },
                                              { weight(new ARXAnonymizationTestCase(ARXConfiguration.create(1.0d, Metric.createLossMetric(1.0d, AggregateFunction.RANK)).addPrivacyModel(new KAnonymity(5)), "occupation", "./data/adult.csv", "[0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0]", new int[] { 1, 4, 0, 2, 3, 2, 2, 0 }, false)) },
                                              { weight(new ARXAnonymizationTestCase(ARXConfiguration.create(1.0d, Metric.createLossMetric(1.0d, AggregateFunction.RANK)).addPrivacyModel(new HierarchicalDistanceTCloseness("occupation", 0.2, Hierarchy.create("./data/adult_hierarchy_occupation.csv", StandardCharsets.UTF_8, ';'))), "occupation", "./data/adult.csv", "[0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0]", new int[] { 1, 4, 0, 2, 3, 2, 2, 1 }, false)) },
                                              { weight(new ARXAnonymizationTestCase(ARXConfiguration.create(1.0d, Metric.createLossMetric(1.0d, AggregateFunction.RANK)).addPrivacyModel(new RecursiveCLDiversity("occupation", 4.0, 5)), "occupation", "./data/adult.csv", "[0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0]", new int[] { 1, 4, 0, 2, 3, 2, 2, 0 }, false)) },
                                              { weight(new ARXAnonymizationTestCase(ARXConfiguration.create(0.05d, Metric.createLossMetric(1.0d, AggregateFunction.RANK)).addPrivacyModel(new KAnonymity(5)).addPrivacyModel(new HierarchicalDistanceTCloseness("occupation", 0.2, Hierarchy.create("./data/adult_hierarchy_occupation.csv", StandardCharsets.UTF_8, ';'))), "occupation", "./data/adult.csv", "[0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0]", new int[] { 1, 4, 0, 2, 3, 2, 2, 1 }, false)) },
                                              { weight(new ARXAnonymizationTestCase(ARXConfiguration.create(0.05d, Metric.createLossMetric(1.0d, AggregateFunction.RANK)).addPrivacyModel(new RecursiveCLDiversity("occupation", 4.0, 5)), "occupation", "./data/adult.csv", "[0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0]", new int[] { 1, 4, 0, 2, 3, 2, 2, 0 }, false)) },
                                              { weight(new ARXAnonymizationTestCase(ARXConfiguration.create(0.05d, Metric.createLossMetric(1.0d, AggregateFunction.RANK)).addPrivacyModel(new KAnonymity(5)).addPrivacyModel(new HierarchicalDistanceTCloseness("occupation", 0.2, Hierarchy.create("./data/adult_hierarchy_occupation.csv", StandardCharsets.UTF_8, ';'))), "occupation", "./data/adult.csv", "[0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0]", new int[] { 1, 4, 0, 2, 3, 2, 2, 1 }, false)) },
                                              { weight(new ARXAnonymizationTestCase(ARXConfiguration.create(0.05d, Metric.createLossMetric(1.0d, AggregateFunction.RANK)).addPrivacyModel(new RecursiveCLDiversity("occupation", 4.0, 5)), "occupation", "./data/adult.csv", "[0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0]", new int[] { 1, 4, 0, 2, 3, 2, 2, 0 }, false)) },
                                              { weight(new ARXAnonymizationTestCase(ARXConfiguration.create(0.05d, Metric.createLossMetric(1.0d, AggregateFunction.RANK)).addPrivacyModel(new HierarchicalDistanceTCloseness("occupation", 0.2, Hierarchy.create("./data/adult_hierarchy_occupation.csv", StandardCharsets.UTF_8, ';'))), "occupation", "./data/adult.csv", "[0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0]", new int[] { 1, 4, 0, 2, 3, 2, 2, 1 }, false)) },
                                              { weight(new ARXAnonymizationTestCase(ARXConfiguration.create(0.05d, Metric.createLossMetric(1.0d, AggregateFunction.RANK)).addPrivacyModel(new HierarchicalDistanceTCloseness("occupation", 0.2, Hierarchy.create("./data/adult_hierarchy_occupation.csv", StandardCharsets.UTF_8, ';'))), "occupation", "./data/adult.csv", "[0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0]", new int[] { 1, 4, 0, 2, 3, 2, 2, 1 }, false)) },
                                              
        });
    }
    
    /**
     * Apply weights to the test case.
     *
     * @param testcase
     * @return the test case passed to the method
     * @throws IOException
     */
    private static ARXAnonymizationTestCase weight(ARXAnonymizationTestCase testcase) throws IOException {
        
        // Create temporary data object
        Data data = Data.create(testcase.dataset, StandardCharsets.UTF_8, ';');
        DataHandle handle = data.getHandle();
        
        // Weight attributes according to their order in the dataset
        for (int i = 0; i < handle.getNumColumns(); i++) {
            testcase.config.setAttributeWeight(handle.getAttributeName(i), i + 1);
        }
        
        // Return argument
        return testcase;
    }
    
    /**
     * Creates a new instance.
     *
     * @param testCase
     */
    public TestUtilityMetricsLoss(final ARXAnonymizationTestCase testCase) {
        super(testCase);
    }
}
