// 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 org.junit.Test;
import java.util.regex.Pattern;
import static org.junit.Assert.*;

package com.rolfje.anonimatron.anonymizer;




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

    private DutchZipCodeAnonymizer anonymizer = new DutchZipCodeAnonymizer();
    private Pattern pattern = Pattern.compile("[1-9][0-9]{3} ?(?!SA|SD|SS)[A-Z]{2}$");

    @Test
    public void anonymize() {
        for (int i = 0; i < 1000000; i++) {
            String from = anonymizer.buildZipCode();
            assertTrue(isValidZipCode(from));
            assertEquals(6, from.length());

            internalAnonymize(6, from);
        }
    }

    private void internalAnonymize(int size, String from) {

// 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/DutchZipCodeAnonymizerTest.java
import com.rolfje.anonimatron.synonyms.Synonym;
import org.junit.Test;
import java.util.regex.Pattern;
import static org.junit.Assert.*;

package com.rolfje.anonimatron.anonymizer;




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

    private DutchZipCodeAnonymizer anonymizer = new DutchZipCodeAnonymizer();
    private Pattern pattern = Pattern.compile("[1-9][0-9]{3} ?(?!SA|SD|SS)[A-Z]{2}$");

    @Test
    public void anonymize() {
        for (int i = 0; i < 1000000; i++) {
            String from = anonymizer.buildZipCode();
            assertTrue(isValidZipCode(from));
            assertEquals(6, from.length());

            internalAnonymize(6, from);
        }
    }

    private void internalAnonymize(int size, String from) {

        Synonym synonym = anonymizer.anonymize(from, size, false);
