import java.util.*; public class MultipleGroups implements NumberGroup { private List groupList; public MultipleGroups() { groupList = new ArrayList(); } public void add(NumberGroup g) { groupList.add(g); } public boolean contains(int num) { for(NumberGroup n : groupList) if(n.contains(num)) return true; return false; } public String toString() { return ""+groupList; } }