private void serialize(NestedInteger nestedInteger, StringBuffer result) {
        if (nestedInteger.isInteger()) {
            result.append(nestedInteger.getInteger());
            return;
        }
        boolean isFirst = true;
        result.append("[");
        for (NestedInteger ni : nestedInteger.getList()) {
            if (!isFirst) {
                result.append(",");
            }
            isFirst = false;
            if (ni.isInteger()) {
                result.append(ni.getInteger());
            } else {
                serialize(ni, result);
            }
        }
        result.append("]");
    }
Date 10/10/2016
@author Tushar Roy

Given a nested list of integers represented as a string, implement a parser to deserialize it.
Each element is either an integer, or a list -- whose elements may also be integers or other lists.

https://leetcode.com/problems/mini-parser/
src/com/interview/misc/IntegerListParser.java