Your task is to implement the method toRoman in the class ToRoman.
Convert the given value in the method toRoman into a Roman numeral.
The value must be converted as long as it is between 1 and 3999. Values outside this limits may cause an IllegalArgumentException.
The result may only contain the upper case characters M, D, C, L, X, V, I [Wikipedia].
The characters have the following values:
The characters are interpreted in an additive order. The value 271 is represented by the characters CCLXXI.
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 ToRomanTest. The unit tests are disabled at the start. To use them you have to enable them.
The reverse exercise can be found in From Roman.
To perform this exercise you need a JDK 8 and Maven 3.3.x.