public Item convertListsToSets(String ... listAttrNames) {
        rejectNullInput(listAttrNames);
        // Verify all attributes are good
        for (String attrName: listAttrNames) {
            checkInvalidAttrName(attrName);
            if (List.class.isAssignableFrom(getTypeOf(attrName))) {
                List<?> list = getList(attrName);
                if (list != null) {
                    for (Object e: list) {
                        if (e instanceof String) {
                            Set<String> ss = getStringSet(attrName);
                            if (list.size() != ss.size())
                                throw new IllegalArgumentException("List cannot be converted to Set due to duplicate elements");
                        } else if (e instanceof Number) {
                            Set<BigDecimal> ss = getNumberSet(attrName);
                            if (list.size() != ss.size())
                                throw new IllegalArgumentException("List cannot be converted to Set due to duplicate elements");
                        } else if (e instanceof byte[]) {
                            Set<byte[]> ss = getBinarySet(attrName);
                            if (list.size() != ss.size())
                                throw new IllegalArgumentException("List cannot be converted to Set due to duplicate elements");
                        }
                    }
                }
            } else {
                throw new IllegalArgumentException("Attribute " + attrName + " is not a list");
            }
        }
        // Do the conversion
        for (String attrName: listAttrNames) {
            checkInvalidAttrName(attrName);
            List<?> list = getList(attrName);
            if (list != null) {
                boolean converted = false;
                for (Object e: list) {
                    if (e instanceof String) {
                        Set<String> set = getStringSet(attrName);
                        withStringSet(attrName, set);
                        converted = true;
                        break;
                    } else if (e instanceof Number) {
                        Set<BigDecimal> set = getNumberSet(attrName);
                        withBigDecimalSet(attrName, set);
                        converted = true;
                        break;
                    } else if (e instanceof byte[]) {
                        Set<byte[]> set = getBinarySet(attrName);
                        withBinarySet(attrName, set);
                        converted = true;
                        break;
                    }
                }
                if (!converted) {
                    // All elements are null.  So treat it as a String set.
                    Set<String> set = getStringSet(attrName);
                    withStringSet(attrName, set);
                }
            }
        }
        return this;
    }
Utility method to converts the designated attributes from
<code>List</code> into <code>Set</code>, throwing
<code>IllegalArgumentException</code> should there be duplicate elements.

@param listAttrNames
           names of attributes to be converted.

@see #fromJSON(String)
aws-java-sdk-dynamodb/src/main/java/com/amazonaws/services/dynamodbv2/document/Item.java