if (!recipeNames.contains(recipes[i].getRecipeName()))
if (!isInWorkspace(recipes[i]))
  private void addExperimentAndComponentsToWorkspace(Experiment experiment,                                       DefaultMutableTreeNode node) {    DefaultMutableTreeNode expNode =       addExperimentToWorkspace(experiment, node);    SocietyComponent societyComponent = experiment.getSocietyComponent();    String societyName = societyComponent.getSocietyName();    // add editable societies and recipes as siblings of experiment    // only if these aren't already in the workspace    if (!societyNames.contains(societyName)) {      societyNames.add(societyName);      addSocietyToWorkspace(societyComponent, node);    }    RecipeComponent[] recipes = experiment.getRecipeComponents();    for (int i = 0; i < recipes.length; i++)      if (!recipeNames.contains(recipes[i].getRecipeName()))        addRecipeToWorkspace(recipes[i], node);    // add non-editable societies and recipes    // as children of experiment    addSocietyToWorkspace(societyComponent, expNode);    for (int i = 0; i < recipes.length; i++)      addRecipeToWorkspace(recipes[i], expNode);    // select new experiment in workspace    workspace.setSelection(expNode);  }