void () { GridBagCase gbc = new GridBagCase(); gbc.addButton("Button 1", GridBagConstraints.RELATIVE, GridBagConstraints.RELATIVE); gbc.addButton("Button 2", GridBagConstraints.RELATIVE, GridBagConstraints.RELATIVE); gbc.addButton("Button 3", GridBagConstraints.RELATIVE, GridBagConstraints.RELATIVE); processSnapshot(gbc); assertEquals(3, myContainer.getComponentCount()); assertEquals(0, myContainer.getComponent(0).getConstraints().getColumn()); assertEquals(1, myContainer.getComponent(1).getConstraints().getColumn()); assertEquals(2, myContainer.getComponent(2).getConstraints().getColumn()); }