// Path: src/main/java/com/sangupta/dryredis/support/DryRedisSetAggregationType.java
// public enum DryRedisSetAggregationType {
// 
//     SUM,
//     
//     MIN,
//     
//     MAX;
//     
// }


import com.sangupta.dryredis.support.DryRedisSetAggregationType;
import java.util.ArrayList;
import java.util.Collection;
import java.util.Comparator;
import java.util.HashMap;
import java.util.Iterator;
import java.util.List;
import java.util.Map;
import java.util.SortedSet;
import java.util.TreeSet;

                    default:
                        throw new IllegalArgumentException("Unknown aggregation type");
                }
                
                if(finalPriority != incomingPriority) {
                    // priority needs to be updated
                    // resorting will happen
                    this.remove(incomingElement);
                    
                    // update priority of element
                    this.add(new ElementWithPriority<E>(incomingElement.getData(), finalPriority));
                    
                    // updated
                    modified = true;
                }
            } else {
                // new element
                this.add(incomingElement);
                modified = true;
            }
        }
        
        return modified;
    }

    @Override
    public boolean addAll(Collection<? extends ElementWithPriority<E>> c) {
        boolean added = false;
        for(ElementWithPriority<E> element : c) {
// Path: src/main/java/com/sangupta/dryredis/support/DryRedisSetAggregationType.java
// public enum DryRedisSetAggregationType {
// 
//     SUM,
//     
//     MIN,
//     
//     MAX;
//     
// }


// Path: src/main/java/com/sangupta/dryredis/ds/SortedSetWithPriority.java
import com.sangupta.dryredis.support.DryRedisSetAggregationType;
import java.util.ArrayList;
import java.util.Collection;
import java.util.Comparator;
import java.util.HashMap;
import java.util.Iterator;
import java.util.List;
import java.util.Map;
import java.util.SortedSet;
import java.util.TreeSet;


                    default:
                        throw new IllegalArgumentException("Unknown aggregation type");
                }
                
                if(finalPriority != incomingPriority) {
                    // priority needs to be updated
                    // resorting will happen
                    this.remove(incomingElement);
                    
                    // update priority of element
                    this.add(new ElementWithPriority<E>(incomingElement.getData(), finalPriority));
                    
                    // updated
                    modified = true;
                }
            } else {
                // new element
                this.add(incomingElement);
                modified = true;
            }
        }
        
        return modified;
    }

    @Override
    public boolean addAll(Collection<? extends ElementWithPriority<E>> c) {
        boolean added = false;
        for(ElementWithPriority<E> element : c) {
            if(this.add(element)) {