}
enum RomanToDecimal {
+ THOUSAND("M", 1000),
+ NINE_HUNDRED("CM", 900),
+ FIVE_HUNDRED("D", 500),
+ FOUR_HUNDRED("CD", 400),
+ HUNDRED("C", 100),
+ NINETY("XC", 90),
+ FIFTY("L", 50),
+ FOURTY("XL", 40),
TEN("X", 10),
+ NINE("IX", 9),
FIVE("V", 5),
FOUR("IV", 4),
ONE("I", 1);
assertThat(romanFor(10), is("X"));
assertThat(romanFor(18), is("XVIII"));
assertThat(romanFor(30), is("XXX"));
+ assertThat(romanFor(2687), is("MMDCLXXXVII"));
+ assertThat(romanFor(3499), is("MMMCDXCIX"));
}
}