public class App {
    public static void main(String[] args) {
        // Create a bag with the default capacity
        ArrayBag b1 = new ArrayBag();

        // Create a rectangle & add it to the bag
        Rectangle rect = new Rectangle(10, 20);
        b1.add(rect);

        // Add an integer
        b1.add(123);

        // Add a string
        b1.add("foo");

        System.out.println("bag 1: " + b1);
        System.out.println("grab without removing: " + b1.grab());

        System.out.println("remove return value = " + b1.remove(rect));

        System.out.println("bag 1 after removing rect: " + b1);

        ArrayBag b2 = new ArrayBag(b1);
        System.out.println("bag 2: " + b2);
        b2.add("bar");
        System.out.println("bag 1: " + b1 + ", bag 2: " + b2);
    }
}
