public void checkRomanNr(String romanNumber) {
        int[] substractOperations = new int[8];
        char currentLetter = romanNumber.charAt(0);
        char nextLeter = romanNumber.charAt(1);

        int globalMax;

        if (getValue(currentLetter) < getValue(nextLeter)) {
            globalMax = getValue(nextLeter);
            substractOperations[getIndex(nextLeter)] = 1;
        } else {
            globalMax = getValue(currentLetter);
        }

        currentLetter = nextLeter;
        for (int j = 2; j < romanNumber.length(); j++) {
            nextLeter = romanNumber.charAt(j);
            int localMax;
            if (getValue(currentLetter) < getValue(nextLeter)) {
                localMax = getValue(nextLeter);
                if (substractOperations[getIndex(nextLeter)] == 1) {
                    System.err.println("The syntax of the roman number is not valid.");
                    System.exit(2);
                }
                substractOperations[getIndex(nextLeter)] = 1;
            } else {
                localMax = getValue(currentLetter);
            }

            if (localMax > globalMax) {
                System.err.println("The syntax of the roman number is not valid.");
                System.exit(2);
            }
            currentLetter = nextLeter;
            globalMax = localMax;
        }

    }