package com.grayben.riskExtractor.headingMarker.elector;

import java.util.Collections;
import java.util.List;

import com.grayben.riskExtractor.headingMarker.nominator.NominatedText;

public class ElectedText

        extends
        NominatedText

        implements
	    ElecteesRetrievable {

    //TODO: make this a set: should not have repetitions
    List<Integer> electees;

    public ElectedText(List<String> textList, List<Integer> nominees, List<Integer> electees){
        super(textList, nominees);
        if (electees == null) {
            throw new NullPointerException("Attempted to pass illegal null argument");
        }
        this.electees = electees;
    }

    public ElectedText(NominatedText nominatedText, List<Integer> electees){
        super(nominatedText);
        if (electees == null) {
            throw new NullPointerException("Attempted to pass illegal null argument");
        }
        this.electees = electees;
    }

    public ElectedText(ElectedText electedText){
        this(electedText, electedText.getElectees());
    }

    @Override
    public List<Integer> getElectees() {
        return Collections.unmodifiableList(this.electees);
    }

}

@@ -627,32 +627,261 @@
 nt%22);%0A        %7D%0A
+        if ( ! nominees.containsAll(electees))%0A            throw new IllegalArgumentException(%0A                    %22The electees argument was not a subset %22 +%0A                            %22of the nominees argument%22%0A            );%0A
         this.ele
@@ -994,148 +994,105 @@
     
-super(nominatedText);%0A        if (electees == null) %7B%0A            throw new NullPo
+this(%0A                nominatedText.getStringList(),%0A                nom
 in
+a
 te
-rException(%22Attempted to pass illegal null argument%22);
+dText.getNominees(),
 %0A   
@@ -1096,26 +1096,24 @@
         
-%7D%0A
         
 this.ele
@@ -1100,37 +1100,32 @@
             
-this.
 electees
  = electees;
@@ -1108,35 +1108,34 @@
     electees
- = electees
+%0A        )
 ;%0A    %7D%0A%0A   

Make init throw exception when electees not subset of nominees