class UniqueTransform extends DocumentTransform.DefaultDocumentTransform {

    List<FieldSet> getOrderedFieldSets(Document document) {
        Set<Multimap<String,String>> fieldSets = getFieldSets(document);
        List<FieldSet> orderedFieldSets = new ArrayList<>(fieldSets.size());
        for (Multimap<String,String> fieldSet : fieldSets) {
            FieldSet orderedFieldSet = new FieldSet();
            for (String field : fieldSet.keySet()) {
                List<String> values = new ArrayList<>(fieldSet.get(field));
                Collections.sort(values);
                String value = Joiner.on(',').join(values);
                orderedFieldSet.put(field, value);
            }
            orderedFieldSets.add(orderedFieldSet);
        }
        Collections.sort(orderedFieldSets);
        return orderedFieldSets;
    }

    public  UniqueTransform(Set<String> fields);
    public  UniqueTransform(BaseQueryLogic<Entry<Key,Value>> logic, Set<String> fields);

}