public void reset(final AptitudeBonusInventory inventory) { this.m_categories.clear(); this.m_categoriesById.clear(); (this.m_inventory = inventory.getInactiveCopy()).addListener(this); this.m_modifications.clear(); AptitudeCategoryModelManager.INSTANCE.forEachCategory( new TObjectProcedure<AptitudeCategoryModel>() { @Override public boolean execute(final AptitudeCategoryModel object) { final AptitudeBonusCategoryView category = new AptitudeBonusCategoryView(object, AptitudesView.this.m_inventory); AptitudesView.this.m_categories.add(category); AptitudesView.this.m_categoriesById.put(category.getId(), category); return true; } }); Collections.sort(this.m_categories, this.m_categoryViewComparator); this.m_currentCategory = this.m_categories.get(0); }