private int literal(int decimal,StringBuffer buffer){
        if(decimal >= 1000){
            buffer.append("M");
            decimal -= 1000;
            return decimal;
        }
        else if(decimal >= 900){
            buffer.append("CM");
            decimal -= 900;
            return decimal;
        }
        else if(decimal >= 500){
            buffer.append("D");
            decimal -= 500;
            return decimal;
        }
        else if(decimal >= 400){
            buffer.append("CD");
            decimal -= 400;
            return decimal;
        }
        else if(decimal >= 100){
            buffer.append("C");
            decimal -= 100;
            return decimal;
        }
        else if(decimal >= 90){
            buffer.append("XC");
            decimal -= 90;
            return decimal;
        }
        else if(decimal >= 50){
            buffer.append("L");
            decimal -= 50;
            return decimal;
        }
        else if(decimal >= 40){
            buffer.append("XL");
            decimal -= 40;
            return decimal;
        }
        else if(decimal >= 10){
            buffer.append("X");
            decimal -= 10;
            return decimal;
        }else if(decimal >= 9){
            buffer.append("IX");
            decimal -= 9;
            return decimal;
        }
        else if(decimal >=5){
            buffer.append("V");
            decimal -= 5;
            return decimal;
        }else if(decimal >= 4){
            buffer.append("IV");
            decimal -= 4;
            return decimal;
        }else {
            buffer.append("I");
            decimal -= 1;
            return decimal;
        }
    }
Convert a roman number to decimal number
Test cases: smaller number appearing before bigger number unless it is representing one less. 
VL is incorrect since XL should be used to represent 90
chars not used in roman representation is used
http://www.onlineconversion.com/roman_numerals_advanced.htm
src/com/interview/misc/RomanNumberToDecimal.java