void test_front_back() {
    string colors[3] = {"blue", "red", "green"};
    const int objWidth = 100;
    const int objHeight = 100;
    const int x0 = 100;
    const int y0 = 100;
    const int dx = 40;
    const int dy = 0;
    GButton *forward = new GButton("Cycle Forward");
    GButton *backward = new GButton("Cycle Backward");
    GButton *stepUp = new GButton("Backmost +1");
    GButton *stepDown = new GButton("Frontmost -1");
    Vector<GObject *> objects;
    gw->addToRegion(forward, "south");
    gw->addToRegion(backward, "south");
    gw->addToRegion(stepUp, "south");
    gw->addToRegion(stepDown, "south");
    GCompound *compound = new GCompound();
    for (int i = 0; i < 3; i++) {
        GOval *oval = new GOval(x0 + i*dx, y0 + i*dy, objWidth, objHeight);
        if (i == 1)
            oval->setLocation(oval->getLocation().getX(), oval->getLocation().getY() + 50);
        oval->setFilled(true);
        oval->setFillColor(colors[i]);
        objects.add(oval);
        compound->add(oval);
    }
    gw->add(new GLabel("Click in window to end test", 10, 30));
    gw->add(compound);
    while(true) {
        GEvent e = waitForEvent(ACTION_EVENT | CLICK_EVENT);
        if (e.getEventType() == MOUSE_CLICKED)
            break;
        else if (e.getEventType() == ACTION_PERFORMED) {
            string cmd = ((GActionEvent) e).getActionCommand();
            if (cmd == "Cycle Forward")
                cycleObjects(objects);
            if (cmd == "Cycle Backward")
                cycleObjects(objects, false);
            if (cmd == "Backmost +1")
                moveBottomUp(objects);
            if (cmd == "Frontmost -1")
                moveTopDown(objects);
        }
    }

}