// Path: src/main/java/uk/org/okapibarcode/util/Arrays.java
// public static int positionOf(char value, char[] array) {
//     for (int i = 0; i < array.length; i++) {
//         if (value == array[i]) {
//             return i;
//         }
//     }
//     throw new OkapiException("Unable to find character '" + value + "' in character array.");
// }


import static uk.org.okapibarcode.util.Arrays.positionOf;

     *
     * @return the check digit mode
     */
    public CheckDigit getCheckDigit() {
        return checkOption;
    }

    @Override
    protected void encode() {

        if (!content.matches("[0-9A-Z\\. \\-$/+%]*")) {
            throw new OkapiException("Invalid characters in input");
        }

        String start = "1211212111";
        String stop = "121121211";

        int patternLength = start.length() +
                            stop.length() +
                            (10 * content.length()) +
                            (checkOption == CheckDigit.MOD43 ? 10 : 0);

        StringBuilder dest = new StringBuilder(patternLength);
        dest.append(start);

        int counter = 0;
        char checkDigit = ' ';

        for (int i = 0; i < content.length(); i++) {
            char c = content.charAt(i);

// Path: src/main/java/uk/org/okapibarcode/util/Arrays.java
// public static int positionOf(char value, char[] array) {
//     for (int i = 0; i < array.length; i++) {
//         if (value == array[i]) {
//             return i;
//         }
//     }
//     throw new OkapiException("Unable to find character '" + value + "' in character array.");
// }


// Path: src/main/java/uk/org/okapibarcode/backend/Code3Of9.java
import static uk.org.okapibarcode.util.Arrays.positionOf;

     *
     * @return the check digit mode
     */
    public CheckDigit getCheckDigit() {
        return checkOption;
    }

    @Override
    protected void encode() {

        if (!content.matches("[0-9A-Z\\. \\-$/+%]*")) {
            throw new OkapiException("Invalid characters in input");
        }

        String start = "1211212111";
        String stop = "121121211";

        int patternLength = start.length() +
                            stop.length() +
                            (10 * content.length()) +
                            (checkOption == CheckDigit.MOD43 ? 10 : 0);

        StringBuilder dest = new StringBuilder(patternLength);
        dest.append(start);

        int counter = 0;
        char checkDigit = ' ';

        for (int i = 0; i < content.length(); i++) {
            char c = content.charAt(i);

            int index = positionOf(c, LOOKUP);
