void () { myRepeatCb.addActionListener(new ActionListener() { @Override public void actionPerformed(ActionEvent e) { int testType = (Integer)Objects.requireNonNull(myTypeChooser.getSelectedItem()); if (testType == JUnitConfigurationModel.CLASS || testType == JUnitConfigurationModel.METHOD) { String[] model = getForkModel(testType, JUnitConfigurable.this.myRepeatCb.getSelectedItem()); myForkCb.setModel(new DefaultComboBoxModel<>(model)); } } }); }