Create subsets of Item objects
<p>hey guys i have class Item which i use to create Item objects</p>

<pre><code> public class Item {

 private String id; 
 private int count;
 private String  name;


public int getcount()
{
   return this.count; 
}

public Item(String name)
 {
     this.name=name;
     this.id = "";

 }



public Item(String id, String name)
 {
     this.name=name;
   this.id=id;

 }

public Item(int count)
{
    this.count=count;
}

public String getItemName()
{
    return this.name;
}

public String getItemId()
{
    return this.id;
}

public Item returnItems(ItemList itemset)
{
    Item item=null;

    return item;
}

}
</code></pre>

<p>And i have ItemList class that stores List of items. Here am adding List of item objects </p>

<pre><code>public  class ItemList implements Iterable&lt;Item&gt; 
{

  private List&lt;Item&gt; hold=new ArrayList&lt;Item&gt;();



  ItemList(Item item)
{


  this.hold.add(item); 
}

ItemList() {
    //throw new UnsupportedOperationException("Not yet implemented");
}


public List&lt;Item&gt; getItemSet()
{
    return this.hold;

}


public void addItems(Item item)
{
    //hold = new ArrayList&lt;Item&gt;();
    this.hold.add(item);
}


@Override
public Iterator&lt;Item&gt; iterator() {
     Iterator&lt;Item&gt; item = hold.iterator();
    return item; 
}



}
</code></pre>

<p>Supose  initailly i add I1,I2,I3 item obects to Itemlist as follows</p>

<pre><code> {I1}
 {I2}
 {I3}
</code></pre>

<p>now i want to create a subsets of Item objects as follows and add to ItemList where each subset will contain 2 Items</p>

<pre><code>     {I1 I2}
     {I1 I3}
     {I2 I3}
</code></pre>

<p>Please help in creating a subset
 Later i even want have subsets of 2 Items or more
 I want to write a function that will help me to create subsets of n  items
 Please help</p>
