Your task is to implement the method fromRoman in the class FromRoman.
Convert the given romanValue in the method fromRoman into an integer.
The romanValue must be converted as long as it is between 1 (I) and 3999 (MMMCMXCIX). Values outside this limits may cause an IllegalArgumentException.
The romanValue may only contain the upper case characters M, D, C, L, X, V, I [Wikipedia]. Any other character may cause an IllegalArgumentException.
The characters have the following values:
The characters are interpreted in an additive order. The characters CCLXXI are representing the value 271.
The only exceptions to the additive order are that
This means that e.g IX is interpreted as 9 and CD is interpreted as 400.
Some examples of conversions:
To support you with implementing the method there are unit tests in FromRomanTest. The unit tests are disabled at the start. To use them you have to enable them.
The reverse exercise can be found in To Roman.
To perform this exercise you need a JDK 8 and Maven 3.3.x.