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);
    }

}

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");
        }
        if ( ! nominees.containsAll(electees))
            throw new IllegalArgumentException(
                    "The electees argument was not a subset " +
                            "of the nominees argument"
            );
        this.electees = electees;
    }

    public ElectedText(NominatedText nominatedText, List<Integer> electees){
        this(
                nominatedText.getStringList(),
                nominatedText.getNominees(),
                electees
        );
    }

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

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

}

Make init throw exception when electees not subset of nominees
Make init throw exception when electees not subset of nominees
