public <T> List<T> getList(String attrName) {
        Object val = attributes.get(attrName);
        if (val == null)
            return null;
        if (val instanceof List) {
            @SuppressWarnings("unchecked")
            List<T> ret = (List<T>)val;
            return ret;
        }
        List<T> list = new ArrayList<T>();
        if (val instanceof Collection) {
            Collection<?> col = (Collection<?>)val;
            for (Object element: col) {
                @SuppressWarnings("unchecked")
                T t = (T)element;
                list.add(t);
            }
            return list;
        }
        @SuppressWarnings("unchecked")
        T t = (T)val;
        list.add(t);
        return list;
    }
Returns the value of the specified attribute in the current item as a set
of <code>T</code>'s.; or null if the attribute either doesn't exist or
the attribute value is null.

@throws ClassCastException
            if the attribute involves a value that cannot be casted to
            <code>T</code>

@see #isNull(String) #isNull(String) to check if the attribute value is
     null.
@see #isPresent(String) #isPresent(String) to check if the attribute
     value is present.
aws-java-sdk-dynamodb/src/main/java/com/amazonaws/services/dynamodbv2/document/Item.java