// 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/junit/Asserts.java
// public class Asserts {
// 
//     public static void assertAnyOf(Object expected, Object... values) {
//         for (Object value : values) {
//             if (expected.equals(value)) {
//                 return;
//             }
//         }
//         fail(expected.toString() + " did not match any of "
//                 + Arrays.stream(values).map(Object::toString).collect(Collectors.joining(", "))
//                 + ".");
//     }
// 
//     public static void assertInstanceOf(Class<?> expectedClass, Object actualClass) {
//         Class<?> matchable = matchableClass(expectedClass);
//         assertTrue("Class " + actualClass.getClass().getSimpleName() + " is not an instance of " + expectedClass.getSimpleName(),
//                 matchable.isInstance(actualClass));
//     }
// 
//     private static Class<?> matchableClass(Class<?> expectedClass) {
//         if (boolean.class.equals(expectedClass)) return Boolean.class;
//         if (byte.class.equals(expectedClass)) return Byte.class;
//         if (char.class.equals(expectedClass)) return Character.class;
//         if (double.class.equals(expectedClass)) return Double.class;
//         if (float.class.equals(expectedClass)) return Float.class;
//         if (int.class.equals(expectedClass)) return Integer.class;
//         if (long.class.equals(expectedClass)) return Long.class;
//         if (short.class.equals(expectedClass)) return Short.class;
//         return expectedClass;
//     }
// }


import com.rolfje.anonimatron.synonyms.Synonym;
import com.rolfje.junit.Asserts;
import org.iban4j.CountryCode;
import org.iban4j.Iban;
import org.iban4j.bban.BbanStructure;
import org.junit.Test;
import java.util.EnumSet;
import static org.junit.Assert.assertEquals;
import static org.junit.Assert.fail;

package com.rolfje.anonimatron.anonymizer;




/**
 * Tests for {@link IbanAnonymizer}.
 *
 * @author Erik-Berndt Scheper
 */
public class IbanAnonymizerTest {

    private IbanAnonymizer anonymizer = new IbanAnonymizer();
    private EnumSet<CountryCode> countriesWithBankAccountAnonymizer = EnumSet
            .copyOf(IbanAnonymizer.BANK_ACCOUNT_ANONYMIZERS.keySet());
    private EnumSet<CountryCode> countriesWithoutBankAccountAnonymizer = EnumSet.complementOf(countriesWithBankAccountAnonymizer);

    @Test
    public void testAnonymizeForCountriesWithBankAccountAnonymizer() {
        for (CountryCode countryCode : countriesWithBankAccountAnonymizer) {
            testAnonymize(countryCode);
        }
    }

    @Test
    public void testAnonymizeForOtherCountries() {
        for (CountryCode countryCode : countriesWithoutBankAccountAnonymizer) {
            if (BbanStructure.forCountry(countryCode) != null) {
                testAnonymize(countryCode);
            }
        }
    }

    private void testAnonymize(CountryCode countryCode) {
        for (int i = 0; i < 1000; i++) {
            String from = anonymizer.generateIban(countryCode);


// 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/junit/Asserts.java
// public class Asserts {
// 
//     public static void assertAnyOf(Object expected, Object... values) {
//         for (Object value : values) {
//             if (expected.equals(value)) {
//                 return;
//             }
//         }
//         fail(expected.toString() + " did not match any of "
//                 + Arrays.stream(values).map(Object::toString).collect(Collectors.joining(", "))
//                 + ".");
//     }
// 
//     public static void assertInstanceOf(Class<?> expectedClass, Object actualClass) {
//         Class<?> matchable = matchableClass(expectedClass);
//         assertTrue("Class " + actualClass.getClass().getSimpleName() + " is not an instance of " + expectedClass.getSimpleName(),
//                 matchable.isInstance(actualClass));
//     }
// 
//     private static Class<?> matchableClass(Class<?> expectedClass) {
//         if (boolean.class.equals(expectedClass)) return Boolean.class;
//         if (byte.class.equals(expectedClass)) return Byte.class;
//         if (char.class.equals(expectedClass)) return Character.class;
//         if (double.class.equals(expectedClass)) return Double.class;
//         if (float.class.equals(expectedClass)) return Float.class;
//         if (int.class.equals(expectedClass)) return Integer.class;
//         if (long.class.equals(expectedClass)) return Long.class;
//         if (short.class.equals(expectedClass)) return Short.class;
//         return expectedClass;
//     }
// }


// Path: src/test/java/com/rolfje/anonimatron/anonymizer/IbanAnonymizerTest.java
import com.rolfje.anonimatron.synonyms.Synonym;
import com.rolfje.junit.Asserts;
import org.iban4j.CountryCode;
import org.iban4j.Iban;
import org.iban4j.bban.BbanStructure;
import org.junit.Test;
import java.util.EnumSet;
import static org.junit.Assert.assertEquals;
import static org.junit.Assert.fail;

package com.rolfje.anonimatron.anonymizer;




/**
 * Tests for {@link IbanAnonymizer}.
 *
 * @author Erik-Berndt Scheper
 */
public class IbanAnonymizerTest {

    private IbanAnonymizer anonymizer = new IbanAnonymizer();
    private EnumSet<CountryCode> countriesWithBankAccountAnonymizer = EnumSet
            .copyOf(IbanAnonymizer.BANK_ACCOUNT_ANONYMIZERS.keySet());
    private EnumSet<CountryCode> countriesWithoutBankAccountAnonymizer = EnumSet.complementOf(countriesWithBankAccountAnonymizer);

    @Test
    public void testAnonymizeForCountriesWithBankAccountAnonymizer() {
        for (CountryCode countryCode : countriesWithBankAccountAnonymizer) {
            testAnonymize(countryCode);
        }
    }

    @Test
    public void testAnonymizeForOtherCountries() {
        for (CountryCode countryCode : countriesWithoutBankAccountAnonymizer) {
            if (BbanStructure.forCountry(countryCode) != null) {
                testAnonymize(countryCode);
            }
        }
    }

    private void testAnonymize(CountryCode countryCode) {
        for (int i = 0; i < 1000; i++) {
            String from = anonymizer.generateIban(countryCode);


            Asserts.assertAnyOf(Iban.valueOf(from).getCountryCode(),
