private boolean alreadyExists(String name){
  for (  String item : existingItems) {
    if (item.equals(name)) {
      return true;
    }
  }
  return false;
}

private boolean alreadyExists ( String name ) { for ( String item : existingItems ) { if ( item . equals ( name ) ) { return true ; } } return false ; }
indicates whether an element with such a name already exists .
