public Set<String> getStringSet(String attrName) {
        Object val = attributes.get(attrName);
        if (val == null)
            return null;
        Set<String> stringSet = new LinkedHashSet<String>();
        if (val instanceof Collection) {
            Collection<?> col = (Collection<?>) val;
            if (col.size() == 0)
                return stringSet;
            for (Object element: col) {
                String s = element == null ? null : valToString(element);
                if (!stringSet.add(s))
                    throw new IncompatibleTypeException(val.getClass()
                        + " cannot be converted into a set of strings because of duplicate elements");
            }
            return stringSet;
        }
        stringSet.add(valToString(val));
        return stringSet;
    }
Returns the value of the specified attribute in the current item as a set
of strings; or null if the attribute either doesn't exist or the
attribute value is null.

@throws IncompatibleTypeException
            if the attribute value cannot be converted into a set of
            strings because of duplicate elements

@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