### Question:
RomanToInt { public int romanToInt(String s) { if (s == null || s.length() == 0) { return 0; } int result = 0; int pre = getValue(s.charAt(0)); for (int i = 1; i < s.length(); i++) { int cur = getValue(s.charAt(i)); if (pre < cur) { result -= pre; } else { result += pre; } pre = cur; } result += pre; return result; }  int romanToInt(String s);  }### Answer:
@Test void go() { RomanToInt romanToInt = new RomanToInt(); for (int i = 0; i < cases.size(); i++) { assertEquals(results.get(i),Integer.valueOf(romanToInt.romanToInt(cases.get(i)))); } }