garydgregory commented on code in PR #271:
URL: https://github.com/apache/commons-validator/pull/271#discussion_r1796056955


##########
src/test/java/org/apache/commons/validator/routines/SireneValidatorTest.java:
##########
@@ -0,0 +1,62 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You 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.apache.commons.validator.routines;
+
+import static org.junit.Assert.assertFalse;

Review Comment:
   Please use JUnit 5 `Assertions`, not JUnit 4 `Assert`.
   
   Please rebase on git master where I finished porting to JUnit 5; there was 
only one class left to do.
   



##########
src/main/java/org/apache/commons/validator/routines/checkdigit/VATidLVCheckDigit.java:
##########
@@ -0,0 +1,220 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You 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.apache.commons.validator.routines.checkdigit;
+
+import org.apache.commons.logging.Log;
+import org.apache.commons.logging.LogFactory;
+import org.apache.commons.validator.GenericTypeValidator;
+import org.apache.commons.validator.GenericValidator;
+import org.apache.commons.validator.routines.DateValidator;
+
+/**
+ * Latvian VAT identification number (VATIN) Check Digit 
calculation/validation.
+ * <p>
+ * pievienotāsvērtības nodokļa reģistrācijas numurs (PVN)
+ * - there are different calculations for legal persons and natural persons
+ * </p>
+ *
+ * @since 1.10.0
+ */
+public final class VATidLVCheckDigit extends ModulusCheckDigit {
+
+    private static final long serialVersionUID = -4171562329195981385L;
+    private static final Log LOG = LogFactory.getLog(VATidLVCheckDigit.class);
+
+    /** Singleton Check Digit instance */
+    private static final VATidLVCheckDigit INSTANCE = new VATidLVCheckDigit();
+
+    /**
+     * Gets the singleton instance of this validator.
+     * @return A singleton instance of the class.
+     */
+    public static CheckDigit getInstance() {
+        return INSTANCE;
+    }
+
+    private static final int LEN = 11;
+    /**
+     * Three is a legal person indicator.
+     * Codes starting with x > THREE are given to legal persons.
+     */
+    private static final int THREE = 3;
+    private static final String INVALID_CODE_NEGATIVE = "Invalid code, check 
digit cannot be negative";
+
+    /** Weighting given to digits depending on their left position */
+    private static final int[] POSITION_WEIGHT = { 9, 1, 4, 8, 3, 10, 2, 5, 7, 
6 };
+
+    /* TIN Weighting given to digits depending on their left position
+    c1 * 1 + c2 * 6 + c3 * 3 + c4 * 7 + c5 * 9 + c6 * 10 + c7 * 5 + c8 * 8 + 
c9 * 4 + c10 * 2;
+     9*C5   1*C1   4*C9   8*C8   3*C3   10*C6   2*C10  5*C7   7*C4   6*C2
+die POSITION_WEIGHT für TIN ist eine permutation von POSITION_WEIGHT für firmen
+A1 = 9*C1 + 1*C2 + 4*C3 + 8*C4 + 3*C5 + 10*C6 + 2*C7 + 5*C8 + 7*C9 + 6*C10
+     */
+//    private static final int[] TIN_POSITION_WEIGHT = { 1, 6, 3, 7, 9, 10, 5, 
8, 4, 2 };
+
+    /**
+     * Constructs a modulus 11 Check Digit routine.
+     */
+    private VATidLVCheckDigit() {
+        super(MODULUS_11);
+    }
+
+    /**
+     * Calculates the <i>weighted</i> value of a character in the
+     * code at a specified position.
+     *
+     * <p>For VATID digits are weighted by their position from left to 
right.</p>
+     *
+     * @param charValue The numeric value of the character.
+     * @param leftPos The position of the character in the code, counting from 
left to right
+     * @param rightPos The positionof the character in the code, counting from 
right to left
+     * @return The weighted value of the character.
+     */
+    @Override
+    protected int weightedValue(final int charValue, final int leftPos, final 
int rightPos) {
+        if (leftPos - 1 >= POSITION_WEIGHT.length) return 0;
+        final int weight = POSITION_WEIGHT[(leftPos - 1)];
+        return charValue * weight;
+    }
+
+    /**
+     * {@inheritDoc}
+     * <p>
+     * Overridden to calculate <em>Check Digit</em> for legal persons and 
natural persons.
+     * </p>
+     */
+    @Override
+    public String calculate(final String code) throws CheckDigitException {
+        if (GenericValidator.isBlankOrNull(code)) {
+            throw new CheckDigitException(CheckDigitException.MISSING_CODE);
+        }
+        if (GenericTypeValidator.formatLong(code) == 0) {
+            throw new CheckDigitException(CheckDigitException.ZERO_SUM);
+        }
+        final int c1 = toInt(code.charAt(0), 1, -1);
+        if (c1 > THREE) {
+            // Legal persons
+            final int modulusResult = calculateModulus(code, false);
+            final int charValue = 3 - modulusResult;
+            if (charValue == -1) {
+                throw new CheckDigitException(INVALID_CODE_NEGATIVE);
+            }
+            return toCheckDigit(charValue > -1 ? charValue : charValue + 
MODULUS_11);
+        }
+        // else natural person
+        return toCheckDigit(calculateNMIN(code, true));
+    }
+
+    /**
+     * Calculate a <em>Check Digit</em> for a natural person code.
+     *
+     * @param code without checkdigit
+     * @param invalidDateException, true for testing
+     * @return check digit
+     * @throws CheckDigitException
+     */
+    private int calculateNMIN(final String code, boolean invalidDateException) 
throws CheckDigitException {
+        if (code.length() != LEN - 1) {
+            throw new CheckDigitException("Invalid code, code.length()=" + 
code.length());
+        }
+        final int c1 = toInt(code.charAt(0), 1, -1);
+        final int c2 = toInt(code.charAt(1), 2, -1);
+        final int dd = 10 * c1 + c2;
+        if (dd > 0 && dd <= 31) { // CHECKSTYLE IGNORE MagicNumber
+            String mmborn = code.substring(2, 4); // CHECKSTYLE IGNORE 
MagicNumber
+            final int centuryInd = toInt(code.charAt(6), 7, -1);
+            String yyborn = code.substring(4, 6); // CHECKSTYLE IGNORE 
MagicNumber
+            if (centuryInd == 0) {
+                yyborn = "18" + yyborn;
+            } else if (centuryInd == 1) {
+                yyborn = "19" + yyborn;
+            } else if (centuryInd == 2) {
+                yyborn = "20" + yyborn;
+            } else {
+                yyborn = "??" + yyborn;
+            }
+            DateValidator dateValidator = new DateValidator();
+            String date = mmborn + "/" + String.format("%02d", dd) + "/" + 
yyborn;
+            if (dateValidator.validate(date, "MM/dd/yyyy") == null) {
+                if (invalidDateException) {
+                     throw new CheckDigitException("Invalid date " + date + " 
- Invalid NMIN " + code);
+                } else {
+                    LOG.warn("Invalid century indicator " + centuryInd + " or 
date " + date + " - Invalid NMIN " + code);
+                }
+            }
+            if (LOG.isDebugEnabled()) {
+                LOG.debug(code + " is NMIN (TIN) for a person born " + date);
+            }
+        }
+        int cd = vRule1(code);
+        if (cd == -1) {
+            throw new CheckDigitException(INVALID_CODE_NEGATIVE);
+        }
+        return cd;
+    }
+
+    /**
+     * {@inheritDoc}
+     * <p>
+     * Overridden to validate vatin codes for legal persons and natural 
persons.
+     * </p>
+     */
+    @Override
+    public boolean isValid(final String code) {
+        if (GenericValidator.isBlankOrNull(code)) {
+            return false;
+        }
+        if (code.length() != LEN) {
+            return false;
+        }
+        try {
+            final int c1 = toInt(code.charAt(0), 1, -1);
+            if (c1 > THREE) {
+                final int modulusResult = INSTANCE.calculateModulus(code, 
true);
+                final int charValue = 3 - modulusResult;
+                if (charValue == -1) {
+                    throw new CheckDigitException(INVALID_CODE_NEGATIVE);
+                }
+                final int cd = charValue > -1 ? charValue : charValue + 
MODULUS_11;
+                return cd == 
Character.getNumericValue(code.charAt(code.length() - 1));
+            }
+            int ccd = calculateNMIN(code.substring(0, LEN - 1), true);
+            return ccd == Character.getNumericValue(code.charAt(code.length() 
- 1));
+        } catch (final CheckDigitException ex) {
+            return false;
+        }
+    }
+
+    private int vRule1(String code) {

Review Comment:
   Use `final` where you can, throughout the PR.



##########
src/test/java/org/apache/commons/validator/routines/VATINValidatorTest.java:
##########
@@ -0,0 +1,251 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You 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.apache.commons.validator.routines;
+
+import static org.hamcrest.MatcherAssert.assertThat;
+import static org.hamcrest.core.Is.is;
+import static org.hamcrest.core.IsEqual.equalTo;
+import static org.junit.jupiter.api.Assertions.assertEquals;
+import static org.junit.jupiter.api.Assertions.assertFalse;
+import static org.junit.jupiter.api.Assertions.assertNotNull;
+import static org.junit.jupiter.api.Assertions.assertNull;
+import static org.junit.jupiter.api.Assertions.assertThrows;
+import static org.junit.jupiter.api.Assertions.assertTrue;
+import static org.junit.jupiter.api.Assertions.fail;
+
+import org.apache.commons.validator.routines.VATINValidator.Validator;
+import org.junit.jupiter.api.Test;
+
+/**
+ * Tests {@link VATINValidator}.
+ */
+public class VATINValidatorTest {
+
+    private static final VATINValidator VALIDATOR = 
VATINValidator.getInstance();
+
+    // Eclipse 3.6 allows you to turn off formatting by placing a special 
comment, like

Review Comment:
   You don't need a comment about Eclipse. We use this `formatter` comment all 
over Commons 😉 



##########
src/main/java/org/apache/commons/validator/routines/checkdigit/TidDECheckDigit.java:
##########
@@ -0,0 +1,119 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You 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.apache.commons.validator.routines.checkdigit;
+
+import org.apache.commons.logging.Log;
+import org.apache.commons.logging.LogFactory;
+
+/**
+ * German Steuer-Identifikationsnummer (TIN – in short: IdNr.) is available 
since 2008,
+ * has a length of 11 digits and it applies to individual persons.
+ *
+ * <p>
+ * See <a 
href="https://download.elster.de/download/schnittstellen/Pruefung_der_Steuer_und_Steueridentifikatsnummer.pdf";>Prüfung
 der Steuer- und Steueridentifikationsnummer (de)</a>
+ * for more details.
+ * </p>
+ *
+ * @since 1.10.0
+ */
+public final class TidDECheckDigit extends Modulus11TenCheckDigit {
+
+    private static final long serialVersionUID = 4222306963463322195L;
+    private static final Log LOG = LogFactory.getLog(TidDECheckDigit.class);
+
+    /** Singleton Check Digit instance */
+    private static final TidDECheckDigit INSTANCE = new TidDECheckDigit();
+
+    /**
+     * Gets the singleton instance of this validator.
+     * @return A singleton instance of the class.
+     */
+    public static CheckDigit getInstance() {
+        return INSTANCE;
+    }
+
+    /**
+     * Constructs a modulus Check Digit routine.
+     */
+    private TidDECheckDigit() {
+        super();
+    }
+
+    /**
+     * {@inheritDoc} <br>

Review Comment:
   Don't leave HTML tags open. You have paragraphs below, this break is likely 
not needed.
   



##########
src/test/java/org/apache/commons/validator/routines/VATINValidatorTest.java:
##########
@@ -0,0 +1,251 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You 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.apache.commons.validator.routines;
+
+import static org.hamcrest.MatcherAssert.assertThat;
+import static org.hamcrest.core.Is.is;
+import static org.hamcrest.core.IsEqual.equalTo;
+import static org.junit.jupiter.api.Assertions.assertEquals;
+import static org.junit.jupiter.api.Assertions.assertFalse;
+import static org.junit.jupiter.api.Assertions.assertNotNull;
+import static org.junit.jupiter.api.Assertions.assertNull;
+import static org.junit.jupiter.api.Assertions.assertThrows;
+import static org.junit.jupiter.api.Assertions.assertTrue;
+import static org.junit.jupiter.api.Assertions.fail;
+
+import org.apache.commons.validator.routines.VATINValidator.Validator;
+import org.junit.jupiter.api.Test;
+
+/**
+ * Tests {@link VATINValidator}.
+ */
+public class VATINValidatorTest {
+
+    private static final VATINValidator VALIDATOR = 
VATINValidator.getInstance();
+
+    // Eclipse 3.6 allows you to turn off formatting by placing a special 
comment, like
+    // @formatter:off
+    private static final String[] VALID_VATIN_FIXTURES = {
+            "ATU10223006",  // see BMF_UID_Konstruktionsregeln
+            "ATU13585627",  // see 
http://www.pruefziffernberechnung.de/U/USt-IdNr.shtml#PZAT
+            "ATU54065602",  // https://zukunftsregion-steyr.at/impressum
+            "BE0136695962", // see 
http://www.pruefziffernberechnung.de/U/USt-IdNr.shtml#PZBE (neues Format)
+            "BE0776091951", // see BMF_UID_Konstruktionsregeln
+            "BG831650349",  // (Nestlé) НЕСТЛЕ БЪЛГАРИЯ - АД
+            "BG8001010008", // a male person born 01.01.1980
+            "CY30010823A",  // LIDL Cyprus
+            "CZ29042828",   // legal entity SVĚT KÁVOVARŮ s.r.o., STRANČICE
+            "CZ6852294449", // physical person
+            "DE000000011",  // theoretical minimum
+            "DE136695976",  // see 
http://www.pruefziffernberechnung.de/U/USt-IdNr.shtml#PZDE
+            "DK88146328",   // see BMF_UID_Konstruktionsregeln
+            "DK13585628",   // see 
http://www.pruefziffernberechnung.de/U/USt-IdNr.shtml#PZDK
+            "EE101571629",   // Kaubamaja AS, Tallinn
+            "EE100594102",   // MOVEK GRUPP
+            "EL998537832",   // TRYGONS ΑΕ
+            "EL094327684",   // GENERALI HELLAS Α Α Ε
+            "ESA60195278",   // LIDL SUPERMERCADOS, S.A.U.
+            "ES54362315K",   // Españoles con DNI
+            "ESB58378431",   // Sociedades de responsabilidad limitada
+            "ESX2482300W",   // Extranjeros residentes
+            "ESW8265365J",   // Establecimientos permanentes de entidades no 
residentes en España
+            "FI13669598",    // see 
http://www.pruefziffernberechnung.de/U/USt-IdNr.shtml#PZFI
+            "FI01745928",    // see 
https://tarkistusmerkit.teppovuori.fi/tarkmerk.htm#y-tunnus2
+            "FI09853608",    // see BMF_UID_Konstruktionsregeln
+            "FR40303265045", // SA SODIMAS; Adresse 11 RUE AMPERE, 26600 PONT 
DE L ISERE
+            "FRK7399859412", // SLRL ALTEA EXPERTISE COMPTABLE
+            "FR06399859412", "FRB0399859412", "FRY0399859412", 
"FRB1399859412", // not unique check digit
+            "FRT1399859412", "FRH2399859412", "FRN2399859412", 
"FRC3399859412", "FRU3399859412",
+            "FRZ3399859412", "FRJ4399859412", "FRP4399859412", 
"FRD5399859412", "FRJ5399859412",
+            "FRQ6399859412", "FRV6399859412", "FRE7399859412", 
"FRR8399859412", "FRW8399859412",
+            "FRL9399859412", "FRR9399859412", "FR0J399859412", 
"FR1J399859412", "FR2K399859412",
+            "FR3K399859412", "FR4K399859412", "FR5K399859412", 
"FR6K399859412", "FR6L399859412",
+            "FR7L399859412", "FR8L399859412", "FR9L399859412", 
"FR0W399859412", "FR1X399859412",
+            "FR2X399859412", "FR3X399859412", "FR4X399859412", 
"FR5X399859412", "FR6Y399859412",
+            "FR7Y399859412", "FR8Y399859412", "FR9Y399859412",
+            "FR37000005990", "FR64000059252", "FR03000116300", // special 
cases Monaco (not EU) with French VATIN (invalid SIREN)
+            "HR33392005961",  // NASTAVNI ZAVOD ZA JAVNO ZDRAVSTVO DR. ANDRIJA 
ŠTA, Zagreb
+            "HU12892312",     // CNCEDU KERESKEDELMI ÉS SZOLGÁLTATÓ KORLÁTOLT 
FELELŐSSÉGŰ TÁRSASÁG
+            "IE6388047V",     // GOOGLE IRELAND LIMITED
+            "IE3628739UA",    // check digit next-to-last position
+            "IT00950501007",  // BANCA D'ITALIA
+            "IT02866820240",  // see https://www.valbruna-stainless-steel.com/
+            "LT582708716",    // ASIMA
+            "LT100014579016", // Senoji rotonda
+            "LU25180625",     // snct.lu
+            "LV40003567907",  // legal entity Pasažieru vilciens
+            "LV07091910933",  // Natural person, born 1919
+            "LV01010020932",  // Natural person, born 2000/01/01
+            "LV32053410932",  // Natural person, no birthday coded
+            "MT20200019",     // BAJADA NEW ENERGY LIMITED, MRS3000 Marsa
+            "NL003660564B01", // STAM + DE KONING BOUW B.V. EINDHOVEN
+            "NL004495445B01", // OPENJONGERENVERENIGING DE KOORNBEURS, DELFT
+            "PL1060000062",   // aus 
https://pl.wikipedia.org/wiki/Numer_identyfikacji_podatkowej
+            "PT510728189",    // CLARANET II SOLUTIONS, S.A. PORTO
+            "RO27825131",     // NUTRISOYA SRL
+            "RO6255950",      // P L NORIS SRL
+            "SE556680144401", // XLN Audio AB, STOCKHOLM
+            "SI21649405",     // STANOVANJSKO PODJETJE KONJICE D.O.O.
+            "SK2120567108",   // Markon s.r.o. Bratislava
+            "XI366303068",    // donnellygroup.co.uk, old style cd
+            "XI434031494",
+            "XI110305878",    // bullseyecountrysport.co.uk, new style
+            "XI174918964",
+            "XI174918964001", // with 3 digits for branch
+    };
+    // @formatter:on
+
+    // @formatter:off
+    private static final String[] INVALID_VATIN_FIXTURES = {
+            "",                        // empty
+            "   ",                     // empty
+            "A",                       // too short
+            "AB",                      // too short
+            "AT99999999",     // too short, missing U:ATU
+            "ATu99999999",    // lowercase U:ATU
+            "ATU9999999",     // too short
+            "BE136695962",    // aus 
http://www.pruefziffernberechnung.de/U/USt-IdNr.shtml#PZBE (altes 9-stelliges 
Format)
+            "CY61234567I",    // Must not start with 2,6,7,8
+            "DE00000000",     // too short
+            "EL94327684",     // zu kurz, führende Null fehlt, korrekt: 
EL094327684
+            "GB110305878",    // bullseyecountrysport.co.uk is from northern 
ireland
+            "GR023456780",    // falscher Prefix, sollte EL sein!
+            "ESA10215",       // too short
+            "LT100008668621", // C11 is not 1
+            "LV18097230924",  // invalid century
+            "NL004495445B00", // Suffix "00"
+            "RO027825131",    // Must not start with 0
+            "SE136695975523", // Must not end with 23
+            "SI00000019",     // Must not start with 0
+            "SK0000000011",   // Must not start with 0
+            "SK1111111111",   // 3rd digit must not be 1
+            "MC37000005990",  // No CheckDigit routine for Monaco
+    };
+    // @formatter:on
+
+    @Test
+    public void testGetRegexValidatortPatterns() {
+        
assertNotNull(VALIDATOR.getValidator("DE").getRegexValidator().getPatterns(), 
"DE");
+    }
+
+    @Test
+    public void testGetValidator() {
+        assertNotNull(VALIDATOR.getValidator("FI"), "FI");
+        assertNull(VALIDATOR.getValidator("fi"), "fi");
+    }
+
+    @Test
+    public void testHasValidator() {
+        assertTrue(VALIDATOR.hasValidator("FI"), "FI");
+        assertFalse(VALIDATOR.hasValidator("fi"), "fi");
+    }
+
+    @Test
+    public void testInValid() {
+        for (final String f : INVALID_VATIN_FIXTURES) {
+            assertFalse(VALIDATOR.isValid(f), f);
+        }
+    }
+
+    @Test
+    public void testNull() {
+        assertFalse(VALIDATOR.isValid(null), "isValid(null)");
+    }
+
+    @Test
+    public void testSetDefaultValidator1() {
+        final IllegalStateException thrown = 
assertThrows(IllegalStateException.class, () -> VALIDATOR.setValidator("GB", 
15, "GB", null));
+        assertThat(thrown.getMessage(), is(equalTo("The singleton validator 
cannot be modified")));

Review Comment:
   Please, not Hamcrest, not AssertJ, Java is verbose enough as it is without 
cluttering tests which should be as simple as possible to understand since they 
also serve to some extent as examples. This is so much simpler to read and 
maintain:
   ```
    assertEquals("The singleton validator cannot be modified", 
thrown.getMessage());
    ```
   There is absolutely no need for 2 extra method calls to assert this outcome.
   
   



##########
src/test/java/org/apache/commons/validator/routines/SireneValidatorTest.java:
##########
@@ -0,0 +1,62 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You 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.apache.commons.validator.routines;
+
+import static org.junit.Assert.assertFalse;
+import static org.junit.Assert.assertTrue;
+
+import org.junit.Test;
+
+public class SireneValidatorTest {
+
+    private final String[] validFormat = new String[] {

Review Comment:
   If you define these test fixtures with `Arrays.asList(...)`, you can use 
`forEach()` to reduce clutter in the tests. YMMV.



##########
src/test/java/org/apache/commons/validator/routines/VATINValidatorTest.java:
##########
@@ -0,0 +1,251 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You 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.apache.commons.validator.routines;
+
+import static org.hamcrest.MatcherAssert.assertThat;
+import static org.hamcrest.core.Is.is;
+import static org.hamcrest.core.IsEqual.equalTo;
+import static org.junit.jupiter.api.Assertions.assertEquals;
+import static org.junit.jupiter.api.Assertions.assertFalse;
+import static org.junit.jupiter.api.Assertions.assertNotNull;
+import static org.junit.jupiter.api.Assertions.assertNull;
+import static org.junit.jupiter.api.Assertions.assertThrows;
+import static org.junit.jupiter.api.Assertions.assertTrue;
+import static org.junit.jupiter.api.Assertions.fail;
+
+import org.apache.commons.validator.routines.VATINValidator.Validator;
+import org.junit.jupiter.api.Test;
+
+/**
+ * Tests {@link VATINValidator}.
+ */
+public class VATINValidatorTest {
+
+    private static final VATINValidator VALIDATOR = 
VATINValidator.getInstance();
+
+    // Eclipse 3.6 allows you to turn off formatting by placing a special 
comment, like
+    // @formatter:off
+    private static final String[] VALID_VATIN_FIXTURES = {
+            "ATU10223006",  // see BMF_UID_Konstruktionsregeln
+            "ATU13585627",  // see 
http://www.pruefziffernberechnung.de/U/USt-IdNr.shtml#PZAT
+            "ATU54065602",  // https://zukunftsregion-steyr.at/impressum
+            "BE0136695962", // see 
http://www.pruefziffernberechnung.de/U/USt-IdNr.shtml#PZBE (neues Format)
+            "BE0776091951", // see BMF_UID_Konstruktionsregeln
+            "BG831650349",  // (Nestlé) НЕСТЛЕ БЪЛГАРИЯ - АД
+            "BG8001010008", // a male person born 01.01.1980
+            "CY30010823A",  // LIDL Cyprus
+            "CZ29042828",   // legal entity SVĚT KÁVOVARŮ s.r.o., STRANČICE
+            "CZ6852294449", // physical person
+            "DE000000011",  // theoretical minimum
+            "DE136695976",  // see 
http://www.pruefziffernberechnung.de/U/USt-IdNr.shtml#PZDE
+            "DK88146328",   // see BMF_UID_Konstruktionsregeln
+            "DK13585628",   // see 
http://www.pruefziffernberechnung.de/U/USt-IdNr.shtml#PZDK
+            "EE101571629",   // Kaubamaja AS, Tallinn
+            "EE100594102",   // MOVEK GRUPP
+            "EL998537832",   // TRYGONS ΑΕ
+            "EL094327684",   // GENERALI HELLAS Α Α Ε
+            "ESA60195278",   // LIDL SUPERMERCADOS, S.A.U.
+            "ES54362315K",   // Españoles con DNI
+            "ESB58378431",   // Sociedades de responsabilidad limitada
+            "ESX2482300W",   // Extranjeros residentes
+            "ESW8265365J",   // Establecimientos permanentes de entidades no 
residentes en España
+            "FI13669598",    // see 
http://www.pruefziffernberechnung.de/U/USt-IdNr.shtml#PZFI
+            "FI01745928",    // see 
https://tarkistusmerkit.teppovuori.fi/tarkmerk.htm#y-tunnus2
+            "FI09853608",    // see BMF_UID_Konstruktionsregeln
+            "FR40303265045", // SA SODIMAS; Adresse 11 RUE AMPERE, 26600 PONT 
DE L ISERE
+            "FRK7399859412", // SLRL ALTEA EXPERTISE COMPTABLE
+            "FR06399859412", "FRB0399859412", "FRY0399859412", 
"FRB1399859412", // not unique check digit
+            "FRT1399859412", "FRH2399859412", "FRN2399859412", 
"FRC3399859412", "FRU3399859412",
+            "FRZ3399859412", "FRJ4399859412", "FRP4399859412", 
"FRD5399859412", "FRJ5399859412",
+            "FRQ6399859412", "FRV6399859412", "FRE7399859412", 
"FRR8399859412", "FRW8399859412",
+            "FRL9399859412", "FRR9399859412", "FR0J399859412", 
"FR1J399859412", "FR2K399859412",
+            "FR3K399859412", "FR4K399859412", "FR5K399859412", 
"FR6K399859412", "FR6L399859412",
+            "FR7L399859412", "FR8L399859412", "FR9L399859412", 
"FR0W399859412", "FR1X399859412",
+            "FR2X399859412", "FR3X399859412", "FR4X399859412", 
"FR5X399859412", "FR6Y399859412",
+            "FR7Y399859412", "FR8Y399859412", "FR9Y399859412",
+            "FR37000005990", "FR64000059252", "FR03000116300", // special 
cases Monaco (not EU) with French VATIN (invalid SIREN)
+            "HR33392005961",  // NASTAVNI ZAVOD ZA JAVNO ZDRAVSTVO DR. ANDRIJA 
ŠTA, Zagreb
+            "HU12892312",     // CNCEDU KERESKEDELMI ÉS SZOLGÁLTATÓ KORLÁTOLT 
FELELŐSSÉGŰ TÁRSASÁG
+            "IE6388047V",     // GOOGLE IRELAND LIMITED
+            "IE3628739UA",    // check digit next-to-last position
+            "IT00950501007",  // BANCA D'ITALIA
+            "IT02866820240",  // see https://www.valbruna-stainless-steel.com/
+            "LT582708716",    // ASIMA
+            "LT100014579016", // Senoji rotonda
+            "LU25180625",     // snct.lu
+            "LV40003567907",  // legal entity Pasažieru vilciens
+            "LV07091910933",  // Natural person, born 1919
+            "LV01010020932",  // Natural person, born 2000/01/01
+            "LV32053410932",  // Natural person, no birthday coded
+            "MT20200019",     // BAJADA NEW ENERGY LIMITED, MRS3000 Marsa
+            "NL003660564B01", // STAM + DE KONING BOUW B.V. EINDHOVEN
+            "NL004495445B01", // OPENJONGERENVERENIGING DE KOORNBEURS, DELFT
+            "PL1060000062",   // aus 
https://pl.wikipedia.org/wiki/Numer_identyfikacji_podatkowej
+            "PT510728189",    // CLARANET II SOLUTIONS, S.A. PORTO
+            "RO27825131",     // NUTRISOYA SRL
+            "RO6255950",      // P L NORIS SRL
+            "SE556680144401", // XLN Audio AB, STOCKHOLM
+            "SI21649405",     // STANOVANJSKO PODJETJE KONJICE D.O.O.
+            "SK2120567108",   // Markon s.r.o. Bratislava
+            "XI366303068",    // donnellygroup.co.uk, old style cd
+            "XI434031494",
+            "XI110305878",    // bullseyecountrysport.co.uk, new style
+            "XI174918964",
+            "XI174918964001", // with 3 digits for branch
+    };
+    // @formatter:on
+
+    // @formatter:off
+    private static final String[] INVALID_VATIN_FIXTURES = {
+            "",                        // empty
+            "   ",                     // empty
+            "A",                       // too short
+            "AB",                      // too short
+            "AT99999999",     // too short, missing U:ATU
+            "ATu99999999",    // lowercase U:ATU
+            "ATU9999999",     // too short
+            "BE136695962",    // aus 
http://www.pruefziffernberechnung.de/U/USt-IdNr.shtml#PZBE (altes 9-stelliges 
Format)
+            "CY61234567I",    // Must not start with 2,6,7,8
+            "DE00000000",     // too short
+            "EL94327684",     // zu kurz, führende Null fehlt, korrekt: 
EL094327684
+            "GB110305878",    // bullseyecountrysport.co.uk is from northern 
ireland
+            "GR023456780",    // falscher Prefix, sollte EL sein!
+            "ESA10215",       // too short
+            "LT100008668621", // C11 is not 1
+            "LV18097230924",  // invalid century
+            "NL004495445B00", // Suffix "00"
+            "RO027825131",    // Must not start with 0
+            "SE136695975523", // Must not end with 23
+            "SI00000019",     // Must not start with 0
+            "SK0000000011",   // Must not start with 0
+            "SK1111111111",   // 3rd digit must not be 1
+            "MC37000005990",  // No CheckDigit routine for Monaco
+    };
+    // @formatter:on
+
+    @Test
+    public void testGetRegexValidatortPatterns() {
+        
assertNotNull(VALIDATOR.getValidator("DE").getRegexValidator().getPatterns(), 
"DE");
+    }
+
+    @Test
+    public void testGetValidator() {
+        assertNotNull(VALIDATOR.getValidator("FI"), "FI");
+        assertNull(VALIDATOR.getValidator("fi"), "fi");
+    }
+
+    @Test
+    public void testHasValidator() {
+        assertTrue(VALIDATOR.hasValidator("FI"), "FI");
+        assertFalse(VALIDATOR.hasValidator("fi"), "fi");
+    }
+
+    @Test
+    public void testInValid() {
+        for (final String f : INVALID_VATIN_FIXTURES) {
+            assertFalse(VALIDATOR.isValid(f), f);
+        }
+    }
+
+    @Test
+    public void testNull() {
+        assertFalse(VALIDATOR.isValid(null), "isValid(null)");
+    }
+
+    @Test
+    public void testSetDefaultValidator1() {
+        final IllegalStateException thrown = 
assertThrows(IllegalStateException.class, () -> VALIDATOR.setValidator("GB", 
15, "GB", null));
+        assertThat(thrown.getMessage(), is(equalTo("The singleton validator 
cannot be modified")));
+    }
+
+    @Test
+    public void testSetDefaultValidator2() {
+        final IllegalStateException thrown = 
assertThrows(IllegalStateException.class, () -> VALIDATOR.setValidator("GB", 
-1, "GB", null));
+        assertThat(thrown.getMessage(), is(equalTo("The singleton validator 
cannot be modified")));
+    }
+
+    @Test
+    public void testSetValidatorLC() {
+        final VATINValidator validator = new VATINValidator();
+        final IllegalArgumentException thrown = 
assertThrows(IllegalArgumentException.class, () -> validator.setValidator("gb", 
15, "GB", null));
+        assertThat(thrown.getMessage(), is(equalTo("Invalid country Code; must 
be exactly 2 upper-case characters")));
+    }
+
+    @Test
+    public void testSetValidatorLen1() {
+        final VATINValidator validator = new VATINValidator();
+        assertNotNull(validator.setValidator("DE", -1, "", null), "should be 
present");
+        assertNull(validator.setValidator("DE", -1, "", null), "no longer 
present");
+    }
+
+    private static final String INVALID_LENGTH = "Invalid length parameter, 
must be in range 10 to 16 inclusive:";
+
+    @Test
+    public void testSetValidatorLen35() {
+        final VATINValidator validator = new VATINValidator();
+        final IllegalArgumentException thrown = 
assertThrows(IllegalArgumentException.class, () -> validator.setValidator("DE", 
35, "DE", null));
+//        System.out.println("testSetValidatorLen35 : thrown.getMessage():" + 
thrown.getMessage());

Review Comment:
   Remove comment.



##########
src/test/java/org/apache/commons/validator/routines/checkdigit/VATidFRCheckDigitTest.java:
##########
@@ -0,0 +1,132 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You 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.apache.commons.validator.routines.checkdigit;
+
+import static org.junit.jupiter.api.Assertions.assertFalse;
+
+import java.util.ArrayList;
+import java.util.Hashtable;
+import java.util.List;
+import java.util.Map;
+
+import org.junit.jupiter.api.BeforeEach;
+import org.junit.jupiter.api.Test;
+
+/**
+ * FR VAT Id Check Digit Tests.
+ */
+public class VATidFRCheckDigitTest extends AbstractCheckDigitTest {
+
+    /**
+     * Sets up routine & valid codes.
+     */
+    @BeforeEach
+    protected void setUp() {
+        checkDigitLth = VATidFRCheckDigit.CHECKDIGIT_LEN;
+        routine = VATidFRCheckDigit.getInstance();
+
+        valid = new String[] {"00300076965"
+            , "55502090897"
+            , "40303265045"
+            , "23334175221"
+            , "06399859412"
+//            , "K7399859412" // SLRL ALTEA EXPERTISE COMPTABLE => test in 
VATINValidatorTest
+            , "83404833048"
+            , "11123456782" // konstruiert: L'identifiant n'existe pas dans le 
répertoire Sirene.

Review Comment:
   This comment needs to be more helpful to maintainers, as it the one above.



##########
src/test/java/org/apache/commons/validator/routines/checkdigit/VATidFRCheckDigitTest.java:
##########
@@ -0,0 +1,132 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You 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.apache.commons.validator.routines.checkdigit;
+
+import static org.junit.jupiter.api.Assertions.assertFalse;
+
+import java.util.ArrayList;
+import java.util.Hashtable;
+import java.util.List;
+import java.util.Map;
+
+import org.junit.jupiter.api.BeforeEach;
+import org.junit.jupiter.api.Test;
+
+/**
+ * FR VAT Id Check Digit Tests.
+ */
+public class VATidFRCheckDigitTest extends AbstractCheckDigitTest {
+
+    /**
+     * Sets up routine & valid codes.
+     */
+    @BeforeEach
+    protected void setUp() {
+        checkDigitLth = VATidFRCheckDigit.CHECKDIGIT_LEN;
+        routine = VATidFRCheckDigit.getInstance();
+
+        valid = new String[] {"00300076965"
+            , "55502090897"
+            , "40303265045"
+            , "23334175221"
+            , "06399859412"
+//            , "K7399859412" // SLRL ALTEA EXPERTISE COMPTABLE => test in 
VATINValidatorTest

Review Comment:
   Is this work in progress? 



##########
src/test/java/org/apache/commons/validator/routines/checkdigit/VATidFRCheckDigitTest.java:
##########
@@ -0,0 +1,132 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You 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.apache.commons.validator.routines.checkdigit;
+
+import static org.junit.jupiter.api.Assertions.assertFalse;
+
+import java.util.ArrayList;
+import java.util.Hashtable;
+import java.util.List;
+import java.util.Map;
+
+import org.junit.jupiter.api.BeforeEach;
+import org.junit.jupiter.api.Test;
+
+/**
+ * FR VAT Id Check Digit Tests.
+ */
+public class VATidFRCheckDigitTest extends AbstractCheckDigitTest {
+
+    /**
+     * Sets up routine & valid codes.
+     */
+    @BeforeEach
+    protected void setUp() {
+        checkDigitLth = VATidFRCheckDigit.CHECKDIGIT_LEN;
+        routine = VATidFRCheckDigit.getInstance();
+
+        valid = new String[] {"00300076965"
+            , "55502090897"
+            , "40303265045"
+            , "23334175221"
+            , "06399859412"
+//            , "K7399859412" // SLRL ALTEA EXPERTISE COMPTABLE => test in 
VATINValidatorTest
+            , "83404833048"
+            , "11123456782" // konstruiert: L'identifiant n'existe pas dans le 
répertoire Sirene.
+            };
+        invalid = new String[] {"+6399859412"};
+    }
+
+    protected String checkDigit(final String code) {
+        if (code == null || code.length() <= checkDigitLth) {
+            return "";
+        }
+        return code.substring(0, checkDigitLth);
+    }
+
+    protected String removeCheckDigit(final String code) {
+        if (code == null || code.length() <= checkDigitLth) {
+            return null;
+        }
+        return code.substring(checkDigitLth);
+    }
+
+    /**
+     * {@inheritDoc}
+     * <p>
+     * Overridden to handle two digits prefix as <em>Check Digit</em>. The 
original test assumes
+     * that there is only one valid check digit. All other generated test 
(createInvalidCodes)
+     * codes should assertFalse. This is not so for FR VATINS. There are more 
valid check digits,
+     * one calculated with old style MOD97 and results to numeric and
+     * the other "new style" results to letters and digits.
+     * I collect the test results for each test case and print the result at 
the end.
+     * Example: 404833048 [C0, U0, J1, P1, ... 7U, 7V, 8V, 9V]  shows all the 
new style check digits
+     * </p>
+     */
+    @Test
+    @Override
+    public void testIsValidFalse() {
+        if (log.isDebugEnabled()) {
+            log.debug("testIsValidFalse() for " + 
routine.getClass().getName());
+        }
+
+        // test invalid code values
+        for (int i = 0; i < invalid.length; i++) {
+            if (log.isDebugEnabled()) {
+                log.debug("   " + i + " Testing Invalid Code=[" + invalid[i] + 
"]");
+            }
+            String invalidCode = invalid[i];
+            System.out.println("   " + i + " Testing Invalid Code=[" + 
invalidCode + "]");
+            assertFalse(routine.isValid(invalidCode), "invalid[" + i + "]: " + 
invalidCode);
+        }
+
+        // test invalid check digit values
+        final String[] invalidCheckDigits = createInvalidCodes(valid);
+        final Map<String, List<String>> icdmap = new Hashtable<String, 
List<String>>();
+        for (int i = 0; i < invalidCheckDigits.length; i++) {
+            if (log.isDebugEnabled()) {
+                log.debug("   " + i + " Testing Invalid Check Digit, Code=[" + 
invalidCheckDigits[i] + "]");
+            }
+            boolean res = routine.isValid(invalidCheckDigits[i]);
+            if (res) {
+//                log.warn("   " + i + " Testing Invalid Check Digit, Code=[" 
+ invalidCheckDigits[i] + "] is true, expected false.");

Review Comment:
   Remove // commented out code, these look like work-in-progress.



##########
src/test/java/org/apache/commons/validator/routines/checkdigit/VATidSKCheckDigitTest.java:
##########
@@ -0,0 +1,54 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You 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.apache.commons.validator.routines.checkdigit;
+
+import org.junit.jupiter.api.BeforeEach;
+
+/**
+ * SK VAT Id Check Digit Tests.
+ */
+/*

Review Comment:
   Merge comments.



##########
src/test/java/org/apache/commons/validator/routines/checkdigit/VATidLVCheckDigitTest.java:
##########
@@ -0,0 +1,55 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You 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.apache.commons.validator.routines.checkdigit;
+
+import org.junit.jupiter.api.BeforeEach;
+
+/**
+ * LV VAT Id Check Digit Tests.
+ */
+/*

Review Comment:
   Merge comments.



##########
src/test/java/org/apache/commons/validator/routines/checkdigit/VATidROCheckDigitTest.java:
##########
@@ -0,0 +1,53 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You 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.apache.commons.validator.routines.checkdigit;
+
+import org.junit.jupiter.api.BeforeEach;
+
+/**
+ * RO VAT Id Check Digit Tests.
+ */
+/*

Review Comment:
   Merge comments.
   



##########
src/test/java/org/apache/commons/validator/routines/checkdigit/VATidXICheckDigitTest.java:
##########
@@ -0,0 +1,173 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You 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.apache.commons.validator.routines.checkdigit;
+
+import static org.junit.jupiter.api.Assertions.assertFalse;
+
+import java.util.ArrayList;
+import java.util.Arrays;
+import java.util.Hashtable;
+import java.util.List;
+import java.util.Map;
+
+import org.junit.jupiter.api.BeforeEach;
+import org.junit.jupiter.api.Test;
+
+/**
+ * XI VAT Id Check Digit Tests.
+ */
+/*

Review Comment:
   Merge comments.



##########
src/test/java/org/apache/commons/validator/routines/checkdigit/VATidXICheckDigitTest.java:
##########
@@ -0,0 +1,173 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You 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.apache.commons.validator.routines.checkdigit;
+
+import static org.junit.jupiter.api.Assertions.assertFalse;
+
+import java.util.ArrayList;
+import java.util.Arrays;
+import java.util.Hashtable;
+import java.util.List;
+import java.util.Map;
+
+import org.junit.jupiter.api.BeforeEach;
+import org.junit.jupiter.api.Test;
+
+/**
+ * XI VAT Id Check Digit Tests.
+ */
+/*
+
+    XI 110305878 : gültig bullseyecountrysport
+    XI 366303068 : gültig donnellygroup.co.uk Company Info Reg. Company 
Number: NI 643,
+    GB 366303013 ist HUITAIHK TECHNOLOGY LIMITED, ABERDEEN
+    XI 174918964 : valide, aber ungültig da nicht in Nordirland
+    GB 174918964 : gültig, valid UK VAT number: RESPOND HEALTHCARE LIMITED, 
CARDIFF
+    GB 613451470 : gültig, UNIVERSITY OF LEEDS. Aus adresslabor.de
+    GB 107328000 : gültig, IBM UNITED KINGDOM LIMITED
+    // VAT with branch test in VATINValidatorTest
+    GB 107328000001 Nr mit Niederlassung : gültig, IBM UK RENTALS LTD
+    GB 107328000002 Nr mit Niederlassung : gültig, IBM UNITED KINGDOM HOLDINGS 
LTD
+    GB 766800804 : gültig, IDOX SOFTWARE LTD
+    GB 980780684 : ungültig. Aus formvalidation.io und koblas/stdnum-js
+    GB 340804329 : gültig, SUNS LIFESTYLE LIMITED
+    GB 888801276 : == GD012 gültig, CENTRE FOR MANAGEMENT & POLICY STUDIES 
CIVIL SERVICE COLLEGE
+    GB 888850259 : == HA502 gültig, DEFENCE ELECTRONICS AND COMPONENTS AGENCY
+    GB 888851256 : == HA512 gültig, HIGH SPEED TWO (HS2) LIMITED
+    XI/GB 434031494 : valide, aber nicht gültig (aus AT-Doku)
+VAT Mod 97   : GB 562235945 nicht gültig
+VAT Mod 9755 : GB 562235987 nicht gültig
+ */
+public class VATidXICheckDigitTest extends AbstractCheckDigitTest {
+
+    /**
+     * Sets up routine & valid codes.
+     */
+    @BeforeEach
+    protected void setUp() {
+        checkDigitLth = VATidGBCheckDigit.CHECKDIGIT_LEN;
+        routine = VATidGBCheckDigit.getInstance();
+
+//  366303068 (old style) 366303013 sind zwei verschiedene Unternehmen, die 
verschiedene PZ haben
+        valid = new String[] {"366303068" // old style XI
+              , "434031494"
+              , "110305836" // 1103058 36 old style for testing
+//              , "110305878", "174918964" // new style XI 9755 => test in 
VATINValidatorTest
+              , "613451470"
+              , "107328000"
+              , "766800804"
+              , "980780684"
+              , "888801276"
+              , "888850259"
+              , "888851256"
+              , "816137833"
+              , "562235945"
+              /* new style 9755 cannot be tested here

Review Comment:
   What does "new style" mean? Think about maintenance in these comments ;-)
   Where can it be tested then?



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to