if (experiment.getSocietyComponent().equals(society))
SocietyComponent sc = experiment.getSocietyComponent(); if (sc != null && sc.equals(society)) { experiment.modified(new ModificationEvent(this, 0));
  private ArrayList getExperimentNamesInWorkspace(SocietyComponent society) {    ArrayList results = new ArrayList();    ArrayList experiments = getExperiments();    for (int i = 0; i < experiments.size(); i++) {      Experiment experiment = (Experiment)experiments.get(i);      if (experiment.getSocietyComponent().equals(society))        results.add(experiment.getExperimentName());    }    return results;  }