public void addCategory(Category category){
  if (categories == null) {
    categories=new ArrayList<Category>();
  }
  categories.add(category);
}

public void addCategory ( Category category ) { if ( categories == null ) { categories = new ArrayList < Category > ( ) ; } categories . add ( category ) ; }
adds a new category to the category list .
