@SuppressWarnings("unchecked")
    private <T> List<T> parseList(String padding, ClassAccessor<T> subtype, TokenStream stream, boolean ignoreCase) {
        @SuppressWarnings("rawtypes")
        LinkedList results = new LinkedList();
        TokenStream backup = stream.clone();
        try {
            while (true) {
                Object nextItem;
                if (isPrimitive(subtype))
                    nextItem = parsePrimitive(subtype, null, stream);
                else
                    nextItem = parseClass(subtype, stream);
                results.add(nextItem);
                String next = stream.next();
                if (next == null || !compare(next, padding, ignoreCase)) {
                    stream.putback(next);
                    break;
                }
            }
        } catch (ParseException e) {
            stream.restoreFrom(backup);
        }
        return results;
    }