[Demonstration 1]

[Buggy Method]
public void testRemoveClinicianIAScheduleWeektype(IAWeektype weekType) {
    Window iaSchedule = navigateScheduleWindow("IA");
    ListBox jList = iaSchedule.getListBox("JList" + weekType + "0");
    @SuppressWarnings("unchecked")
    JList<String> list = (JList<String>) jList.getAwtComponent();
    DefaultListModel<String> model = (DefaultListModel<String>) list.getModel();
    List<String> l = Utility.toStringList(model);
    String clinicianZero = l.get(0);
    PopupMenuInterceptor.run(jList.triggerRightClick(0)).getSubMenu("Remove Clinician").click();
    assertFalse(jList.contains(clinicianZero));
}

[Buggy Hunk]
ListBox jList = iaSchedule.getListBox("JList" + weekType + "0");

[Patch]
ListBox jList = iaSchedule.getListBox(IAWeektype.A + "-0-" + "11");

[Demonstration 2]

[Buggy Method]
private void showResults(ArrayList<String> bodies, ArrayList<String> fileAddresses) {
    GridBagConstraints gbc = new GridBagConstraints();
    setSize(getWidth(), BASE_HEIGHT + (bodies.size() - 1) * 50);
    setLocation(getX(), getY() - (bodies.size() - 1) * 25);
    setResizable(false);
    gbc.gridx = 0;
    gbc.gridy = 0;
    gbc.gridwidth = 1;
    gbc.gridheight = 1;
    gbc.weightx = 0;
    gbc.weighty = 0;
    gbc.fill = GridBagConstraints.BOTH;
    KeyListener kl = new KeyAdapter() {

        @Override
        public void keyReleased(KeyEvent e) {
            super.keyReleased(e);
            if (e.getKeyCode() == KeyEvent.VK_ESCAPE)
                SSS_Results.this.dispose();
        }
    };
    for (int i = 0; i < bodies.size(); i++) {
        pMain.add(new Result(this, kl, fileAddresses.get(i), bodies.get(i)));
        gbc.gridx = 0;
        gbc.gridy++;
        gbc.gridwidth = 1;
        gbc.gridheight = 1;
        gbc.weightx = 0;
        gbc.weighty = 0;
    }
    gbc.gridx = 0;
    gbc.gridy++;
    gbc.gridwidth = 1;
    gbc.gridheight = 1;
    gbc.weightx = 0;
    gbc.weighty = 0;
    gbc.weighty = 1;
    pMain.add(new JLabel(), gbc);
}

[Buggy Hunk]
pMain.add(new Result(this, kl, fileAddresses.get(i), bodies.get(i)));

[Patch]
pMain.add(new Result(this, kl, fileAddresses.get(i), bodies.get(i)), gbc);

[Demonstration 3]

[Buggy Method]
public String getServiceStatus(String service) throws UnknownServiceException {
    if (service == null) {
        throw new UnknownServiceException(NbBundle.getMessage(ServicesMonitor.class, "ServicesMonitor.nullServiceName.excepton.txt"));
    }
    String status = statusByService.get(service);
    if (status == null) {
        // no such service
        throw new UnknownServiceException(NbBundle.getMessage(ServicesMonitor.class, "ServicesMonitor.unknownServiceName.excepton.txt"));
    }
    return status;
}

[Buggy Hunk]
throw new UnknownServiceException(NbBundle.getMessage(ServicesMonitor.class, "ServicesMonitor.unknownServiceName.excepton.txt"));

[Patch]
throw new UnknownServiceException(NbBundle.getMessage(ServicesMonitor.class, "ServicesMonitor.unknownServiceName.excepton.txt", service));