// Path: src/main/java/com/rolfje/anonimatron/synonyms/Synonym.java
// public interface Synonym {
// 
// 	/**
// 	 * Indicates if this Synonym is short-lived or transient, meaning that
//      * it should not be stored in the synonyms file. Transient Synonyms
//      * are not stored, need to be calculated each run time.
// 	 *
// 	 * Transient synonyms are:
// 	 *
// 	 * <ol>
// 	 *     <li>Not stored in memory.</li>
// 	 *     <li>Not stored in the synonym file.</li>
// 	 * </ol>
// 	 *
// 	 * @return <code>true</code> if the synonym should be thrown away
// 	 * after use (not stored in the synonym file).
// 	 */
// 	boolean isShortLived();
// 
// 	/**
// 	 * @return The semantic data type of this Synonym, usually something
// 	 *         descriptive as "NAME" or "STREET".
// 	 */
// 	String getType();
// 
// 	/**
// 	 * @return The data which was in the original database for this Synonym
// 	 */
// 	Object getFrom();
// 
// 	/**
// 	 * 
// 	 * @return The data with which the original data in the database will be or
// 	 *         is replaced when the Anonymizer runs.
// 	 */
// 	Object getTo();
// }


import com.rolfje.anonimatron.synonyms.Synonym;
import junit.framework.TestCase;
import java.util.*;
import static org.junit.Assert.assertNotEquals;
package com.rolfje.anonimatron.anonymizer;




public class CountryCodeAnonymizerTest extends TestCase {

    private static final Set<String> ISO_3_COUNTRY_CODES = getISO3CountryCodes();

    public void testAnonymize() {

        testInternal(2, "EN");
        testInternal(3, "NLD");
        testInternal(4, "BLR");
    }

    private void testInternal(int size, String from) {
        CountryCodeAnonymizer countryCodeAnonymizer = new CountryCodeAnonymizer();
        Synonym nld = countryCodeAnonymizer.anonymize(from, size, false);
        assertEquals(countryCodeAnonymizer.getType(), nld.getType());
        assertEquals(from, nld.getFrom());
        assertNotEquals(from, nld.getTo());
        assertEquals(size, ((String) nld.getTo()).length());
        assertFalse(nld.isShortLived());
    }

    public void testThreeDigitCountryCodes_shouldAnonymizeToThreeDigitCountryCodes() {
        CountryCodeAnonymizer anonymizer = new CountryCodeAnonymizer();
        String countryCode = "NLD";
        for (int i = 0; i < 100; i++) {
// Path: src/main/java/com/rolfje/anonimatron/synonyms/Synonym.java
// public interface Synonym {
// 
// 	/**
// 	 * Indicates if this Synonym is short-lived or transient, meaning that
//      * it should not be stored in the synonyms file. Transient Synonyms
//      * are not stored, need to be calculated each run time.
// 	 *
// 	 * Transient synonyms are:
// 	 *
// 	 * <ol>
// 	 *     <li>Not stored in memory.</li>
// 	 *     <li>Not stored in the synonym file.</li>
// 	 * </ol>
// 	 *
// 	 * @return <code>true</code> if the synonym should be thrown away
// 	 * after use (not stored in the synonym file).
// 	 */
// 	boolean isShortLived();
// 
// 	/**
// 	 * @return The semantic data type of this Synonym, usually something
// 	 *         descriptive as "NAME" or "STREET".
// 	 */
// 	String getType();
// 
// 	/**
// 	 * @return The data which was in the original database for this Synonym
// 	 */
// 	Object getFrom();
// 
// 	/**
// 	 * 
// 	 * @return The data with which the original data in the database will be or
// 	 *         is replaced when the Anonymizer runs.
// 	 */
// 	Object getTo();
// }


// Path: src/test/java/com/rolfje/anonimatron/anonymizer/CountryCodeAnonymizerTest.java
import com.rolfje.anonimatron.synonyms.Synonym;
import junit.framework.TestCase;
import java.util.*;
import static org.junit.Assert.assertNotEquals;

package com.rolfje.anonimatron.anonymizer;




public class CountryCodeAnonymizerTest extends TestCase {

    private static final Set<String> ISO_3_COUNTRY_CODES = getISO3CountryCodes();

    public void testAnonymize() {

        testInternal(2, "EN");
        testInternal(3, "NLD");
        testInternal(4, "BLR");
    }

    private void testInternal(int size, String from) {
        CountryCodeAnonymizer countryCodeAnonymizer = new CountryCodeAnonymizer();
        Synonym nld = countryCodeAnonymizer.anonymize(from, size, false);
        assertEquals(countryCodeAnonymizer.getType(), nld.getType());
        assertEquals(from, nld.getFrom());
        assertNotEquals(from, nld.getTo());
        assertEquals(size, ((String) nld.getTo()).length());
        assertFalse(nld.isShortLived());
    }

    public void testThreeDigitCountryCodes_shouldAnonymizeToThreeDigitCountryCodes() {
        CountryCodeAnonymizer anonymizer = new CountryCodeAnonymizer();
        String countryCode = "NLD";
        for (int i = 0; i < 100; i++) {
            Synonym synonym = anonymizer.anonymize(countryCode, 3, false);