@SuppressWarnings("unchecked")
    public Object guard(Object aArg, IContext aCtx)
    throws TypeSpecException
    {
        if(!(aArg instanceof List))
            throw new TypeSpecException(TypeUtil.msgExpectedOther(getSpecName(), aArg));
        final List lListArg = (List) aArg;

        if(min >= 0 && lListArg.size() < min)
            throw new TypeSpecException(String.format("Not enough elements in the list. There should be at least %d elements.", min));
        else if (max >= 0 && lListArg.size() > max)
            throw new TypeSpecException(String.format("Too many elements in the list. There should be at most %d elements.", max));

        try
        {
            // The list is modified in-place
            //
            final ListIterator lIter = lListArg.listIterator();
            while(lIter.hasNext())
            {
                Object lObj = lIter.next();
                lIter.remove();
                lIter.add(spec.guard(lObj, aCtx));
            }
            return lListArg;
        }
        catch (UnsupportedOperationException e)
        {
            // We could not modify the list in-place ...
            // We recover by creating a new one in this case.
            //
            final List lNewList = new ArrayList(lListArg.size());
            for(Object lArg: lListArg)
            {
                lNewList.add(spec.guard(lArg, aCtx));
            }
            return lNewList;
        }
    }