import java.util.*;

public class Bag
{
    public Bag (String type)
    {
        this(type, 0);
    }

    public Bag (String type, int quantity)
    {
        _type = type;
        _quantity = quantity;
        _contains = new Vector<Bag>();
    }
    
    public void add (Bag b)
    {
        _contains.add(b);
    }

    @Override
    public String toString ()
    {
        String str = "Bag colour: "+_type+" "+Rules.CONTAINS;

        if (_contains.size() > 0)
        {
            Enumeration<Bag> iter = _contains.elements();

            while (iter.hasMoreElements())
            {
                Bag b = iter.nextElement();

                if (b._quantity > 0)
                {
                    
                }
            }
        }
        else
            str += Rules.NO_BAGS;

        return str;
    }

    @Override
    public int hashCode ()
    {
        return Objects.hash(_type);
    }

    @Override
    public boolean equals (Object obj)
    {
        if (obj == null)
            return false;

        if (this == obj)
            return true;
        
        if (getClass() == obj.getClass())
        {
            Bag temp = (Bag) obj;

            return temp._type.equals(_type);
        }

        return false;
    }

    private String _type;
    private int _quantity;
    private Vector<Bag>_contains;
}
@@ -312,38 +312,24 @@
 (b);%0A    %7D%0A%0A
-    @Override%0A
     public S
@@ -338,16 +338,12 @@
 ing 
-toString
+rule
  ()%0A
@@ -373,28 +373,12 @@
 r = 
-%22Bag colour: %22+_type
+this
 +%22 %22
@@ -679,117 +679,375 @@
     
-%0A                %7D%0A            %7D%0A        %7D%0A        else%0A            str += Rules.NO_BAGS;%0A%0A        return str
+str += _quantity+%22 %22;%0A                %7D%0A%0A                str += b;%0A%0A                if (iter.hasMoreElements())%0A                    str += Rules.SEPARATOR;%0A            %7D%0A        %7D%0A        else%0A            str += Rules.NO_BAGS;%0A%0A        str += Rules.TERMINATOR;%0A        %0A        return str;%0A    %7D%0A%0A    @Override%0A    public String toString ()%0A    %7B%0A        return _type
 ;%0A  

Update Bag.java